summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGClass.cpp2
-rw-r--r--clang/lib/CodeGen/CGExprComplex.cpp22
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h6
3 files changed, 19 insertions, 11 deletions
diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp
index dfd980f6e86..5ffab603ac8 100644
--- a/clang/lib/CodeGen/CGClass.cpp
+++ b/clang/lib/CodeGen/CGClass.cpp
@@ -616,7 +616,7 @@ void CodeGenFunction::EmitInitializerForField(FieldDecl *Field, LValue LHS,
}
break;
case TEK_Complex:
- EmitComplexExprIntoLValue(Init, LHS, /*isInit*/ true);
+ EmitComplexExprIntoLValue(Init, LHS, /*isInit*/ true, DbgLoc);
break;
case TEK_Aggregate: {
llvm::Value *ArrayIndexVar = nullptr;
diff --git a/clang/lib/CodeGen/CGExprComplex.cpp b/clang/lib/CodeGen/CGExprComplex.cpp
index 6b7826eef5d..f3493bfbbe3 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 = SourceLocation());
/// EmitComplexToComplexCast - Emit a cast from complex value Val to DestType.
ComplexPairTy EmitComplexToComplexCast(ComplexPairTy Val, QualType SrcType,
@@ -333,9 +334,12 @@ 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) {
+void ComplexExprEmitter::EmitStoreOfComplex(ComplexPairTy Val, LValue lvalue,
+ 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);
@@ -910,6 +914,7 @@ LValue ComplexExprEmitter::EmitBinAssignLValue(const BinaryOperator *E,
LValue LHS = CGF.EmitLValue(E->getLHS());
// Store the result value into the LHS lvalue.
+ // FIXME
EmitStoreOfComplex(Val, LHS, /*isInit*/ false);
return LHS;
@@ -1038,18 +1043,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.
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 98527b2b150..a80a199512e 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -2524,10 +2524,12 @@ public:
/// EmitComplexExprIntoLValue - Emit the given expression of complex
/// type and place its result into the specified l-value.
- void EmitComplexExprIntoLValue(const Expr *E, LValue dest, bool isInit);
+ void EmitComplexExprIntoLValue(const Expr *E, LValue dest, bool isInit,
+ SourceLocation DbgLoc = SourceLocation());
/// EmitStoreOfComplex - Store a complex number into the specified l-value.
- void EmitStoreOfComplex(ComplexPairTy V, LValue dest, bool isInit);
+ void EmitStoreOfComplex(ComplexPairTy V, LValue dest, bool isInit,
+ SourceLocation DbgLoc = SourceLocation());
/// EmitLoadOfComplex - Load a complex number from the specified l-value.
ComplexPairTy EmitLoadOfComplex(LValue src, SourceLocation loc);
OpenPOWER on IntegriCloud