aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-07-11 04:28:21 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-07-11 04:28:21 +0000
commit60e5bdc4704f46bad75b4a27fcb8820e1c0e6560 (patch)
treec0fc2bfdfa85c98852394ddd4b3ce1b186bb476c /clang/lib/CodeGen/CodeGenModule.cpp
parent2cac58f6045ef3d5e8407d10dc2ccb30bc470caf (diff)
downloadllvm-60e5bdc4704f46bad75b4a27fcb8820e1c0e6560.zip
llvm-60e5bdc4704f46bad75b4a27fcb8820e1c0e6560.tar.gz
llvm-60e5bdc4704f46bad75b4a27fcb8820e1c0e6560.tar.bz2
[CodeGen] Treat imported static local variables as declarations
Imported variables cannot really be definitions for the purposes of IR generation. llvm-svn: 275040
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 55b13b4..0161cfb 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -2851,6 +2851,10 @@ static void ReplaceUsesOfNonProtoTypeWithRealFunction(llvm::GlobalValue *Old,
}
void CodeGenModule::HandleCXXStaticMemberVarInstantiation(VarDecl *VD) {
+ auto DK = VD->isThisDeclarationADefinition();
+ if (DK == VarDecl::Definition && VD->hasAttr<DLLImportAttr>())
+ return;
+
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.