aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHReaderDecl.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-08-05 09:47:59 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-08-05 09:47:59 +0000
commit3f95477f28ef3baaf79001a5654785c8b2075710 (patch)
tree10dc100b255e53710d18f1a1e01f29f5856924ab /lib/Frontend/PCHReaderDecl.cpp
parent156361d434cdcb4cc88169dee5b3d5ca25c7f012 (diff)
Make sure C++ variable definitions are actually passed to the consumer when loaded from PCH.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110322 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReaderDecl.cpp')
-rw-r--r--lib/Frontend/PCHReaderDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Frontend/PCHReaderDecl.cpp b/lib/Frontend/PCHReaderDecl.cpp
index 7557950e66..a6a68d9425 100644
--- a/lib/Frontend/PCHReaderDecl.cpp
+++ b/lib/Frontend/PCHReaderDecl.cpp
@@ -1350,7 +1350,8 @@ static bool isConsumerInterestedIn(Decl *D) {
if (isa<FileScopeAsmDecl>(D))
return true;
if (VarDecl *Var = dyn_cast<VarDecl>(D))
- return Var->isFileVarDecl() && Var->getInit();
+ return Var->isFileVarDecl() &&
+ Var->isThisDeclarationADefinition() == VarDecl::Definition;
if (FunctionDecl *Func = dyn_cast<FunctionDecl>(D))
return Func->isThisDeclarationADefinition();
return isa<ObjCProtocolDecl>(D);