From 392487793248f53726d2f9591966dbe42a89a17a Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Tue, 20 Jul 2021 12:47:10 -0700 Subject: [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 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp') diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index da3158b..0a202c3 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -1132,7 +1132,7 @@ static unsigned getEncodedComdatSelectionKind(const Comdat &C) { return bitc::COMDAT_SELECTION_KIND_EXACT_MATCH; case Comdat::Largest: return bitc::COMDAT_SELECTION_KIND_LARGEST; - case Comdat::NoDuplicates: + case Comdat::NoDeduplicate: return bitc::COMDAT_SELECTION_KIND_NO_DUPLICATES; case Comdat::SameSize: return bitc::COMDAT_SELECTION_KIND_SAME_SIZE; -- cgit v1.1