Revert "[MC][NFC] Make FeatureKV/SubtargetKV pointers private"#206234
Merged
aengelke merged 1 commit intoJun 27, 2026
Merged
Conversation
This reverts commit 0b3d2ae.
You can test this locally with the following command:git-clang-format --diff origin/main HEAD --extensions cpp,h -- clang/tools/driver/cc1_main.cpp llvm/include/llvm/MC/MCSubtargetInfo.h llvm/lib/MC/MCSubtargetInfo.cpp llvm/lib/Target/AMDGPU/AMDGPURemoveIncompatibleFunctions.cpp llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp mlir/lib/Target/LLVMIR/Transforms/TargetToTargetFeatures.cpp --diff_from_common_commit
View the diff from clang-format here.diff --git a/llvm/include/llvm/MC/MCSubtargetInfo.h b/llvm/include/llvm/MC/MCSubtargetInfo.h
index 708de6d98..2fabfc595 100644
--- a/llvm/include/llvm/MC/MCSubtargetInfo.h
+++ b/llvm/include/llvm/MC/MCSubtargetInfo.h
@@ -40,9 +40,7 @@ struct SubtargetFeatureKV {
FeatureBitArray Implies; ///< K-V bit mask
/// Compare routine for std::lower_bound
- bool operator<(StringRef S) const {
- return StringRef(Key) < S;
- }
+ bool operator<(StringRef S) const { return StringRef(Key) < S; }
/// Compare routine for std::is_sorted.
bool operator<(const SubtargetFeatureKV &Other) const {
@@ -60,9 +58,7 @@ struct SubtargetSubTypeKV {
const MCSchedModel *SchedModel;
/// Compare routine for std::lower_bound
- bool operator<(StringRef S) const {
- return StringRef(Key) < S;
- }
+ bool operator<(StringRef S) const { return StringRef(Key) < S; }
/// Compare routine for std::is_sorted.
bool operator<(const SubtargetSubTypeKV &Other) const {
diff --git a/llvm/lib/MC/MCSubtargetInfo.cpp b/llvm/lib/MC/MCSubtargetInfo.cpp
index ed263a2b4..ecba74060 100644
--- a/llvm/lib/MC/MCSubtargetInfo.cpp
+++ b/llvm/lib/MC/MCSubtargetInfo.cpp
@@ -28,7 +28,8 @@ static const T *Find(StringRef S, ArrayRef<T> A) {
// Binary search the array
auto F = llvm::lower_bound(A, S);
// If not found then return NULL
- if (F == A.end() || StringRef(F->Key) != S) return nullptr;
+ if (F == A.end() || StringRef(F->Key) != S)
+ return nullptr;
// Return the found array item
return F;
}
|
aengelke
added a commit
that referenced
this pull request
Jun 27, 2026
LouisLu060211
pushed a commit
to LouisLu060211/llvm-project
that referenced
this pull request
Jun 30, 2026
…206234) Build failures in C++20 mode due to deleted constructor preventing brace initialization. Reverts llvm#206178
LouisLu060211
pushed a commit
to LouisLu060211/llvm-project
that referenced
this pull request
Jun 30, 2026
…#206234) (llvm#206237) Fix C++20 build by adding an explicit constructor. This also permits making the fields private. This reapplies llvm#206178. This reverts commit e44103c.
maarcosrmz
pushed a commit
to maarcosrmz/llvm-project
that referenced
this pull request
Jul 1, 2026
…206234) Build failures in C++20 mode due to deleted constructor preventing brace initialization. Reverts llvm#206178
maarcosrmz
pushed a commit
to maarcosrmz/llvm-project
that referenced
this pull request
Jul 1, 2026
…#206234) (llvm#206237) Fix C++20 build by adding an explicit constructor. This also permits making the fields private. This reapplies llvm#206178. This reverts commit e44103c.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Build failures in C++20 mode due to deleted constructor preventing brace initialization.
Reverts #206178