summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2018-01-16 19:49:52 +0000
committerErich Keane <erich.keane@intel.com>2018-01-16 19:49:52 +0000
commit0a6fde48954471957234ea42b7645425d8765f5f (patch)
tree9fb65d8e1432f3e15bd1fc4f8caed430aa517af2 /clang/lib/CodeGen/CodeGenModule.cpp
parente6fb4e1f8ab3c76cbded23fbebdaec969205031f (diff)
downloadbcm5719-llvm-0a6fde48954471957234ea42b7645425d8765f5f.tar.gz
bcm5719-llvm-0a6fde48954471957234ea42b7645425d8765f5f.zip
Move target MV resolver to COMDAT
As reported here: https://bugs.llvm.org/show_bug.cgi?id=35921 The resolver functions should be in their own COMDAT regions. This patch sets that up. Differential Revision: https://reviews.llvm.org/D42110 llvm-svn: 322592
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index acf6e4d63cc..fb16c8f2607 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -2185,6 +2185,9 @@ void CodeGenModule::emitMultiVersionFunctions() {
llvm::Function *ResolverFunc = cast<llvm::Function>(
GetGlobalValue((getMangledName(GD) + ".resolver").str()));
+ if (supportsCOMDAT())
+ ResolverFunc->setComdat(
+ getModule().getOrInsertComdat(ResolverFunc->getName()));
std::stable_sort(
Options.begin(), Options.end(),
std::greater<CodeGenFunction::MultiVersionResolverOption>());
OpenPOWER on IntegriCloud