From a740b903f87b8dd60860caea7973f5f4fdd91638 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 9 Jan 2015 23:00:28 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225555 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprComplex.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'lib/CodeGen/CGExprComplex.cpp') diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp index 1580bbe6a2..2732d40093 100644 --- a/lib/CodeGen/CGExprComplex.cpp +++ b/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(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. -- cgit v1.2.1