diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-03-08 15:51:03 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-03-08 15:51:03 +0000 |
commit | df88f6fe98793d8305797f23e38d613bc6960028 (patch) | |
tree | d02df95d501d6603e58b2f7e9408525c4b12b3bf /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 3cbe5cfff30688f0da694462baf7263b5b9625e8 (diff) | |
download | llvm-df88f6fe98793d8305797f23e38d613bc6960028.zip llvm-df88f6fe98793d8305797f23e38d613bc6960028.tar.gz llvm-df88f6fe98793d8305797f23e38d613bc6960028.tar.bz2 |
Replace MarkVarRequired with a more generic
HandleCXXStaticMemberVarInstantiation. Suggested by Argyrios.
llvm-svn: 152320
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index b2bfab0..0399ec4 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1722,8 +1722,12 @@ static void ReplaceUsesOfNonProtoTypeWithRealFunction(llvm::GlobalValue *Old, } } -void CodeGenModule::MarkVarRequired(VarDecl *VD) { - GetAddrOfGlobalVar(VD); +void CodeGenModule::HandleCXXStaticMemberVarInstantiation(VarDecl *VD) { + TemplateSpecializationKind TSK = VD->getTemplateSpecializationKind(); + // If we have a definition, this might be a deferred decl. If the + // instantiation is explicit, make sure we emit it at the end. + if (VD->getDefinition() && TSK == TSK_ExplicitInstantiationDefinition) + GetAddrOfGlobalVar(VD); } void CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD) { |