aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-02-06 05:15:45 +0000
committerDouglas Gregor <dgregor@apple.com>2010-02-06 05:15:45 +0000
commita9a55c063e9e59c6ab0a6d7a21302660f7bde9f9 (patch)
tree7e97e89ccfa8c8d855625403ae6cea06e29e73a3 /lib/CodeGen/CodeGenModule.cpp
parentaec2523ab2c91413ef2f66dc944d0d6ac6a58abe (diff)
Switch CodeGen's "is this variable declaration a definition?" logic
over to VarDecl::isThisDeclarationADefinition(), which handles variables declared with linkage specifications better (among other things). CMake 2.9 (from CVS) now builds with clang++ and is somewhat functional. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95486 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index fc5989fa9a..644c5d0bf8 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -627,20 +627,7 @@ void CodeGenModule::EmitGlobal(GlobalDecl GD) {
const VarDecl *VD = cast<VarDecl>(Global);
assert(VD->isFileVarDecl() && "Cannot emit local var decl as global.");
- if (getLangOptions().CPlusPlus && !VD->getInit()) {
- // In C++, if this is marked "extern", defer code generation.
- if (VD->getStorageClass() == VarDecl::Extern || VD->isExternC())
- return;
-
- // If this is a declaration of an explicit specialization of a static
- // data member in a class template, don't emit it.
- if (VD->isStaticDataMember() &&
- VD->getTemplateSpecializationKind() == TSK_ExplicitSpecialization)
- return;
- }
-
- // In C, if this isn't a definition, defer code generation.
- if (!getLangOptions().CPlusPlus && !VD->getInit())
+ if (VD->isThisDeclarationADefinition() != VarDecl::Definition)
return;
}