summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprComplex.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2015-01-09 23:00:28 +0000
committerDavid Blaikie <dblaikie@gmail.com>2015-01-09 23:00:28 +0000
commitf353d3ecd0329884110a8bd39f28b5cc111c9a69 (patch)
tree070b18a0745ca81118c1a5e32351cdcadcceb79e /clang/lib/CodeGen/CGExprComplex.cpp
parenta10379ad49b9a102d9f6ab1bdafba67dc42f430b (diff)
downloadbcm5719-llvm-f353d3ecd0329884110a8bd39f28b5cc111c9a69.tar.gz
bcm5719-llvm-f353d3ecd0329884110a8bd39f28b5cc111c9a69.zip
Revert "DebugInfo: Generalize debug info location handling" and related commits
This reverts commit r225000, r225021, r225083, r225086, r225090. The root change (r225000) still has several issues where it's caused calls to be emitted without debug locations. This causes assertion failures if/when those calls are inlined. I'll work up some test cases and fixes before recommitting this. llvm-svn: 225555
Diffstat (limited to 'clang/lib/CodeGen/CGExprComplex.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprComplex.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGExprComplex.cpp b/clang/lib/CodeGen/CGExprComplex.cpp
index 1580bbe6a29..2732d40093e 100644
--- a/clang/lib/CodeGen/CGExprComplex.cpp
+++ b/clang/lib/CodeGen/CGExprComplex.cpp
@@ -81,7 +81,8 @@ public:
/// EmitStoreOfComplex - Store the specified real/imag parts into the
/// specified value pointer.
- void EmitStoreOfComplex(ComplexPairTy Val, LValue LV, bool isInit);
+ void EmitStoreOfComplex(ComplexPairTy Val, LValue LV, bool isInit,
+ SourceLocation DbgLoc);
/// EmitComplexToComplexCast - Emit a cast from complex value Val to DestType.
ComplexPairTy EmitComplexToComplexCast(ComplexPairTy Val, QualType SrcType,
@@ -334,7 +335,11 @@ ComplexPairTy ComplexExprEmitter::EmitLoadOfLValue(LValue lvalue,
/// EmitStoreOfComplex - Store the specified real/imag parts into the
/// specified value pointer.
void ComplexExprEmitter::EmitStoreOfComplex(ComplexPairTy Val, LValue lvalue,
- bool isInit) {
+ bool isInit,
+ SourceLocation DbgLoc) {
+ if (auto *DI = CGF.getDebugInfo())
+ DI->EmitLocation(CGF.Builder, DbgLoc);
+
if (lvalue.getType()->isAtomicType())
return CGF.EmitAtomicStore(RValue::getComplex(Val), lvalue, isInit);
@@ -864,7 +869,7 @@ EmitCompoundAssignLValue(const CompoundAssignOperator *E,
// Truncate the result and store it into the LHS lvalue.
if (LHSTy->isAnyComplexType()) {
ComplexPairTy ResVal = EmitComplexToComplexCast(Result, OpInfo.Ty, LHSTy);
- EmitStoreOfComplex(ResVal, LHS, /*isInit*/ false);
+ EmitStoreOfComplex(ResVal, LHS, /*isInit*/ false, E->getLocStart());
Val = RValue::getComplex(ResVal);
} else {
llvm::Value *ResVal =
@@ -909,7 +914,7 @@ LValue ComplexExprEmitter::EmitBinAssignLValue(const BinaryOperator *E,
LValue LHS = CGF.EmitLValue(E->getLHS());
// Store the result value into the LHS lvalue.
- EmitStoreOfComplex(Val, LHS, /*isInit*/ false);
+ EmitStoreOfComplex(Val, LHS, /*isInit*/ false, E->getLocStart());
return LHS;
}
@@ -1037,18 +1042,19 @@ ComplexPairTy CodeGenFunction::EmitComplexExpr(const Expr *E, bool IgnoreReal,
}
void CodeGenFunction::EmitComplexExprIntoLValue(const Expr *E, LValue dest,
- bool isInit) {
+ bool isInit,
+ SourceLocation DbgLoc) {
assert(E && getComplexType(E->getType()) &&
"Invalid complex expression to emit");
ComplexExprEmitter Emitter(*this);
ComplexPairTy Val = Emitter.Visit(const_cast<Expr*>(E));
- Emitter.EmitStoreOfComplex(Val, dest, isInit);
+ Emitter.EmitStoreOfComplex(Val, dest, isInit, DbgLoc);
}
/// EmitStoreOfComplex - Store a complex number into the specified l-value.
void CodeGenFunction::EmitStoreOfComplex(ComplexPairTy V, LValue dest,
- bool isInit) {
- ComplexExprEmitter(*this).EmitStoreOfComplex(V, dest, isInit);
+ bool isInit, SourceLocation DbgLoc) {
+ ComplexExprEmitter(*this).EmitStoreOfComplex(V, dest, isInit, DbgLoc);
}
/// EmitLoadOfComplex - Load a complex number from the specified address.
OpenPOWER on IntegriCloud