[cfe-commits] r110853 - in /cfe/trunk: lib/CodeGen/CGClass.cpp test/CodeGenCXX/debug-info-ctor.cpp

Devang Patel dpatel at apple.com
Wed Aug 11 14:04:37 PDT 2010


Author: dpatel
Date: Wed Aug 11 16:04:37 2010
New Revision: 110853

URL: http://llvm.org/viewvc/llvm-project?rev=110853&view=rev
Log:
Emit a stop point for delegate constructor call. This gives user a chance to step into constructor body.

Added:
    cfe/trunk/test/CodeGenCXX/debug-info-ctor.cpp
Modified:
    cfe/trunk/lib/CodeGen/CGClass.cpp

Modified: cfe/trunk/lib/CodeGen/CGClass.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGClass.cpp?rev=110853&r1=110852&r2=110853&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGClass.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGClass.cpp Wed Aug 11 16:04:37 2010
@@ -11,6 +11,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "CGDebugInfo.h"
 #include "CodeGenFunction.h"
 #include "clang/AST/CXXInheritance.h"
 #include "clang/AST/RecordLayout.h"
@@ -630,6 +631,8 @@
   // Before we go any further, try the complete->base constructor
   // delegation optimization.
   if (CtorType == Ctor_Complete && IsConstructorDelegationValid(Ctor)) {
+    if (CGDebugInfo *DI = getDebugInfo()) 
+      DI->EmitStopPoint(Builder);
     EmitDelegateCXXConstructorCall(Ctor, Ctor_Base, Args);
     return;
   }

Added: cfe/trunk/test/CodeGenCXX/debug-info-ctor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-ctor.cpp?rev=110853&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-ctor.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/debug-info-ctor.cpp Wed Aug 11 16:04:37 2010
@@ -0,0 +1,13 @@
+// RUN: %clang -emit-llvm -g -S %s -o - | FileCheck %s
+
+struct X {
+  X(int v);
+
+  int value;
+};
+
+X::X(int v) {
+  // CHECK: call void @_ZN1XC2Ei(%struct.X* %this1, i32 %tmp), !dbg
+  value = v;
+}
+





More information about the cfe-commits mailing list