[cfe-commits] r117410 - in /cfe/trunk: lib/CodeGen/CGDeclCXX.cpp lib/CodeGen/ItaniumCXXABI.cpp test/CodeGenCXX/specialized-static-data-mem-init.cpp
jahanian
fjahanian at apple.com
Wed Oct 27 09:26:53 PDT 2010
On Oct 26, 2010, at 5:06 PM, Douglas Gregor wrote:
>
> On Oct 26, 2010, at 3:47 PM, Fariborz Jahanian wrote:
>
>> Author: fjahanian
>> Date: Tue Oct 26 17:47:47 2010
>> New Revision: 117410
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=117410&view=rev
>> Log:
>> Patch to provide guard when initializing instances
>> of static data member of a class template.
>> Fixes //rdar :// 8562966 and pr8409.
>>
>> Added:
>> cfe/trunk/test/CodeGenCXX/specialized-static-data-mem-init.cpp
>> Modified:
>> cfe/trunk/lib/CodeGen/CGDeclCXX.cpp
>> cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
>>
>> Modified: cfe/trunk/lib/CodeGen/CGDeclCXX.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDeclCXX.cpp?rev=117410&r1=117409&r2=117410&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/CodeGen/CGDeclCXX.cpp (original)
>> +++ cfe/trunk/lib/CodeGen/CGDeclCXX.cpp Tue Oct 26 17:47:47 2010
>> @@ -253,7 +253,15 @@
>> SourceLocation());
>>
>> llvm::Constant *DeclPtr = CGM.GetAddrOfGlobalVar(D);
>> - EmitCXXGlobalVarDeclInit(*D, DeclPtr);
>> + if (D->isStaticDataMember() &&
>> + D->getInstantiatedFromStaticDataMember() && D->getInit()){
>
> This should check whether D will get weak linkage. If not, we don't need the guards.
Done in r117452.
- fariborz
More information about the cfe-commits
mailing list