Emit complete constructors and destructors as aliases to base constructors
and destructors when the two entities are semantically identical, i.e. when
the class has no virtual base classes. We only do this for linkage types
for which aliases are supported, i.e. internal and external, i.e. not linkonce.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96451 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/default-arguments.cpp b/test/CodeGenCXX/default-arguments.cpp
index 282e5d0..de53a69 100644
--- a/test/CodeGenCXX/default-arguments.cpp
+++ b/test/CodeGenCXX/default-arguments.cpp
@@ -26,6 +26,8 @@
B(const A1& = A1(), const A2& = A2());
};
+// CHECK: @_ZN1CC1Ev = alias {{.*}} @_ZN1CC2Ev
+
// CHECK: define void @_Z2f1v()
void f1() {
@@ -42,13 +44,6 @@
C();
};
-// CHECK: define void @_ZN1CC1Ev(
-// CHECK: call void @_ZN2A1C1Ev(
-// CHECK: call void @_ZN2A2C1Ev(
-// CHECK: call void @_ZN1BC1ERK2A1RK2A2(
-// CHECK: call void @_ZN2A2D1Ev
-// CHECK: call void @_ZN2A1D1Ev
-
// CHECK: define void @_ZN1CC2Ev(
// CHECK: call void @_ZN2A1C1Ev(
// CHECK: call void @_ZN2A2C1Ev(
diff --git a/test/CodeGenCXX/mangle-subst-std.cpp b/test/CodeGenCXX/mangle-subst-std.cpp
index 913c8f1..aea8415 100644
--- a/test/CodeGenCXX/mangle-subst-std.cpp
+++ b/test/CodeGenCXX/mangle-subst-std.cpp
@@ -1,9 +1,10 @@
// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin9 | FileCheck %s
+// CHECK: @_ZNSt1AC1Ev = alias {{.*}} @_ZNSt1AC2Ev
+
namespace std {
struct A { A(); };
- // CHECK: define void @_ZNSt1AC1Ev
// CHECK: define void @_ZNSt1AC2Ev
A::A() { }
};
diff --git a/test/CodeGenCXX/mangle.cpp b/test/CodeGenCXX/mangle.cpp
index 0718378..320b681 100644
--- a/test/CodeGenCXX/mangle.cpp
+++ b/test/CodeGenCXX/mangle.cpp
@@ -11,6 +11,8 @@
//CHECK: @pr5966_i = external global
//CHECK: @_ZL8pr5966_i = internal global
+// CHECK: @_ZN2S7C1Ev = alias {{.*}} @_ZN2S7C2Ev
+
// CHECK: define zeroext i1 @_ZplRK1YRA100_P1X
bool operator+(const Y&, X* (&xs)[100]) { return false; }
@@ -219,7 +221,6 @@
};
// PR5139
-// CHECK: @_ZN2S7C1Ev
// CHECK: @_ZN2S7C2Ev
// CHECK: @"_ZN2S73$_0C1Ev"
S7::S7() {}
diff --git a/test/CodeGenCXX/member-templates.cpp b/test/CodeGenCXX/member-templates.cpp
index 355ba20..5ec3226 100644
--- a/test/CodeGenCXX/member-templates.cpp
+++ b/test/CodeGenCXX/member-templates.cpp
@@ -15,7 +15,7 @@
template<typename T> B::B(T) {}
-// CHECK: define void @_ZN1BC1IiEET_(%struct.B* %this, i32)
+// CHECK: @_ZN1BC1IiEET_ = alias {{.*}} @_ZN1BC2IiEET_
// CHECK: define void @_ZN1BC2IiEET_(%struct.B* %this, i32)
template B::B(int);
diff --git a/test/CodeGenCXX/virtual-bases.cpp b/test/CodeGenCXX/virtual-bases.cpp
index 200f21a..bd29b8d 100644
--- a/test/CodeGenCXX/virtual-bases.cpp
+++ b/test/CodeGenCXX/virtual-bases.cpp
@@ -4,7 +4,7 @@
A();
};
-// CHECK: define void @_ZN1AC1Ev(%struct.A* %this)
+// CHECK: @_ZN1AC1Ev = alias {{.*}} @_ZN1AC2Ev
// CHECK: define void @_ZN1AC2Ev(%struct.A* %this)
A::A() { }
@@ -12,14 +12,14 @@
B();
};
-// CHECK: define void @_ZN1BC1Ev(%struct.B* %this)
// CHECK: define void @_ZN1BC2Ev(%struct.B* %this, i8** %vtt)
+// CHECK: define void @_ZN1BC1Ev(%struct.B* %this)
B::B() { }
struct C : virtual A {
C(bool);
};
-// CHECK: define void @_ZN1CC1Eb(%struct.B* %this, i1 zeroext)
// CHECK: define void @_ZN1CC2Eb(%struct.B* %this, i8** %vtt, i1 zeroext)
+// CHECK: define void @_ZN1CC1Eb(%struct.B* %this, i1 zeroext)
C::C(bool) { }
diff --git a/test/CodeGenCXX/virtual-destructor-calls.cpp b/test/CodeGenCXX/virtual-destructor-calls.cpp
index 01ca144..650fd69 100644
--- a/test/CodeGenCXX/virtual-destructor-calls.cpp
+++ b/test/CodeGenCXX/virtual-destructor-calls.cpp
@@ -9,8 +9,7 @@
};
// Complete dtor.
-// CHECK: define void @_ZN1BD1Ev
-// CHECK: call void @_ZN1AD2Ev
+// CHECK: @_ZN1BD1Ev = alias {{.*}} @_ZN1BD2Ev
// Deleting dtor.
// CHECK: define void @_ZN1BD0Ev
diff --git a/test/CodeGenCXX/vtable-pointer-initialization.cpp b/test/CodeGenCXX/vtable-pointer-initialization.cpp
index 92e0117..ebe5315 100644
--- a/test/CodeGenCXX/vtable-pointer-initialization.cpp
+++ b/test/CodeGenCXX/vtable-pointer-initialization.cpp
@@ -19,14 +19,14 @@
Field field;
};
-// CHECK: define void @_ZN1AC1Ev(
+// CHECK: define void @_ZN1AC2Ev(
// CHECK: call void @_ZN4BaseC2Ev(
// CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1A, i64 0, i64 2)
// CHECK: call void @_ZN5FieldC1Ev(
// CHECK: ret void
A::A() { }
-// CHECK: define void @_ZN1AD1Ev(
+// CHECK: define void @_ZN1AD2Ev(
// CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1A, i64 0, i64 2)
// CHECK: call void @_ZN5FieldD1Ev(
// CHECK: call void @_ZN4BaseD2Ev(