aboutsummaryrefslogtreecommitdiff
path: root/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
commit2928c2107f2e0007f35fe1c224aab63535f1403d (patch)
treecfc71c10fcdf57021774e79f7e2f16169bd69746 /lib/CodeGen/CodeGenModule.cpp
parent4ef2770ee522048a19311d13ccd3b9605297ec58 (diff)
extern "C" should preserve the 'extern' qualifier for VarDecls. Fixes 6853728.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71957 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index be5137210f..a9d67b3564 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/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.