From d6c0a824b6fdaffd12cf64ee136973278ae20c08 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 9 Dec 2013 14:51:17 +0000 Subject: [PATCH] Output destructors and constructors in a more natural order. With this patch we output the in the order C2 C1 D2 D1 D0 Which means that a destructor or constructor that call another is output after the callee. This is a bit easier to read IHMO and a tiny bit more efficient as we don't put a decl in DeferredDeclsToEmit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196784 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/ItaniumCXXABI.cpp | 24 +++++++-------- .../CodeGenCXX/abstract-class-ctors-dtors.cpp | 2 +- test/CodeGenCXX/block-in-ctor-dtor.cpp | 4 +-- .../constructor-destructor-return-this.cpp | 29 ++++++++++--------- test/CodeGenCXX/constructors.cpp | 28 ++++++++---------- test/CodeGenCXX/cxx0x-defaulted-templates.cpp | 4 +-- test/CodeGenCXX/cxx0x-delegating-ctors.cpp | 22 +++++++------- test/CodeGenCXX/default-arguments.cpp | 6 ++-- test/CodeGenCXX/destructors.cpp | 24 +++++++-------- test/CodeGenCXX/eh.cpp | 7 +++-- test/CodeGenCXX/inheriting-constructor.cpp | 4 +-- test/CodeGenCXX/mangle-subst-std.cpp | 2 +- test/CodeGenCXX/mangle.cpp | 2 +- test/CodeGenCXX/member-templates.cpp | 2 +- test/CodeGenCXX/pr13396.cpp | 4 +-- test/CodeGenCXX/static-init.cpp | 12 ++++---- test/CodeGenCXX/virtual-bases.cpp | 4 +-- test/CodeGenCXX/virtual-destructor-calls.cpp | 10 +++---- 18 files changed, 95 insertions(+), 95 deletions(-) diff --git a/lib/CodeGen/ItaniumCXXABI.cpp b/lib/CodeGen/ItaniumCXXABI.cpp index 0e8f31a484..200a8fd2d3 100644 --- a/lib/CodeGen/ItaniumCXXABI.cpp +++ b/lib/CodeGen/ItaniumCXXABI.cpp @@ -815,16 +815,16 @@ void ItaniumCXXABI::EmitCXXConstructors(const CXXConstructorDecl *D) { // Just make sure we're in sync with TargetCXXABI. assert(CGM.getTarget().getCXXABI().hasConstructorVariants()); + // The constructor used for constructing this as a base class; + // ignores virtual bases. + CGM.EmitGlobal(GlobalDecl(D, Ctor_Base)); + // The constructor used for constructing this as a complete class; // constucts the virtual bases, then calls the base constructor. if (!D->getParent()->isAbstract()) { // We don't need to emit the complete ctor if the class is abstract. CGM.EmitGlobal(GlobalDecl(D, Ctor_Complete)); } - - // The constructor used for constructing this as a base class; - // ignores virtual bases. - CGM.EmitGlobal(GlobalDecl(D, Ctor_Base)); } /// The generic ABI passes 'this', plus a VTT if it's destroying a @@ -844,19 +844,19 @@ void ItaniumCXXABI::BuildDestructorSignature(const CXXDestructorDecl *Dtor, } void ItaniumCXXABI::EmitCXXDestructors(const CXXDestructorDecl *D) { - // The destructor in a virtual table is always a 'deleting' - // destructor, which calls the complete destructor and then uses the - // appropriate operator delete. - if (D->isVirtual()) - CGM.EmitGlobal(GlobalDecl(D, Dtor_Deleting)); + // The destructor used for destructing this as a base class; ignores + // virtual bases. + CGM.EmitGlobal(GlobalDecl(D, Dtor_Base)); // The destructor used for destructing this as a most-derived class; // call the base destructor and then destructs any virtual bases. CGM.EmitGlobal(GlobalDecl(D, Dtor_Complete)); - // The destructor used for destructing this as a base class; ignores - // virtual bases. - CGM.EmitGlobal(GlobalDecl(D, Dtor_Base)); + // The destructor in a virtual table is always a 'deleting' + // destructor, which calls the complete destructor and then uses the + // appropriate operator delete. + if (D->isVirtual()) + CGM.EmitGlobal(GlobalDecl(D, Dtor_Deleting)); } void ItaniumCXXABI::BuildInstanceFunctionParams(CodeGenFunction &CGF, diff --git a/test/CodeGenCXX/abstract-class-ctors-dtors.cpp b/test/CodeGenCXX/abstract-class-ctors-dtors.cpp index 793bbde050..a159a287cb 100644 --- a/test/CodeGenCXX/abstract-class-ctors-dtors.cpp +++ b/test/CodeGenCXX/abstract-class-ctors-dtors.cpp @@ -9,8 +9,8 @@ struct A { // CHECK-NOT-LABEL: define void @_ZN1AC1Ev // CHECK-LABEL: define void @_ZN1AC2Ev -// CHECK-LABEL: define void @_ZN1AD1Ev // CHECK-LABEL: define void @_ZN1AD2Ev +// CHECK-LABEL: define void @_ZN1AD1Ev A::A() { } A::~A() { } diff --git a/test/CodeGenCXX/block-in-ctor-dtor.cpp b/test/CodeGenCXX/block-in-ctor-dtor.cpp index bd37d4418d..0dc0ab0043 100644 --- a/test/CodeGenCXX/block-in-ctor-dtor.cpp +++ b/test/CodeGenCXX/block-in-ctor-dtor.cpp @@ -40,9 +40,9 @@ X::~X() { // CHECK-LABEL: define internal void @___ZN4ZoneC2Ev_block_invoke_ // CHECK-LABEL: define internal void @___ZN4ZoneD2Ev_block_invoke // CHECK-LABEL: define internal void @___ZN4ZoneD2Ev_block_invoke_ -// CHECK-LABEL: define internal void @___ZN1XC1Ev_block_invoke -// CHECK-LABEL: define internal void @___ZN1XC1Ev_block_invoke_ // CHECK-LABEL: define internal void @___ZN1XC2Ev_block_invoke // CHECK-LABEL: define internal void @___ZN1XC2Ev_block_invoke_ +// CHECK-LABEL: define internal void @___ZN1XC1Ev_block_invoke +// CHECK-LABEL: define internal void @___ZN1XC1Ev_block_invoke_ // CHECK-LABEL: define internal void @___ZN1XD2Ev_block_invoke // CHECK-LABEL: define internal void @___ZN1XD2Ev_block_invoke_ diff --git a/test/CodeGenCXX/constructor-destructor-return-this.cpp b/test/CodeGenCXX/constructor-destructor-return-this.cpp index ea2ea45a32..e395620746 100644 --- a/test/CodeGenCXX/constructor-destructor-return-this.cpp +++ b/test/CodeGenCXX/constructor-destructor-return-this.cpp @@ -27,15 +27,15 @@ private: B::B(int *i) : i_(i) { } B::~B() { } -// CHECKGEN-LABEL: define void @_ZN1BC1EPi(%class.B* %this, i32* %i) // CHECKGEN-LABEL: define void @_ZN1BC2EPi(%class.B* %this, i32* %i) -// CHECKGEN-LABEL: define void @_ZN1BD1Ev(%class.B* %this) +// CHECKGEN-LABEL: define void @_ZN1BC1EPi(%class.B* %this, i32* %i) // CHECKGEN-LABEL: define void @_ZN1BD2Ev(%class.B* %this) +// CHECKGEN-LABEL: define void @_ZN1BD1Ev(%class.B* %this) -// CHECKARM-LABEL: define %class.B* @_ZN1BC1EPi(%class.B* returned %this, i32* %i) // CHECKARM-LABEL: define %class.B* @_ZN1BC2EPi(%class.B* returned %this, i32* %i) -// CHECKARM-LABEL: define %class.B* @_ZN1BD1Ev(%class.B* returned %this) +// CHECKARM-LABEL: define %class.B* @_ZN1BC1EPi(%class.B* returned %this, i32* %i) // CHECKARM-LABEL: define %class.B* @_ZN1BD2Ev(%class.B* returned %this) +// CHECKARM-LABEL: define %class.B* @_ZN1BD1Ev(%class.B* returned %this) // CHECKMS-LABEL: define x86_thiscallcc %class.B* @"\01??0B@@QAE@PAH@Z"(%class.B* returned %this, i32* %i) // CHECKMS-LABEL: define x86_thiscallcc void @"\01??1B@@QAE@XZ"(%class.B* %this) @@ -51,17 +51,17 @@ private: C::C(int *i, char *c) : B(i), c_(c) { } C::~C() { } -// CHECKGEN-LABEL: define void @_ZN1CC1EPiPc(%class.C* %this, i32* %i, i8* %c) // CHECKGEN-LABEL: define void @_ZN1CC2EPiPc(%class.C* %this, i32* %i, i8* %c) -// CHECKGEN-LABEL: define void @_ZN1CD0Ev(%class.C* %this) -// CHECKGEN-LABEL: define void @_ZN1CD1Ev(%class.C* %this) +// CHECKGEN-LABEL: define void @_ZN1CC1EPiPc(%class.C* %this, i32* %i, i8* %c) // CHECKGEN-LABEL: define void @_ZN1CD2Ev(%class.C* %this) +// CHECKGEN-LABEL: define void @_ZN1CD1Ev(%class.C* %this) +// CHECKGEN-LABEL: define void @_ZN1CD0Ev(%class.C* %this) -// CHECKARM-LABEL: define %class.C* @_ZN1CC1EPiPc(%class.C* returned %this, i32* %i, i8* %c) // CHECKARM-LABEL: define %class.C* @_ZN1CC2EPiPc(%class.C* returned %this, i32* %i, i8* %c) -// CHECKARM-LABEL: define void @_ZN1CD0Ev(%class.C* %this) -// CHECKARM-LABEL: define %class.C* @_ZN1CD1Ev(%class.C* returned %this) +// CHECKARM-LABEL: define %class.C* @_ZN1CC1EPiPc(%class.C* returned %this, i32* %i, i8* %c) // CHECKARM-LABEL: define %class.C* @_ZN1CD2Ev(%class.C* returned %this) +// CHECKARM-LABEL: define %class.C* @_ZN1CD1Ev(%class.C* returned %this) +// CHECKARM-LABEL: define void @_ZN1CD0Ev(%class.C* %this) // CHECKMS-LABEL: define x86_thiscallcc %class.C* @"\01??0C@@QAE@PAHPAD@Z"(%class.C* returned %this, i32* %i, i8* %c) // CHECKMS-LABEL: define x86_thiscallcc void @"\01??1C@@UAE@XZ"(%class.C* %this) @@ -75,15 +75,16 @@ public: D::D() { } D::~D() { } -// CHECKGEN-LABEL: define void @_ZN1DC1Ev(%class.D* %this) // CHECKGEN-LABEL: define void @_ZN1DC2Ev(%class.D* %this, i8** %vtt) -// CHECKGEN-LABEL: define void @_ZN1DD1Ev(%class.D* %this) +// CHECKGEN-LABEL: define void @_ZN1DC1Ev(%class.D* %this) // CHECKGEN-LABEL: define void @_ZN1DD2Ev(%class.D* %this, i8** %vtt) +// CHECKGEN-LABEL: define void @_ZN1DD1Ev(%class.D* %this) -// CHECKARM-LABEL: define %class.D* @_ZN1DC1Ev(%class.D* returned %this) // CHECKARM-LABEL: define %class.D* @_ZN1DC2Ev(%class.D* returned %this, i8** %vtt) -// CHECKARM-LABEL: define %class.D* @_ZN1DD1Ev(%class.D* returned %this) +// CHECKARM-LABEL: define %class.D* @_ZN1DC1Ev(%class.D* returned %this) // CHECKARM-LABEL: define %class.D* @_ZN1DD2Ev(%class.D* returned %this, i8** %vtt) +// CHECKARM-LABEL: define %class.D* @_ZN1DD1Ev(%class.D* returned %this) + // CHECKMS-LABEL: define x86_thiscallcc %class.D* @"\01??0D@@QAE@XZ"(%class.D* returned %this, i32 %is_most_derived) // CHECKMS-LABEL: define x86_thiscallcc void @"\01??1D@@QAE@XZ"(%class.D* %this) diff --git a/test/CodeGenCXX/constructors.cpp b/test/CodeGenCXX/constructors.cpp index f730b9ef49..02c28c7e3e 100644 --- a/test/CodeGenCXX/constructors.cpp +++ b/test/CodeGenCXX/constructors.cpp @@ -21,20 +21,19 @@ struct A { A::A(struct Undeclared &ref) : mem(0) {} // Check that delegation works. -// CHECK-LABEL: define void @_ZN1AC1ER10Undeclared(%struct.A* %this, %struct.Undeclared* %ref) unnamed_addr -// CHECK: call void @_ZN1AC2ER10Undeclared( - // CHECK-LABEL: define void @_ZN1AC2ER10Undeclared(%struct.A* %this, %struct.Undeclared* %ref) unnamed_addr // CHECK: call void @_ZN6MemberC1Ei( -A::A(ValueClass v) : mem(v.y - v.x) {} +// CHECK-LABEL: define void @_ZN1AC1ER10Undeclared(%struct.A* %this, %struct.Undeclared* %ref) unnamed_addr +// CHECK: call void @_ZN1AC2ER10Undeclared( -// CHECK-LABEL: define void @_ZN1AC1E10ValueClass(%struct.A* %this, i64 %v.coerce) unnamed_addr -// CHECK: call void @_ZN1AC2E10ValueClass( +A::A(ValueClass v) : mem(v.y - v.x) {} // CHECK-LABEL: define void @_ZN1AC2E10ValueClass(%struct.A* %this, i64 %v.coerce) unnamed_addr // CHECK: call void @_ZN6MemberC1Ei( +// CHECK-LABEL: define void @_ZN1AC1E10ValueClass(%struct.A* %this, i64 %v.coerce) unnamed_addr +// CHECK: call void @_ZN1AC2E10ValueClass( /* Test that things work for inheritance. */ struct B : A { @@ -44,13 +43,12 @@ struct B : A { B::B(struct Undeclared &ref) : A(ref), mem(1) {} -// CHECK-LABEL: define void @_ZN1BC1ER10Undeclared(%struct.B* %this, %struct.Undeclared* %ref) unnamed_addr -// CHECK: call void @_ZN1BC2ER10Undeclared( - // CHECK-LABEL: define void @_ZN1BC2ER10Undeclared(%struct.B* %this, %struct.Undeclared* %ref) unnamed_addr // CHECK: call void @_ZN1AC2ER10Undeclared( // CHECK: call void @_ZN6MemberC1Ei( +// CHECK-LABEL: define void @_ZN1BC1ER10Undeclared(%struct.B* %this, %struct.Undeclared* %ref) unnamed_addr +// CHECK: call void @_ZN1BC2ER10Undeclared( /* Test that the delegation optimization is disabled for classes with @@ -64,15 +62,14 @@ struct C : virtual A { }; C::C(int x) : A(ValueClass(x, x+1)), mem(x * x) {} +// CHECK-LABEL: define void @_ZN1CC2Ei(%struct.C* %this, i8** %vtt, i32 %x) unnamed_addr +// CHECK: call void @_ZN6MemberC1Ei( + // CHECK-LABEL: define void @_ZN1CC1Ei(%struct.C* %this, i32 %x) unnamed_addr // CHECK: call void @_ZN10ValueClassC1Eii( // CHECK: call void @_ZN1AC2E10ValueClass( // CHECK: call void @_ZN6MemberC1Ei( -// CHECK-LABEL: define void @_ZN1CC2Ei(%struct.C* %this, i8** %vtt, i32 %x) unnamed_addr -// CHECK: call void @_ZN6MemberC1Ei( - - /* Test that the delegation optimization is disabled for varargs constructors. */ @@ -83,17 +80,16 @@ struct D : A { D::D(int x, ...) : A(ValueClass(x, x+1)), mem(x*x) {} -// CHECK-LABEL: define void @_ZN1DC1Eiz(%struct.D* %this, i32 %x, ...) unnamed_addr +// CHECK-LABEL: define void @_ZN1DC2Eiz(%struct.D* %this, i32 %x, ...) unnamed_addr // CHECK: call void @_ZN10ValueClassC1Eii( // CHECK: call void @_ZN1AC2E10ValueClass( // CHECK: call void @_ZN6MemberC1Ei( -// CHECK-LABEL: define void @_ZN1DC2Eiz(%struct.D* %this, i32 %x, ...) unnamed_addr +// CHECK-LABEL: define void @_ZN1DC1Eiz(%struct.D* %this, i32 %x, ...) unnamed_addr // CHECK: call void @_ZN10ValueClassC1Eii( // CHECK: call void @_ZN1AC2E10ValueClass( // CHECK: call void @_ZN6MemberC1Ei( - // PR6622: this shouldn't crash namespace test0 { struct A {}; diff --git a/test/CodeGenCXX/cxx0x-defaulted-templates.cpp b/test/CodeGenCXX/cxx0x-defaulted-templates.cpp index f4d5ccc0e3..92fbfff8ab 100644 --- a/test/CodeGenCXX/cxx0x-defaulted-templates.cpp +++ b/test/CodeGenCXX/cxx0x-defaulted-templates.cpp @@ -5,12 +5,12 @@ struct X { X(); }; -// CHECK: define {{.*}} @_ZN1XIbEC1Ev // CHECK: define {{.*}} @_ZN1XIbEC2Ev +// CHECK: define {{.*}} @_ZN1XIbEC1Ev template <> X::X() = default; -// CHECK: define weak_odr {{.*}} @_ZN1XIiEC1Ev // CHECK: define weak_odr {{.*}} @_ZN1XIiEC2Ev +// CHECK: define weak_odr {{.*}} @_ZN1XIiEC1Ev template X::X() = default; template X::X(); diff --git a/test/CodeGenCXX/cxx0x-delegating-ctors.cpp b/test/CodeGenCXX/cxx0x-delegating-ctors.cpp index c48e61fd14..dcc055696e 100644 --- a/test/CodeGenCXX/cxx0x-delegating-ctors.cpp +++ b/test/CodeGenCXX/cxx0x-delegating-ctors.cpp @@ -26,28 +26,30 @@ delegator::delegator() { delegator::delegator(bool) {} -// CHECK: define {{.*}} @_ZN9delegatorC1Ec -// CHECK: {{.*}} @_ZN9delegatorC1Eb -// CHECK: void @__cxa_throw -// CHECK: void @__clang_call_terminate -// CHECK: {{.*}} @_ZN9delegatorD1Ev -// CHECK: define {{.*}} @_ZN9delegatorC2Ec +// CHECK-LABEL: define {{.*}} @_ZN9delegatorC2Ec // CHECK: {{.*}} @_ZN9delegatorC2Eb // CHECK: void @__cxa_throw // CHECK: void @__clang_call_terminate // CHECK: {{.*}} @_ZN9delegatorD2Ev + +// CHECK-LABEL: define {{.*}} @_ZN9delegatorC1Ec +// CHECK: {{.*}} @_ZN9delegatorC1Eb +// CHECK: void @__cxa_throw +// CHECK: void @__clang_call_terminate +// CHECK: {{.*}} @_ZN9delegatorD1Ev delegator::delegator(char) : delegator(true) { throw 0; } -// CHECK: define {{.*}} @_ZN9delegatorC1Ei -// CHECK: {{.*}} @_ZN9delegatorC1Ev +// CHECK-LABEL: define {{.*}} @_ZN9delegatorC2Ei +// CHECK: {{.*}} @_ZN9delegatorC2Ev // CHECK-NOT: void @_ZSt9terminatev // CHECK: ret // CHECK-NOT: void @_ZSt9terminatev -// CHECK: define {{.*}} @_ZN9delegatorC2Ei -// CHECK: {{.*}} @_ZN9delegatorC2Ev + +// CHECK-LABEL: define {{.*}} @_ZN9delegatorC1Ei +// CHECK: {{.*}} @_ZN9delegatorC1Ev // CHECK-NOT: void @_ZSt9terminatev // CHECK: ret // CHECK-NOT: void @_ZSt9terminatev diff --git a/test/CodeGenCXX/default-arguments.cpp b/test/CodeGenCXX/default-arguments.cpp index 83cae3afd5..d364835850 100644 --- a/test/CodeGenCXX/default-arguments.cpp +++ b/test/CodeGenCXX/default-arguments.cpp @@ -42,15 +42,15 @@ struct C { C(); }; -// CHECK-LABEL: define void @_ZN1CC1Ev(%struct.C* %this) unnamed_addr -// CHECK: call void @_ZN1CC2Ev( - // CHECK-LABEL: define void @_ZN1CC2Ev(%struct.C* %this) unnamed_addr // CHECK: call void @_ZN2A1C1Ev( // CHECK: call void @_ZN2A2C1Ev( // CHECK: call void @_ZN1BC1ERK2A1RK2A2( // CHECK: call void @_ZN2A2D1Ev // CHECK: call void @_ZN2A1D1Ev + +// CHECK-LABEL: define void @_ZN1CC1Ev(%struct.C* %this) unnamed_addr +// CHECK: call void @_ZN1CC2Ev( C::C() { } // CHECK-LABEL: define void @_Z2f3v() diff --git a/test/CodeGenCXX/destructors.cpp b/test/CodeGenCXX/destructors.cpp index 799cca28b4..f0e5a124ee 100644 --- a/test/CodeGenCXX/destructors.cpp +++ b/test/CodeGenCXX/destructors.cpp @@ -102,19 +102,19 @@ namespace test0 { B::~B() try { } catch (int i) {} // It will suppress the delegation optimization here, though. -// CHECK-LABEL: define void @_ZN5test01BD1Ev(%"struct.test0::B"* %this) unnamed_addr +// CHECK-LABEL: define void @_ZN5test01BD2Ev(%"struct.test0::B"* %this, i8** %vtt) unnamed_addr // CHECK: invoke void @_ZN5test06MemberD1Ev // CHECK: unwind label [[MEM_UNWIND:%[a-zA-Z0-9.]+]] // CHECK: invoke void @_ZN5test04BaseD2Ev // CHECK: unwind label [[BASE_UNWIND:%[a-zA-Z0-9.]+]] -// CHECK: invoke void @_ZN5test05VBaseD2Ev -// CHECK: unwind label [[VBASE_UNWIND:%[a-zA-Z0-9.]+]] -// CHECK-LABEL: define void @_ZN5test01BD2Ev(%"struct.test0::B"* %this, i8** %vtt) unnamed_addr +// CHECK-LABEL: define void @_ZN5test01BD1Ev(%"struct.test0::B"* %this) unnamed_addr // CHECK: invoke void @_ZN5test06MemberD1Ev // CHECK: unwind label [[MEM_UNWIND:%[a-zA-Z0-9.]+]] // CHECK: invoke void @_ZN5test04BaseD2Ev // CHECK: unwind label [[BASE_UNWIND:%[a-zA-Z0-9.]+]] +// CHECK: invoke void @_ZN5test05VBaseD2Ev +// CHECK: unwind label [[VBASE_UNWIND:%[a-zA-Z0-9.]+]] } // Test base-class aliasing. @@ -272,14 +272,6 @@ namespace test6 { // FIXME: way too much EH cleanup code follows C::~C() { opaque(); } - // CHECK-LABEL: define void @_ZN5test61CD1Ev(%"struct.test6::C"* %this) unnamed_addr - // CHECK: invoke void @_ZN5test61CD2Ev - // CHECK: invoke void @_ZN5test61BILj3EED2Ev - // CHECK: call void @_ZN5test61BILj2EED2Ev - // CHECK: ret void - // CHECK: invoke void @_ZN5test61BILj3EED2Ev - // CHECK: invoke void @_ZN5test61BILj2EED2Ev - // CHECK-LABEL: define void @_ZN5test61CD2Ev(%"struct.test6::C"* %this, i8** %vtt) unnamed_addr // CHECK: invoke void @_ZN5test66opaqueEv // CHECK: invoke void @_ZN5test61AD1Ev @@ -293,6 +285,14 @@ namespace test6 { // CHECK: invoke void @_ZN5test61AD1Ev // CHECK: invoke void @_ZN5test61BILj1EED2Ev // CHECK: invoke void @_ZN5test61BILj0EED2Ev + + // CHECK-LABEL: define void @_ZN5test61CD1Ev(%"struct.test6::C"* %this) unnamed_addr + // CHECK: invoke void @_ZN5test61CD2Ev + // CHECK: invoke void @_ZN5test61BILj3EED2Ev + // CHECK: call void @_ZN5test61BILj2EED2Ev + // CHECK: ret void + // CHECK: invoke void @_ZN5test61BILj3EED2Ev + // CHECK: invoke void @_ZN5test61BILj2EED2Ev } // PR 9197 diff --git a/test/CodeGenCXX/eh.cpp b/test/CodeGenCXX/eh.cpp index 2a61e61bb8..c4ec9dd5de 100644 --- a/test/CodeGenCXX/eh.cpp +++ b/test/CodeGenCXX/eh.cpp @@ -184,9 +184,6 @@ namespace test9 { struct A { A(); }; - // CHECK-LABEL: define void @_ZN5test91AC1Ev(%"struct.test9::A"* %this) unnamed_addr - // CHECK: call void @_ZN5test91AC2Ev - // CHECK-NEXT: ret void // CHECK-LABEL: define void @_ZN5test91AC2Ev(%"struct.test9::A"* %this) unnamed_addr A::A() try { @@ -199,6 +196,10 @@ namespace test9 { // CHECK: call i8* @__cxa_begin_catch // CHECK: invoke void @_ZN5test96opaqueEv() // CHECK: invoke void @__cxa_rethrow() + + // CHECK-LABEL: define void @_ZN5test91AC1Ev(%"struct.test9::A"* %this) unnamed_addr + // CHECK: call void @_ZN5test91AC2Ev + // CHECK-NEXT: ret void opaque(); } } diff --git a/test/CodeGenCXX/inheriting-constructor.cpp b/test/CodeGenCXX/inheriting-constructor.cpp index c99a20c730..9394137e64 100644 --- a/test/CodeGenCXX/inheriting-constructor.cpp +++ b/test/CodeGenCXX/inheriting-constructor.cpp @@ -11,9 +11,9 @@ struct C { template C(T); }; struct D : C { using C::C; }; D d(123); -// CHECK-LABEL: define void @_ZN1BD0Ev -// CHECK-LABEL: define void @_ZN1BD1Ev // CHECK-LABEL: define void @_ZN1BD2Ev +// CHECK-LABEL: define void @_ZN1BD1Ev +// CHECK-LABEL: define void @_ZN1BD0Ev // CHECK-LABEL: define linkonce_odr void @_ZN1BC1Ei( // CHECK: call void @_ZN1BC2Ei( diff --git a/test/CodeGenCXX/mangle-subst-std.cpp b/test/CodeGenCXX/mangle-subst-std.cpp index 6277c7af21..678956e111 100644 --- a/test/CodeGenCXX/mangle-subst-std.cpp +++ b/test/CodeGenCXX/mangle-subst-std.cpp @@ -15,8 +15,8 @@ namespace std { struct A { A(); }; - // CHECK-LABEL: define void @_ZNSt1AC1Ev(%"struct.std::A"* %this) unnamed_addr // CHECK-LABEL: define void @_ZNSt1AC2Ev(%"struct.std::A"* %this) unnamed_addr + // CHECK-LABEL: define void @_ZNSt1AC1Ev(%"struct.std::A"* %this) unnamed_addr A::A() { } }; diff --git a/test/CodeGenCXX/mangle.cpp b/test/CodeGenCXX/mangle.cpp index d836f36c18..ffb66361fc 100644 --- a/test/CodeGenCXX/mangle.cpp +++ b/test/CodeGenCXX/mangle.cpp @@ -216,9 +216,9 @@ struct S7 { }; // PR5139 -// CHECK: @_ZN2S7C1Ev // CHECK: @_ZN2S7C2Ev // CHECK: @_ZN2S7Ut_C1Ev +// CHECK: @_ZN2S7C1Ev S7::S7() {} // PR5063 diff --git a/test/CodeGenCXX/member-templates.cpp b/test/CodeGenCXX/member-templates.cpp index c72dd6e5f5..93d36ff475 100644 --- a/test/CodeGenCXX/member-templates.cpp +++ b/test/CodeGenCXX/member-templates.cpp @@ -15,8 +15,8 @@ struct B { template B::B(T) {} -// CHECK-LABEL: define weak_odr void @_ZN1BC1IiEET_(%struct.B* %this, i32) unnamed_addr // CHECK-LABEL: define weak_odr void @_ZN1BC2IiEET_(%struct.B* %this, i32) unnamed_addr +// CHECK-LABEL: define weak_odr void @_ZN1BC1IiEET_(%struct.B* %this, i32) unnamed_addr template B::B(int); template diff --git a/test/CodeGenCXX/pr13396.cpp b/test/CodeGenCXX/pr13396.cpp index 3d582c5100..e41dd39fcc 100644 --- a/test/CodeGenCXX/pr13396.cpp +++ b/test/CodeGenCXX/pr13396.cpp @@ -7,13 +7,13 @@ struct foo { }; foo::foo() { - // CHECK-LABEL: define void @_ZN3fooC1Ev(%struct.foo* inreg %this) // CHECK-LABEL: define void @_ZN3fooC2Ev(%struct.foo* inreg %this) + // CHECK-LABEL: define void @_ZN3fooC1Ev(%struct.foo* inreg %this) } foo::~foo() { - // CHECK-LABEL: define void @_ZN3fooD1Ev(%struct.foo* inreg %this) // CHECK-LABEL: define void @_ZN3fooD2Ev(%struct.foo* inreg %this) + // CHECK-LABEL: define void @_ZN3fooD1Ev(%struct.foo* inreg %this) } void dummy() { diff --git a/test/CodeGenCXX/static-init.cpp b/test/CodeGenCXX/static-init.cpp index f522775c10..d23ead47f3 100644 --- a/test/CodeGenCXX/static-init.cpp +++ b/test/CodeGenCXX/static-init.cpp @@ -103,14 +103,14 @@ namespace test2 { B::B() { static int x = foo(); } - // CHECK-LABEL: define void @_ZN5test21BC1Ev + // CHECK-LABEL: define void @_ZN5test21BC2Ev // CHECK: load atomic i8* bitcast (i64* @_ZGVZN5test21BC1EvE1x to i8*) acquire, // CHECK: call i32 @__cxa_guard_acquire(i64* @_ZGVZN5test21BC1EvE1x) // CHECK: [[T0:%.*]] = call i32 @_ZN5test23fooEv() // CHECK: store i32 [[T0]], i32* @_ZZN5test21BC1EvE1x, // CHECK: call void @__cxa_guard_release(i64* @_ZGVZN5test21BC1EvE1x) - // CHECK-LABEL: define void @_ZN5test21BC2Ev + // CHECK-LABEL: define void @_ZN5test21BC1Ev // CHECK: load atomic i8* bitcast (i64* @_ZGVZN5test21BC1EvE1x to i8*) acquire, // CHECK: call i32 @__cxa_guard_acquire(i64* @_ZGVZN5test21BC1EvE1x) // CHECK: [[T0:%.*]] = call i32 @_ZN5test23fooEv() @@ -122,15 +122,15 @@ namespace test2 { B::~B() { static int y = foo(); } - // CHECK-LABEL: define void @_ZN5test21BD1Ev( - // CHECK: call void @_ZN5test21BD2Ev( - // CHECK-LABEL: define void @_ZN5test21BD2Ev( // CHECK: load atomic i8* bitcast (i64* @_ZGVZN5test21BD1EvE1y to i8*) acquire, // CHECK: call i32 @__cxa_guard_acquire(i64* @_ZGVZN5test21BD1EvE1y) // CHECK: [[T0:%.*]] = call i32 @_ZN5test23fooEv() // CHECK: store i32 [[T0]], i32* @_ZZN5test21BD1EvE1y, // CHECK: call void @__cxa_guard_release(i64* @_ZGVZN5test21BD1EvE1y) + + // CHECK-LABEL: define void @_ZN5test21BD1Ev( + // CHECK: call void @_ZN5test21BD2Ev( } // This shouldn't error out. @@ -149,6 +149,6 @@ namespace test3 { union U { char x; int i; }; static U u = { 'a' }; } - // CHECK-LABEL: define void @_ZN5test31BC1Ev( // CHECK-LABEL: define void @_ZN5test31BC2Ev( + // CHECK-LABEL: define void @_ZN5test31BC1Ev( } diff --git a/test/CodeGenCXX/virtual-bases.cpp b/test/CodeGenCXX/virtual-bases.cpp index 2878e95b52..e9c568c31b 100644 --- a/test/CodeGenCXX/virtual-bases.cpp +++ b/test/CodeGenCXX/virtual-bases.cpp @@ -12,16 +12,16 @@ struct B : virtual A { B(); }; -// CHECK-LABEL: define void @_ZN1BC1Ev(%struct.B* %this) unnamed_addr // CHECK-LABEL: define void @_ZN1BC2Ev(%struct.B* %this, i8** %vtt) unnamed_addr +// CHECK-LABEL: define void @_ZN1BC1Ev(%struct.B* %this) unnamed_addr B::B() { } struct C : virtual A { C(bool); }; -// CHECK-LABEL: define void @_ZN1CC1Eb(%struct.C* %this, i1 zeroext) unnamed_addr // CHECK-LABEL: define void @_ZN1CC2Eb(%struct.C* %this, i8** %vtt, i1 zeroext) unnamed_addr +// CHECK-LABEL: define void @_ZN1CC1Eb(%struct.C* %this, i1 zeroext) unnamed_addr C::C(bool) { } // PR6251 diff --git a/test/CodeGenCXX/virtual-destructor-calls.cpp b/test/CodeGenCXX/virtual-destructor-calls.cpp index ae3704f369..3e7fa8293a 100644 --- a/test/CodeGenCXX/virtual-destructor-calls.cpp +++ b/test/CodeGenCXX/virtual-destructor-calls.cpp @@ -20,16 +20,16 @@ struct B : A { // CHECK: @_ZN1CD1Ev = alias {{.*}} @_ZN1CD2Ev // CHECK: @_ZN1CD2Ev = alias bitcast {{.*}} @_ZN1BD2Ev -// Deleting dtor: defers to the complete dtor. -// CHECK-LABEL: define void @_ZN1BD0Ev(%struct.B* %this) unnamed_addr -// CHECK: call void @_ZN1BD1Ev -// CHECK: call void @_ZdlPv - // Base dtor: actually calls A's base dtor. // CHECK-LABEL: define void @_ZN1BD2Ev(%struct.B* %this) unnamed_addr // CHECK: call void @_ZN6MemberD1Ev // CHECK: call void @_ZN1AD2Ev +// Deleting dtor: defers to the complete dtor. +// CHECK-LABEL: define void @_ZN1BD0Ev(%struct.B* %this) unnamed_addr +// CHECK: call void @_ZN1BD1Ev +// CHECK: call void @_ZdlPv + B::~B() { } struct C : B { -- 2.40.0