aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGExprComplex.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2015-02-09 18:55:57 +0000
committerDavid Blaikie <dblaikie@gmail.com>2015-02-09 18:55:57 +0000
commit20937be183edb5f7af418dc6614b27423c071106 (patch)
tree69fc2cfc9bd1a58a7ce7879a7221d6a463d79307 /clang/lib/CodeGen/CGExprComplex.cpp
parent2221aba85b57297538510708e02ee217a2656baf (diff)
downloadllvm-20937be183edb5f7af418dc6614b27423c071106.zip
llvm-20937be183edb5f7af418dc6614b27423c071106.tar.gz
llvm-20937be183edb5f7af418dc6614b27423c071106.tar.bz2
DebugInfo: Suppress the location of instructions in complex default arguments.
llvm-svn: 228589
Diffstat (limited to 'clang/lib/CodeGen/CGExprComplex.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprComplex.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExprComplex.cpp b/clang/lib/CodeGen/CGExprComplex.cpp
index b6adbf6..b4c652c 100644
--- a/clang/lib/CodeGen/CGExprComplex.cpp
+++ b/clang/lib/CodeGen/CGExprComplex.cpp
@@ -1033,8 +1033,14 @@ ComplexPairTy CodeGenFunction::EmitComplexExpr(const Expr *E, bool IgnoreReal,
assert(E && getComplexType(E->getType()) &&
"Invalid complex expression to emit");
- return ComplexExprEmitter(*this, IgnoreReal, IgnoreImag)
- .Visit(const_cast<Expr*>(E));
+ bool hasDebugInfo = getDebugInfo();
+ if (isa<CXXDefaultArgExpr>(E))
+ disableDebugInfo();
+ auto R = ComplexExprEmitter(*this, IgnoreReal, IgnoreImag)
+ .Visit(const_cast<Expr *>(E));
+ if (isa<CXXDefaultArgExpr>(E) && hasDebugInfo)
+ enableDebugInfo();
+ return R;
}
void CodeGenFunction::EmitComplexExprIntoLValue(const Expr *E, LValue dest,