summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-10-08 17:02:40 +0000
committerDevang Patel <dpatel@apple.com>2010-10-08 17:02:40 +0000
commit5e8ee2bb89c947934b615a9a08b6daafec9833f5 (patch)
tree02cf2b82a3386c4fba0219b99f1185eb580c858e /clang/lib/CodeGen
parente2d30cd4b53af2ae9637fdd438f5ae8de528794a (diff)
downloadbcm5719-llvm-5e8ee2bb89c947934b615a9a08b6daafec9833f5.tar.gz
bcm5719-llvm-5e8ee2bb89c947934b615a9a08b6daafec9833f5.zip
Do not repeat debug info for file variable constants.
This is tested by file-statics.exp in gdb testsuite. llvm-svn: 116060
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGExprScalar.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp
index 62433a17814..8e01b7c2124 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/lib/CodeGen/CGExprScalar.cpp
@@ -165,7 +165,11 @@ public:
assert(!Result.HasSideEffects && "Constant declref with side-effect?!");
llvm::ConstantInt *CI
= llvm::ConstantInt::get(VMContext, Result.Val.getInt());
- CGF.EmitDeclRefExprDbgValue(E, CI);
+ if (VarDecl *VD = dyn_cast<VarDecl>((E->getDecl()))) {
+ if (!VD->isFileVarDecl()) {
+ CGF.EmitDeclRefExprDbgValue(E, CI);
+ }
+ }
return CI;
}
return EmitLoadOfLValue(E);
OpenPOWER on IntegriCloud