parent
b8039074d0
commit
f9b1730d41
|
@ -378,6 +378,9 @@ void CodeGenFunction::GenerateThunk(llvm::Function *Fn,
|
||||||
// Set the right linkage.
|
// Set the right linkage.
|
||||||
CGM.setFunctionLinkage(GD, Fn);
|
CGM.setFunctionLinkage(GD, Fn);
|
||||||
|
|
||||||
|
if (CGM.supportsCOMDAT() && Fn->isWeakForLinker())
|
||||||
|
Fn->setComdat(CGM.getModule().getOrInsertComdat(Fn->getName()));
|
||||||
|
|
||||||
// Set the right visibility.
|
// Set the right visibility.
|
||||||
const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl());
|
const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl());
|
||||||
setThunkVisibility(CGM, MD, Thunk, Fn);
|
setThunkVisibility(CGM, MD, Thunk, Fn);
|
||||||
|
|
|
@ -33,10 +33,10 @@ struct C : A, B {
|
||||||
virtual ~C();
|
virtual ~C();
|
||||||
// MANGLING-DAG: declare {{.*}} @"\01??1C@@UAE@XZ"({{.*}})
|
// MANGLING-DAG: declare {{.*}} @"\01??1C@@UAE@XZ"({{.*}})
|
||||||
// MANGLING-DAG: define {{.*}} @"\01??_GC@@UAEPAXI@Z"({{.*}})
|
// MANGLING-DAG: define {{.*}} @"\01??_GC@@UAEPAXI@Z"({{.*}})
|
||||||
// MANGLING-DAG: define {{.*}} @"\01??_EC@@W3AEPAXI@Z"({{.*}})
|
// MANGLING-DAG: define {{.*}} @"\01??_EC@@W3AEPAXI@Z"({{.*}}) {{.*}} comdat
|
||||||
// MANGLING-X64-DAG: declare {{.*}} @"\01??1C@@UEAA@XZ"({{.*}})
|
// MANGLING-X64-DAG: declare {{.*}} @"\01??1C@@UEAA@XZ"({{.*}})
|
||||||
// MANGLING-X64-DAG: define {{.*}} @"\01??_GC@@UEAAPEAXI@Z"({{.*}})
|
// MANGLING-X64-DAG: define {{.*}} @"\01??_GC@@UEAAPEAXI@Z"({{.*}})
|
||||||
// MANGLING-X64-DAG: define {{.*}} @"\01??_EC@@W7EAAPEAXI@Z"({{.*}})
|
// MANGLING-X64-DAG: define {{.*}} @"\01??_EC@@W7EAAPEAXI@Z"({{.*}}) {{.*}} comdat
|
||||||
|
|
||||||
// Overrides public_f() of two subobjects with distinct vfptrs, thus needs a thunk.
|
// Overrides public_f() of two subobjects with distinct vfptrs, thus needs a thunk.
|
||||||
virtual void public_f();
|
virtual void public_f();
|
||||||
|
@ -61,7 +61,7 @@ struct C : A, B {
|
||||||
|
|
||||||
C::C() {} // Emits vftable and forces thunk generation.
|
C::C() {} // Emits vftable and forces thunk generation.
|
||||||
|
|
||||||
// CODEGEN-LABEL: define linkonce_odr x86_thiscallcc i8* @"\01??_EC@@W3AEPAXI@Z"(%struct.C* %this, i32 %should_call_delete)
|
// CODEGEN-LABEL: define linkonce_odr x86_thiscallcc i8* @"\01??_EC@@W3AEPAXI@Z"(%struct.C* %this, i32 %should_call_delete) {{.*}} comdat
|
||||||
// CODEGEN: getelementptr i8* {{.*}}, i32 -4
|
// CODEGEN: getelementptr i8* {{.*}}, i32 -4
|
||||||
// FIXME: should actually call _EC, not _GC.
|
// FIXME: should actually call _EC, not _GC.
|
||||||
// CODEGEN: call x86_thiscallcc i8* @"\01??_GC@@UAEPAXI@Z"
|
// CODEGEN: call x86_thiscallcc i8* @"\01??_GC@@UAEPAXI@Z"
|
||||||
|
|
Loading…
Reference in New Issue