diff options
author | Piotr Padlewski <prazek@google.com> | 2015-08-27 21:35:41 +0000 |
---|---|---|
committer | Piotr Padlewski <prazek@google.com> | 2015-08-27 21:35:41 +0000 |
commit | 81461a4350a105f73b40c3212baafd2b66d3ce22 (patch) | |
tree | 99c95d7c72c6d247efa6911e625241f0b4af0712 /clang/test/CodeGenCXX/vtable-available-externally.cpp | |
parent | 525f746710c9b132b20b653d5d8bd130e9bd5e59 (diff) | |
download | bcm5719-llvm-81461a4350a105f73b40c3212baafd2b66d3ce22.tar.gz bcm5719-llvm-81461a4350a105f73b40c3212baafd2b66d3ce22.zip |
Assume loads fix #2
There was linker problem, and it turns out that it is not always safe
to refer to vtable. If the vtable is used, then we can refer to it
without any problem, but because we don't know when it will be used or
not, we can only check if vtable is external or it is safe to to emit it
speculativly (when class it doesn't have any inline virtual functions).
It should be fixed in the future.
http://reviews.llvm.org/D12385
llvm-svn: 246214
Diffstat (limited to 'clang/test/CodeGenCXX/vtable-available-externally.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/vtable-available-externally.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/test/CodeGenCXX/vtable-available-externally.cpp b/clang/test/CodeGenCXX/vtable-available-externally.cpp index 8134047c9f2..ba56499f674 100644 --- a/clang/test/CodeGenCXX/vtable-available-externally.cpp +++ b/clang/test/CodeGenCXX/vtable-available-externally.cpp @@ -184,8 +184,8 @@ void f() { } // Test8 namespace Test9 { -// all virtual functions are outline, so we can assume that it will -// be generated in translation unit where foo is defined +// All virtual functions are outline, so we can assume that it will +// be generated in translation unit where foo is defined. // CHECK-TEST9-DAG: @_ZTVN5Test91AE = available_externally unnamed_addr constant // CHECK-TEST9-DAG: @_ZTVN5Test91BE = available_externally unnamed_addr constant struct A { @@ -217,14 +217,14 @@ struct A { }; void A::foo() {} -// Because key function is inline we will generate vtable as linkonce_odr +// Because key function is inline we will generate vtable as linkonce_odr. // CHECK-TEST10-DAG: @_ZTVN6Test101DE = linkonce_odr unnamed_addr constant struct D : A { void bar(); }; inline void D::bar() {} -// because B has outline key function then we can refer to +// Because B has outline all virtual functions, we can refer to them. // CHECK-TEST10-DAG: @_ZTVN6Test101BE = available_externally unnamed_addr constant struct B : A { void foo(); @@ -233,7 +233,7 @@ struct B : A { // C's key function (car) is outline, but C has inline virtual function so we // can't guarantee that we will be able to refer to bar from name -// so (at the moment) we can't emit vtable available_externally +// so (at the moment) we can't emit vtable available_externally. // CHECK-TEST10-DAG: @_ZTVN6Test101CE = external unnamed_addr constant struct C : A { void bar() {} // defined in body - not key function @@ -365,4 +365,3 @@ void test() { } } - |