diff options
author | Yunzhong Gao <Yunzhong_Gao@playstation.sony.com> | 2013-08-30 08:53:09 +0000 |
---|---|---|
committer | Yunzhong Gao <Yunzhong_Gao@playstation.sony.com> | 2013-08-30 08:53:09 +0000 |
commit | 0ebf1bb150b36128098a9f269d708361c4feebfa (patch) | |
tree | 66e16fdc2b917abcb5861f90294e0b2eb9c349ab /clang/lib/CodeGen/CGExpr.cpp | |
parent | 58934986f220dec8b75a76c2de03db029b65f336 (diff) | |
download | bcm5719-llvm-0ebf1bb150b36128098a9f269d708361c4feebfa.tar.gz bcm5719-llvm-0ebf1bb150b36128098a9f269d708361c4feebfa.zip |
Revert r189649 because it was breaking sanitizer bots.
llvm-svn: 189660
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index 31da6df1efa..12aa0a2b7c4 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -967,9 +967,15 @@ CodeGenFunction::tryEmitAsConstant(DeclRefExpr *refExpr) { // Emit as a constant. llvm::Constant *C = CGM.EmitConstantValue(result.Val, resultType, this); - // Make sure we emit a debug reference to the global variable or - // enumerator constant. - EmitValueDeclDbgValue(value, C); + // Make sure we emit a debug reference to the global variable. + // This should probably fire even for + if (isa<VarDecl>(value)) { + if (!getContext().DeclMustBeEmitted(cast<VarDecl>(value))) + EmitDeclRefExprDbgValue(refExpr, C); + } else { + assert(isa<EnumConstantDecl>(value)); + EmitDeclRefExprDbgValue(refExpr, C); + } // If we emitted a reference constant, we need to dereference that. if (resultIsReference) |