[clang] [llvm] [NFC] [RISCV] Refactor class RISCVExtension (PR #120040)
Pengcheng Wang via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 16 01:51:39 PST 2024
================
@@ -22,11 +24,21 @@
// uses the record name by replacing Feature with Has.
// value - Value to assign to the field in RISCVSubtarget when this
// extension is enabled. Usually "true", but can be changed.
-class RISCVExtension<string name, int major, int minor, string desc,
+// IsExperimental
+// - Indicates whether the extension is experimental
+class RISCVExtension<int major, int minor, string desc,
list<SubtargetFeature> implies = [],
string fieldname = !subst("Feature", "Has", NAME),
- string value = "true">
- : SubtargetFeature<name, fieldname, value, desc, implies> {
+ string value = "true", bit IsExperimental = false>
+ : SubtargetFeature<"", fieldname, value, "", implies> {
+ defvar ExtName = !subst("FeatureVendor", "", !subst("FeatureStdExt", "", NAME));
----------------
wangpc-pp wrote:
I still think we should use lower case here. Please see also `SchedCommon` in `llvm/lib/Target/RISCV/RISCVInstrInfoV.td`.
We have the discussion before (but I forgot the patch), for local variables, we tend to use lower camel case.
https://github.com/llvm/llvm-project/pull/120040
More information about the llvm-commits
mailing list