diff options
author | Devang Patel <dpatel@apple.com> | 2010-08-11 21:04:37 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-08-11 21:04:37 +0000 |
commit | d67ef0eed463b43980f04a444155f423114be34b (patch) | |
tree | 88935a6878cd8498ab45910d920a89c8bd73ed74 | |
parent | a5f2de2e49e25ece82dd9fd63d8f390a7cda6417 (diff) |
Emit a stop point for delegate constructor call. This gives user a chance to step into constructor body.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110853 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/CGClass.cpp | 3 | ||||
-rw-r--r-- | test/CodeGenCXX/debug-info-ctor.cpp | 13 |
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp index 9ae9b3a800..453bae2940 100644 --- a/lib/CodeGen/CGClass.cpp +++ b/lib/CodeGen/CGClass.cpp @@ -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 index 0000000000..07aa5dad60 --- /dev/null +++ b/test/CodeGenCXX/debug-info-ctor.cpp @@ -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; +} + |