Thanks for the comments! New patch coming up.

================
Comment at: lib/CodeGen/CodeGenModule.cpp:1613
@@ +1612,3 @@
+    // initializers as definitions.
+    if (getTarget().getCXXABI().isMicrosoft() && D->isStaticDataMember() &&
+        D->hasInit() && !D->isThisDeclarationADefinition())
----------------
Reid Kleckner wrote:
> The advice I've gotten from John is to add predicates to TargetCXXABI like 
> isArgumentDestroyedByCallee() and use those instead of querying isMicrosoft() 
> directly.  This would be something like isStaticDataMemberLinkOnce().
Sounds good to me.

================
Comment at: lib/CodeGen/CodeGenModule.cpp:1873
@@ +1872,3 @@
+  if (getTarget().getCXXABI().isMicrosoft() && D->isStaticDataMember() &&
+      InitExpr && !InitDecl->isThisDeclarationADefinition())
+    GV->setLinkage(llvm::GlobalVariable::LinkOnceODRLinkage);
----------------
Reid Kleckner wrote:
> Can you add some test cases for the other side of this?
> 
>   struct S { static const int x; }; const int S::x = 1;
> 
> Is S::x selectany or strong here?
It's strong. It's only when the var is initialized inline (in the class 
declaration) that things get special. I'll expand the test to cover this.


http://llvm-reviews.chandlerc.com/D2233
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to