diff options
author | David Green <david.green@arm.com> | 2018-09-12 14:09:06 +0000 |
---|---|---|
committer | David Green <david.green@arm.com> | 2018-09-12 14:09:06 +0000 |
commit | be0c5b6d3c415ae2b778c7c641e3f451652718f7 (patch) | |
tree | c630557d436e909d11b8db527cad760319ee1d2c /clang/test/CodeGenCXX/vtable-align.cpp | |
parent | a34679658f881a6751651e0891b08af44b48fe69 (diff) | |
download | bcm5719-llvm-be0c5b6d3c415ae2b778c7c641e3f451652718f7.tar.gz bcm5719-llvm-be0c5b6d3c415ae2b778c7c641e3f451652718f7.zip |
[CodeGen] Align rtti and vtable data
Previously the alignment on the newly created rtti/typeinfo data was largely
not set, meaning that DataLayout::getPreferredAlignment was free to overalign
it to 16 bytes. This causes unnecessary code bloat.
Differential Revision: https://reviews.llvm.org/D51416
llvm-svn: 342053
Diffstat (limited to 'clang/test/CodeGenCXX/vtable-align.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/vtable-align.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/vtable-align.cpp b/clang/test/CodeGenCXX/vtable-align.cpp index 1b82cbc085c..bd0494fe5dd 100644 --- a/clang/test/CodeGenCXX/vtable-align.cpp +++ b/clang/test/CodeGenCXX/vtable-align.cpp @@ -10,5 +10,8 @@ struct A { void A::f() {} // CHECK-32: @_ZTV1A = unnamed_addr constant { [5 x i8*] } { [5 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @_ZTI1A to i8*), i8* bitcast (void (%struct.A*)* @_ZN1A1fEv to i8*), i8* bitcast (void (%struct.A*)* @_ZN1A1gEv to i8*), i8* bitcast (void (%struct.A*)* @_ZN1A1hEv to i8*)] }, align 4 - +// CHECK-32: @_ZTS1A = constant [3 x i8] c"1A\00", align 1 +// CHECK-32: @_ZTI1A = constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv117__class_type_infoE, i32 2) to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1A, i32 0, i32 0) }, align 4 // CHECK-64: @_ZTV1A = unnamed_addr constant { [5 x i8*] } { [5 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @_ZTI1A to i8*), i8* bitcast (void (%struct.A*)* @_ZN1A1fEv to i8*), i8* bitcast (void (%struct.A*)* @_ZN1A1gEv to i8*), i8* bitcast (void (%struct.A*)* @_ZN1A1hEv to i8*)] }, align 8 +// CHECK-64: @_ZTS1A = constant [3 x i8] c"1A\00", align 1 +// CHECK-64: @_ZTI1A = constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv117__class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1A, i32 0, i32 0) }, align 8 |