summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-05-16 21:02:39 +0000
committerAnders Carlsson <andersca@mac.com>2009-05-16 21:02:39 +0000
commitd3a69ceaaf0df156a9da38d88af9f609ca6ada6e (patch)
treee1ea4193bb7b68cabeb8fe210d298f75f61303ae /clang/lib/CodeGen/CodeGenModule.cpp
parent524d5a4f5a15540fbcbd28d4b85fa1ec8481152d (diff)
downloadbcm5719-llvm-d3a69ceaaf0df156a9da38d88af9f609ca6ada6e.tar.gz
bcm5719-llvm-d3a69ceaaf0df156a9da38d88af9f609ca6ada6e.zip
extern "C" should preserve the 'extern' qualifier for VarDecls. Fixes 6853728.
llvm-svn: 71957
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index be5137210f1..a9d67b35641 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -538,8 +538,9 @@ void CodeGenModule::EmitGlobal(GlobalDecl GD) {
assert(VD->isFileVarDecl() && "Cannot emit local var decl as global.");
// In C++, if this is marked "extern", defer code generation.
- if (getLangOptions().CPlusPlus &&
- VD->getStorageClass() == VarDecl::Extern && !VD->getInit())
+ if (getLangOptions().CPlusPlus && !VD->getInit() &&
+ (VD->getStorageClass() == VarDecl::Extern ||
+ VD->isExternC(getContext())))
return;
// In C, if this isn't a definition, defer code generation.
OpenPOWER on IntegriCloud