forked from OSchip/llvm-project
Make sure C++ variable definitions are actually passed to the consumer when loaded from PCH.
llvm-svn: 110322
This commit is contained in:
parent
0cdda02f44
commit
4ba81b2ee4
|
@ -1350,7 +1350,8 @@ static bool isConsumerInterestedIn(Decl *D) {
|
||||||
if (isa<FileScopeAsmDecl>(D))
|
if (isa<FileScopeAsmDecl>(D))
|
||||||
return true;
|
return true;
|
||||||
if (VarDecl *Var = dyn_cast<VarDecl>(D))
|
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))
|
if (FunctionDecl *Func = dyn_cast<FunctionDecl>(D))
|
||||||
return Func->isThisDeclarationADefinition();
|
return Func->isThisDeclarationADefinition();
|
||||||
return isa<ObjCProtocolDecl>(D);
|
return isa<ObjCProtocolDecl>(D);
|
||||||
|
|
|
@ -7,3 +7,4 @@
|
||||||
|
|
||||||
// CHECK: @_ZL5globS = internal global %struct.S zeroinitializer
|
// CHECK: @_ZL5globS = internal global %struct.S zeroinitializer
|
||||||
// CHECK: @_ZL3bar = internal global i32 0, align 4
|
// CHECK: @_ZL3bar = internal global i32 0, align 4
|
||||||
|
// CHECK: @glob_var = global i32 0
|
||||||
|
|
|
@ -8,3 +8,5 @@ static S globS;
|
||||||
|
|
||||||
extern int ext_foo;
|
extern int ext_foo;
|
||||||
static int bar = ++ext_foo;
|
static int bar = ++ext_foo;
|
||||||
|
|
||||||
|
int glob_var;
|
||||||
|
|
Loading…
Reference in New Issue