================
Comment at: lib/CodeGen/CodeGenModule.cpp:1873
@@ +1872,3 @@
+ if (getTarget().getCXXABI().isMicrosoft() && D->isStaticDataMember() &&
+ InitExpr && !InitDecl->isThisDeclarationADefinition())
+ GV->setLinkage(llvm::GlobalVariable::LinkOnceODRLinkage);
----------------
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?
================
Comment at: lib/CodeGen/CodeGenModule.cpp:1613
@@ +1612,3 @@
+ // initializers as definitions.
+ if (getTarget().getCXXABI().isMicrosoft() && D->isStaticDataMember() &&
+ D->hasInit() && !D->isThisDeclarationADefinition())
----------------
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().
http://llvm-reviews.chandlerc.com/D2233
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits