r223835 - DebugInfo: Correct location for compound complex assignment

David Blaikie dblaikie at gmail.com
Tue Dec 9 13:32:00 PST 2014


Author: dblaikie
Date: Tue Dec  9 15:32:00 2014
New Revision: 223835

URL: http://llvm.org/viewvc/llvm-project?rev=223835&view=rev
Log:
DebugInfo: Correct location for compound complex assignment

Modified:
    cfe/trunk/lib/CodeGen/CGExprComplex.cpp
    cfe/trunk/test/CodeGenCXX/debug-info-line.cpp

Modified: cfe/trunk/lib/CodeGen/CGExprComplex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprComplex.cpp?rev=223835&r1=223834&r2=223835&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprComplex.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprComplex.cpp Tue Dec  9 15:32:00 2014
@@ -869,8 +869,7 @@ EmitCompoundAssignLValue(const CompoundA
   // Truncate the result and store it into the LHS lvalue.
   if (LHSTy->isAnyComplexType()) {
     ComplexPairTy ResVal = EmitComplexToComplexCast(Result, OpInfo.Ty, LHSTy);
-    // FIXME
-    EmitStoreOfComplex(ResVal, LHS, /*isInit*/ false, SourceLocation());
+    EmitStoreOfComplex(ResVal, LHS, /*isInit*/ false, E->getLocStart());
     Val = RValue::getComplex(ResVal);
   } else {
     llvm::Value *ResVal =

Modified: cfe/trunk/test/CodeGenCXX/debug-info-line.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-line.cpp?rev=223835&r1=223834&r2=223835&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-line.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-line.cpp Tue Dec  9 15:32:00 2014
@@ -33,15 +33,26 @@ foo::foo()
       (complex_src()) {
 }
 
+// skip C1
+// CHECK-LABEL: define
+
 // CHECK-LABEL: define
 void f2() {
 #line 300
-  * // CHECK: store float {{.*}} !dbg [[DBG_F2_COMPLEX:!.*]]
+  * // CHECK: store float {{.*}} !dbg [[DBG_F2:!.*]]
       complex_sink() = complex_src();
 }
 
+// CHECK-LABEL: define
+void f3() {
+#line 400
+  * // CHECK: store float {{.*}} !dbg [[DBG_F3:!.*]]
+      complex_sink() += complex_src();
+}
+
 // CHECK: [[DBG_F1]] = metadata !{i32 100,
 // CHECK: [[DBG_FOO_VALUE]] = metadata !{i32 200,
 // CHECK: [[DBG_FOO_REF]] = metadata !{i32 202,
 // CHECK: [[DBG_FOO_COMPLEX]] = metadata !{i32 204,
-// CHECK: [[DBG_F2_COMPLEX]] = metadata !{i32 300,
+// CHECK: [[DBG_F2]] = metadata !{i32 300,
+// CHECK: [[DBG_F3]] = metadata !{i32 400,





More information about the cfe-commits mailing list