mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-04 07:16:05 +00:00

r173593 made us a little too eager to associate all code at the end of a function with the user-written 'return' line. This caused problems with breakpoints as they'd be set in exception handling code preceeding the actual non-exception return handling code, leading to the breakpoint never being hit in non-exceptional execution. This change restores the pre-r173593 exception handling line information where the cleanup code is associated with the '}' not the return line. llvm-svn: 174206
44 lines
870 B
C++
44 lines
870 B
C++
// RUN: %clang -emit-llvm -g -S %s -o - | FileCheck %s
|
|
struct foo;
|
|
void func(foo *f) {
|
|
}
|
|
class bar;
|
|
void func(bar *f) {
|
|
}
|
|
union baz;
|
|
void func(baz *f) {
|
|
}
|
|
class B {
|
|
public:
|
|
virtual ~B();
|
|
};
|
|
struct A {
|
|
int one;
|
|
static const int HdrSize = 52;
|
|
int two;
|
|
A() {
|
|
int x = 1;
|
|
}
|
|
};
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
B b;
|
|
if (argc) {
|
|
A a;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// CHECK: unwind label %terminate.lpad, !dbg ![[EXCEPTLOC:.*]]
|
|
// CHECK: store i32 0, i32* %retval, !dbg ![[RETLOC:.*]]
|
|
// CHECK: DW_TAG_structure_type ] [foo]
|
|
// CHECK: DW_TAG_class_type ] [bar]
|
|
// CHECK: DW_TAG_union_type ] [baz]
|
|
// CHECK: DW_TAG_structure_type ] [A]
|
|
// CHECK: HdrSize
|
|
// CHECK: DW_TAG_class_type ] [B]
|
|
// CHECK: metadata !"_vptr$B", {{.*}}, i32 64, metadata !{{.*}}} ; [ DW_TAG_member ]
|
|
// CHECK: ![[EXCEPTLOC]] = metadata !{i32 31,
|
|
// CHECK: ![[RETLOC]] = metadata !{i32 30,
|