diff options
author | Reid Kleckner <rnk@google.com> | 2018-07-26 22:59:17 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2018-07-26 22:59:17 +0000 |
commit | c6cf918f448bd3ba1f8f0feff9f97a1fc4e3b7ef (patch) | |
tree | ac85d3e79cb58e4caf241f03155a65eccd639bc0 /llvm/lib/ProfileData/InstrProf.cpp | |
parent | 9ea65082ff5a5fe187608783641d57afe8fcf18e (diff) | |
download | bcm5719-llvm-c6cf918f448bd3ba1f8f0feff9f97a1fc4e3b7ef.tar.gz bcm5719-llvm-c6cf918f448bd3ba1f8f0feff9f97a1fc4e3b7ef.zip |
[InstrProf] Use comdats on COFF for available_externally functions
Summary:
r262157 added ELF-specific logic to put a comdat on the __profc_*
globals created for available_externally functions. We should be able to
generalize that logic to all object file formats that support comdats,
i.e. everything other than MachO. This fixes duplicate symbol errors,
since on COFF, linkonce_odr doesn't make the symbol weak.
Fixes PR38251.
Reviewers: davidxl, xur
Subscribers: hiraditya, dmajor, llvm-commits, aheejin
Differential Revision: https://reviews.llvm.org/D49882
llvm-svn: 338082
Diffstat (limited to 'llvm/lib/ProfileData/InstrProf.cpp')
-rw-r--r-- | llvm/lib/ProfileData/InstrProf.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp index bae293aa75f..544a77ec20a 100644 --- a/llvm/lib/ProfileData/InstrProf.cpp +++ b/llvm/lib/ProfileData/InstrProf.cpp @@ -926,8 +926,7 @@ bool needsComdatForCounter(const Function &F, const Module &M) { if (F.hasComdat()) return true; - Triple TT(M.getTargetTriple()); - if (!TT.isOSBinFormatELF() && !TT.isOSBinFormatWasm()) + if (!Triple(M.getTargetTriple()).supportsCOMDAT()) return false; // See createPGOFuncNameVar for more details. To avoid link errors, profile |