diff options
author | Hans Wennborg <hans@hanshq.net> | 2014-06-06 20:04:01 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2014-06-06 20:04:01 +0000 |
commit | c94391d3bfb18ed6ec0989fad1cdf66afd1292f7 (patch) | |
tree | 79d3f58f5657986f0a5559f71854f6bc9e1c93b3 /clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp | |
parent | 0766ae08e58cb6358ed1ce407439bd3614380b2e (diff) | |
download | bcm5719-llvm-c94391d3bfb18ed6ec0989fad1cdf66afd1292f7.tar.gz bcm5719-llvm-c94391d3bfb18ed6ec0989fad1cdf66afd1292f7.zip |
MS ABI: Update the thunk linkage computation
As suggested by Reid:
- class has GVA_Internal linkage -> internal
- thunk has return adjustment -> weak_odr, to handle evil corner case [1]
- all other normal methods -> linkonce_odr
1. Evil corner case:
struct Incomplete;
struct A { int a; virtual A *bar(); };
struct B { int b; virtual B *foo(Incomplete); };
struct C : A, B { int c; virtual C *foo(Incomplete); };
C c;
Here, the thunk for C::foo() will be emitted when C::foo() is defined, which
might be in a different translation unit, so it needs to be weak_odr.
Differential Revision: http://reviews.llvm.org/D3992
llvm-svn: 210368
Diffstat (limited to 'clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp b/clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp index 6ef31769350..4ce4e9c2e17 100644 --- a/clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp +++ b/clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp @@ -145,7 +145,7 @@ struct X: virtual C { // MANGLING-DAG: @"\01??_7X@Test4@@6B@" // Also check the mangling of the thunk. - // MANGLING-DAG: define weak x86_thiscallcc void @"\01?f@C@@WPPPPPPPI@AEXXZ" + // MANGLING-DAG: define linkonce_odr x86_thiscallcc void @"\01?f@C@@WPPPPPPPI@AEXXZ" }; X::X() {} |