[lld] 727ce02 - [lld][macho] Rename test to fix spelling (#160938)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 26 17:21:25 PDT 2025
Author: Ellis Hoag
Date: 2025-09-26T17:21:21-07:00
New Revision: 727ce02653c29467b861a6ede0c925f3fdb8a6cb
URL: https://github.com/llvm/llvm-project/commit/727ce02653c29467b861a6ede0c925f3fdb8a6cb
DIFF: https://github.com/llvm/llvm-project/commit/727ce02653c29467b861a6ede0c925f3fdb8a6cb.diff
LOG: [lld][macho] Rename test to fix spelling (#160938)
The test name had a typo from
https://github.com/llvm/llvm-project/pull/140307. Fix it.
I realized cstring ordering is not supported when string deduplication
is turned off. We could easily call `buildCStringPriorities()` in
`CStringSection::finalizeContents()`, but I worry it might harm build
performance since it creates multiple vectors and searches though maps.
If users are not deduplicating strings, they probably won't care to
order them, but it would be good to support this.
Added:
lld/test/MachO/order-file-cstring.s
Modified:
lld/MachO/SyntheticSections.cpp
Removed:
lld/test/MachO/ordre-file-cstring.s
################################################################################
diff --git a/lld/MachO/SyntheticSections.cpp b/lld/MachO/SyntheticSections.cpp
index 979a4ee6d8133..228b84db21c2a 100644
--- a/lld/MachO/SyntheticSections.cpp
+++ b/lld/MachO/SyntheticSections.cpp
@@ -1687,6 +1687,9 @@ void CStringSection::writeTo(uint8_t *buf) const {
void CStringSection::finalizeContents() {
uint64_t offset = 0;
+ // TODO: Call buildCStringPriorities() to support cstring ordering when
+ // deduplication is off, although this may negatively impact build
+ // performance.
for (CStringInputSection *isec : inputs) {
for (const auto &[i, piece] : llvm::enumerate(isec->pieces)) {
if (!piece.live)
diff --git a/lld/test/MachO/ordre-file-cstring.s b/lld/test/MachO/order-file-cstring.s
similarity index 100%
rename from lld/test/MachO/ordre-file-cstring.s
rename to lld/test/MachO/order-file-cstring.s
More information about the llvm-commits
mailing list