diff options
author | Devang Patel <dpatel@apple.com> | 2010-10-08 17:02:40 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-10-08 17:02:40 +0000 |
commit | 67c32268c0891b539fe9da26d10579e2ebfc9b38 (patch) | |
tree | 0a2126b96fa353e1d4f28e97200ef236d64b2339 /lib/CodeGen/CGExprScalar.cpp | |
parent | aa3e6babe646329310388e5b7e0c9045e0018715 (diff) |
Do not repeat debug info for file variable constants.
This is tested by file-statics.exp in gdb testsuite.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116060 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprScalar.cpp')
-rw-r--r-- | lib/CodeGen/CGExprScalar.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 62433a1781..8e01b7c212 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/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); |