aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2021-07-20 12:47:10 -0700
committerFangrui Song <i@maskray.me>2021-07-20 12:47:10 -0700
commit392487793248f53726d2f9591966dbe42a89a17a (patch)
treef20ae2614f572e93c1c4473847c730bd9f21021c /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parent55c65884a41c4dec2c3efd056657cc7c590c1bcb (diff)
downloadllvm-392487793248f53726d2f9591966dbe42a89a17a.zip
llvm-392487793248f53726d2f9591966dbe42a89a17a.tar.gz
llvm-392487793248f53726d2f9591966dbe42a89a17a.tar.bz2
[IR] Rename `comdat noduplicates` to `comdat nodeduplicate`
In the textual format, `noduplicates` means no COMDAT/section group deduplication is performed. Therefore, if both sets of sections are retained, and they happen to define strong external symbols with the same names, there will be a duplicate definition linker error. In PE/COFF, the selection kind lowers to `IMAGE_COMDAT_SELECT_NODUPLICATES`. The name describes the corollary instead of the immediate semantics. The name can cause confusion to other binary formats (ELF, wasm) which have implemented/ want to implement the "no deduplication" selection kind. Rename it to be clearer. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D106319
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 56fdbc1..8d8838f 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -532,10 +532,10 @@ static const Comdat *getELFComdat(const GlobalValue *GV) {
return nullptr;
if (C->getSelectionKind() != Comdat::Any &&
- C->getSelectionKind() != Comdat::NoDuplicates)
+ C->getSelectionKind() != Comdat::NoDeduplicate)
report_fatal_error("ELF COMDATs only support SelectionKind::Any and "
- "SelectionKind::NoDuplicates, '" + C->getName() +
- "' cannot be lowered.");
+ "SelectionKind::NoDeduplicate, '" +
+ C->getName() + "' cannot be lowered.");
return C;
}
@@ -1571,7 +1571,7 @@ static int getSelectionForCOFF(const GlobalValue *GV) {
return COFF::IMAGE_COMDAT_SELECT_EXACT_MATCH;
case Comdat::Largest:
return COFF::IMAGE_COMDAT_SELECT_LARGEST;
- case Comdat::NoDuplicates:
+ case Comdat::NoDeduplicate:
return COFF::IMAGE_COMDAT_SELECT_NODUPLICATES;
case Comdat::SameSize:
return COFF::IMAGE_COMDAT_SELECT_SAME_SIZE;