Skip to content

Commit 5e8ee2b

Browse files
author
Devang Patel
committed
Do not repeat debug info for file variable constants.
This is tested by file-statics.exp in gdb testsuite. llvm-svn: 116060
1 parent e2d30cd commit 5e8ee2b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

clang/lib/CodeGen/CGExprScalar.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,11 @@ class ScalarExprEmitter
165165
assert(!Result.HasSideEffects && "Constant declref with side-effect?!");
166166
llvm::ConstantInt *CI
167167
= llvm::ConstantInt::get(VMContext, Result.Val.getInt());
168-
CGF.EmitDeclRefExprDbgValue(E, CI);
168+
if (VarDecl *VD = dyn_cast<VarDecl>((E->getDecl()))) {
169+
if (!VD->isFileVarDecl()) {
170+
CGF.EmitDeclRefExprDbgValue(E, CI);
171+
}
172+
}
169173
return CI;
170174
}
171175
return EmitLoadOfLValue(E);

0 commit comments

Comments
 (0)