diff options
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 7cd9e9f81b..6aff0e7476 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -549,7 +549,7 @@ bool CodeGenModule::MayDeferGeneration(const ValueDecl *Global) { // cannot be. if (VD->isInAnonymousNamespace()) return true; - if (VD->getStorageClass() == VarDecl::Static) { + if (VD->getLinkage() == VarDecl::InternalLinkage) { // Initializer has side effects? if (VD->getInit() && VD->getInit()->HasSideEffects(Context)) return false; @@ -982,9 +982,8 @@ GetLinkageForVariable(ASTContext &Context, const VarDecl *VD) { return CodeGenModule::GVA_TemplateInstantiation; } } - - // Static variables get internal linkage. - if (VD->getStorageClass() == VarDecl::Static) + + if (VD->getLinkage() == VarDecl::InternalLinkage) return CodeGenModule::GVA_Internal; return CodeGenModule::GVA_StrongExternal; |