Fix the -cxx-abi microsoft -mconstructor-aliases combination.
On the microsoft ABI clang is producing one weak_odr and one linkonce_odr destructor, which is reasonable since only one is required. The fix is simply to move the assert past the special case treatment of linkonce_odr. llvm-svn: 194158
This commit is contained in:
parent
05b7b37021
commit
5fb3a13ba7
|
@ -146,13 +146,13 @@ bool CodeGenModule::TryEmitDefinitionAsAlias(GlobalDecl AliasDecl,
|
|||
if (!InEveryTU)
|
||||
return true;
|
||||
|
||||
assert(Linkage == TargetLinkage);
|
||||
// Instead of creating as alias to a linkonce_odr, replace all of the uses
|
||||
// of the aliassee.
|
||||
if (TargetLinkage == llvm::GlobalValue::LinkOnceODRLinkage) {
|
||||
if (Linkage == llvm::GlobalValue::LinkOnceODRLinkage) {
|
||||
Replacements[MangledName] = Aliasee;
|
||||
return false;
|
||||
}
|
||||
assert(Linkage == TargetLinkage);
|
||||
}
|
||||
|
||||
// Create the alias with no name.
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
// RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 -fno-rtti -mconstructor-aliases | FileCheck %s
|
||||
|
||||
namespace test1 {
|
||||
template <typename T> class A {
|
||||
~A() {}
|
||||
};
|
||||
template class A<char>;
|
||||
// CHECK: define weak_odr x86_thiscallcc void @"\01??1?$A@D@test1@@AAE@XZ"
|
||||
}
|
Loading…
Reference in New Issue