[llvm] dc6e68a - [TableGen] Add const to SubtargetFeatures reference in emitSubtargetFeatureBitEnumeration. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 23 10:22:46 PDT 2023
Author: Craig Topper
Date: 2023-08-23T10:21:39-07:00
New Revision: dc6e68a8394ed97e6534cfa97d39d6fe4060b0fc
URL: https://github.com/llvm/llvm-project/commit/dc6e68a8394ed97e6534cfa97d39d6fe4060b0fc
DIFF: https://github.com/llvm/llvm-project/commit/dc6e68a8394ed97e6534cfa97d39d6fe4060b0fc.diff
LOG: [TableGen] Add const to SubtargetFeatures reference in emitSubtargetFeatureBitEnumeration. NFC
emitSubtargetFeatureBitEnumeration doesn't modify the map so we should
use const reference.
Added:
Modified:
llvm/utils/TableGen/SubtargetFeatureInfo.cpp
llvm/utils/TableGen/SubtargetFeatureInfo.h
Removed:
################################################################################
diff --git a/llvm/utils/TableGen/SubtargetFeatureInfo.cpp b/llvm/utils/TableGen/SubtargetFeatureInfo.cpp
index 1db8c0bf430a7a..15144e821965a8 100644
--- a/llvm/utils/TableGen/SubtargetFeatureInfo.cpp
+++ b/llvm/utils/TableGen/SubtargetFeatureInfo.cpp
@@ -47,7 +47,7 @@ SubtargetFeatureInfo::getAll(const RecordKeeper &Records) {
}
void SubtargetFeatureInfo::emitSubtargetFeatureBitEnumeration(
- SubtargetFeatureInfoMap &SubtargetFeatures, raw_ostream &OS) {
+ const SubtargetFeatureInfoMap &SubtargetFeatures, raw_ostream &OS) {
OS << "// Bits for subtarget features that participate in "
<< "instruction matching.\n";
OS << "enum SubtargetFeatureBits : "
diff --git a/llvm/utils/TableGen/SubtargetFeatureInfo.h b/llvm/utils/TableGen/SubtargetFeatureInfo.h
index 77703e8a87f858..6c9dd6c3ad228e 100644
--- a/llvm/utils/TableGen/SubtargetFeatureInfo.h
+++ b/llvm/utils/TableGen/SubtargetFeatureInfo.h
@@ -54,9 +54,8 @@ struct SubtargetFeatureInfo {
///
/// This version emits the bit index for the feature and can therefore support
/// more than 64 feature bits.
- static void
- emitSubtargetFeatureBitEnumeration(SubtargetFeatureInfoMap &SubtargetFeatures,
- raw_ostream &OS);
+ static void emitSubtargetFeatureBitEnumeration(
+ const SubtargetFeatureInfoMap &SubtargetFeatures, raw_ostream &OS);
static void emitNameTable(SubtargetFeatureInfoMap &SubtargetFeatures,
raw_ostream &OS);
More information about the llvm-commits
mailing list