]> granicus.if.org Git - clang/commitdiff
Emit a stop point for delegate constructor call. This gives user a chance to step...
authorDevang Patel <dpatel@apple.com>
Wed, 11 Aug 2010 21:04:37 +0000 (21:04 +0000)
committerDevang Patel <dpatel@apple.com>
Wed, 11 Aug 2010 21:04:37 +0000 (21:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110853 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGClass.cpp
test/CodeGenCXX/debug-info-ctor.cpp [new file with mode: 0644]

index 9ae9b3a80032339091dfc07d4ddfc137978a9021..453bae2940bee5b79e0f9f4244b12a2fb544ea62 100644 (file)
@@ -11,6 +11,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "CGDebugInfo.h"
 #include "CodeGenFunction.h"
 #include "clang/AST/CXXInheritance.h"
 #include "clang/AST/RecordLayout.h"
@@ -630,6 +631,8 @@ void CodeGenFunction::EmitConstructorBody(FunctionArgList &Args) {
   // 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;
   }
diff --git a/test/CodeGenCXX/debug-info-ctor.cpp b/test/CodeGenCXX/debug-info-ctor.cpp
new file mode 100644 (file)
index 0000000..07aa5da
--- /dev/null
@@ -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;
+}
+