diff options
| author | Jennifer Yu <jennifer.yu@intel.com> | 2023-08-22 11:31:42 -0700 |
|---|---|---|
| committer | Jennifer Yu <jennifer.yu@intel.com> | 2023-08-28 15:19:23 -0700 |
| commit | 1d0bd8e51be2627f79bede54735c38b917ea04ee (patch) | |
| tree | 24e2934a0c88082b8c126c05abc58160afb886d1 /clang/lib/CodeGen/CodeGenModule.cpp | |
| parent | 88852964ecae94be71e98e9881ed8ed182df8c0c (diff) | |
[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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 9 |
1 files changed, 0 insertions, 9 deletions
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<CXXDestructorDecl>(D)) return getCXXABI().getCXXDestructorLinkage(Linkage, Dtor, GD.getDtorType()); - if (isa<CXXConstructorDecl>(D) && - cast<CXXConstructorDecl>(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); } |
