diff options
| author | Tom Honermann <tom.honermann@intel.com> | 2022-03-25 15:38:08 -0700 |
|---|---|---|
| committer | Tom Honermann <tom@honermann.net> | 2022-04-05 15:34:35 -0400 |
| commit | 7c53fc4fe1308f5b2a7527d14ea41fabb18109b8 (patch) | |
| tree | b3a09016547b3378325bbf4836aad25d4e47d8d7 /clang/lib/CodeGen/CodeGenModule.cpp | |
| parent | 3531a4fa3b7038d43ac20f56871da88aa25bf53d (diff) | |
[clang] Emit target_clones resolver functions as COMDAT.
Previously, resolver functions synthesized for target_clones multiversion
functions were not emitted as COMDAT. Now fixed.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 4d24c33f51d0..ddcf564e688f 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -3454,6 +3454,10 @@ void CodeGenModule::EmitTargetClonesResolver(GlobalDecl GD) { Options.emplace_back(cast<llvm::Function>(Func), Architecture, Feature); } + if (supportsCOMDAT()) + ResolverFunc->setComdat( + getModule().getOrInsertComdat(ResolverFunc->getName())); + const TargetInfo &TI = getTarget(); std::stable_sort( Options.begin(), Options.end(), |
