summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprScalar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CGExprScalar.cpp')
-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