Closed Bug 1021290 Opened 10 years ago Closed 10 years ago

More Atomics.h build fixes for clang-cl

Categories

(Core :: MFBT, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla33

People

(Reporter: jrmuizel, Assigned: ehsan.akhgari)

References

Details

Attachments

(1 file, 1 obsolete file)

This is basically more of bug 932454
Attachment #8435286 - Flags: review?(nfroyd)
Comment on attachment 8435286 [details] [diff] [review]
More Atomics.h build fixes for clang-cl

Review of attachment 8435286 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with the change below.

::: mfbt/Atomics.h
@@ +885,4 @@
>  struct IntrinsicIncDec : public IntrinsicAddSub<T>
>  {
>    typedef typename IntrinsicAddSub<T>::ValueType ValueType;
> +  typedef typename IntrinsicBase<T>::Primitives Primitives;

I don't think this is needed, since we never use Primitives in this class, right?
Attachment #8435286 - Flags: review?(nfroyd) → review+
Assignee: nobody → jmuizelaar
Blocks: winclang
This is basically more of bug 932454
Comment on attachment 8436988 [details] [diff] [review]
More Atomics.h build fixes for clang-cl. r=froydnj

This builds on MSVC10.  The gfx changes are needed because on MSVC10, you seem to need the full definition of T for Atomic<T> because we end up requiring to compute its size somehow.  That is a bug in that compiler which has been fixed in MSVC11.  Other than that, I also had to handle the partial specialization of AtomicIntrinsics.
Attachment #8436988 - Flags: review?(nfroyd)
Flags: needinfo?(jmuizelaar)
Assignee: jmuizelaar → ehsan
Attachment #8435286 - Attachment is obsolete: true
Comment on attachment 8436988 [details] [diff] [review]
More Atomics.h build fixes for clang-cl. r=froydnj

Review of attachment 8436988 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with the AtomicIntrinsics change explained.

::: mfbt/Atomics.h
@@ +916,5 @@
>  struct AtomicIntrinsics<T*, Order> : public IntrinsicMemoryOps<T*, Order>,
>                                       public IntrinsicIncDec<T*>
>  {
>    typedef typename IntrinsicMemoryOps<T*, Order>::ValueType ValueType;
> +  typedef typename IntrinsicBase<T*>::Primitives Primitives;

You say "I had to handle this", but where does AtomicIntrinsics<T*>::Primitives get used?  It doesn't get used in this class, and it doesn't get used further down...so where is this relevant?
Attachment #8436988 - Flags: review?(nfroyd) → review+
Talked to Nathan on IRC and explained that I don't really understand why any of my parts are needed, except for working around MSVC10 compiler bugs.  Will add a comment to that affect when landing.

https://tbpl.mozilla.org/?tree=Try&rev=f1afceb2266f
https://hg.mozilla.org/mozilla-central/rev/fa494104700e
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
(In reply to :Ehsan Akhgari (lagging on bugmail, needinfo? me!) from comment #4)
> This builds on MSVC10.  The gfx changes are needed because on MSVC10, you
> seem to need the full definition of T for Atomic<T> because we end up
> requiring to compute its size somehow.

In AsyncPanZoomController.h we use Atomic<T*>, not Atomic<T>. I assume that also requires the full definition of T?
(In reply to comment #9)
> (In reply to :Ehsan Akhgari (lagging on bugmail, needinfo? me!) from comment
> #4)
> > This builds on MSVC10.  The gfx changes are needed because on MSVC10, you
> > seem to need the full definition of T for Atomic<T> because we end up
> > requiring to compute its size somehow.
> 
> In AsyncPanZoomController.h we use Atomic<T*>, not Atomic<T>. I assume that
> also requires the full definition of T?

Unfortunately yes.
(In reply to :Ehsan Akhgari (lagging on bugmail, needinfo? me!) from comment #10)
> (In reply to comment #9)
> > (In reply to :Ehsan Akhgari (lagging on bugmail, needinfo? me!) from comment
> > #4)
> > > This builds on MSVC10.  The gfx changes are needed because on MSVC10, you
> > > seem to need the full definition of T for Atomic<T> because we end up
> > > requiring to compute its size somehow.
> > 
> > In AsyncPanZoomController.h we use Atomic<T*>, not Atomic<T>. I assume that
> > also requires the full definition of T?
> 
> Unfortunately yes.

If somebody knows appropriate template tricks to not require this, I would be in favor of fixing this.  I think it's surprising behavior.  (But then again, non-MSVC has required this for a long time now and nobody has complained too loudly, so....)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: