From 1d0bd8e51be2627f79bede54735c38b917ea04ee Mon Sep 17 00:00:00 2001 From: Jennifer Yu Date: Tue, 22 Aug 2023 11:31:42 -0700 Subject: [MSABI] Remove comdat attribute for inheriting ctor. Currently, for MS, the linkage for the inheriting constructors is set to internal. However, the comdat attribute is also set like: define internal noundef ptr @"??0?$B@_N@@qeaa@AEBVF@@aebua@@@z"(ptr noundef nonnull returned align 1 dereferenceable(1) %this, ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef nonnull align 1 dereferenceable(1) %1) unnamed_addr comdat This could cause linker to fail. The change is to remove comdat attribute for the inheriting constructor to make linker happy. Differential Revision: https://reviews.llvm.org/D158538 --- clang/lib/CodeGen/CodeGenModule.cpp | 9 --------- 1 file changed, 9 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 9b241165b7c5..08bc1a8d0186 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1970,15 +1970,6 @@ CodeGenModule::getFunctionLinkage(GlobalDecl GD) { if (const auto *Dtor = dyn_cast(D)) return getCXXABI().getCXXDestructorLinkage(Linkage, Dtor, GD.getDtorType()); - if (isa(D) && - cast(D)->isInheritingConstructor() && - Context.getTargetInfo().getCXXABI().isMicrosoft()) { - // Our approach to inheriting constructors is fundamentally different from - // that used by the MS ABI, so keep our inheriting constructor thunks - // internal rather than trying to pick an unambiguous mangling for them. - return llvm::GlobalValue::InternalLinkage; - } - return getLLVMLinkageForDeclarator(D, Linkage); } -- cgit v1.2.3