summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index e60edce213b..503cc2ace56 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -542,9 +542,7 @@ void CodeGenModule::EmitGlobal(const ValueDecl *Global) {
assert(VD->isFileVarDecl() && "Cannot emit local var decl as global.");
// Forward declarations are emitted lazily on first use.
- if ((VD->getStorageClass() == VarDecl::Extern ||
- VD->getStorageClass() == VarDecl::PrivateExtern) &&
- VD->getInit() == 0)
+ if (!VD->getInit() && VD->hasExternalStorage())
return;
}
OpenPOWER on IntegriCloud