[clang] [RISCV][NFC] Make generated intrinsic records more human-readable (PR #133710)
Craig Topper via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 10 21:05:57 PDT 2025
================
@@ -1196,36 +1196,90 @@ SmallVector<PrototypeDescriptor> parsePrototypes(StringRef Prototypes) {
return PrototypeDescriptors;
}
+#define STRINGIFY(NAME) \
+ case NAME: \
+ OS << #NAME; \
+ break;
+
+llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, enum PolicyScheme PS) {
+ switch (PS) {
+ STRINGIFY(SchemeNone)
+ STRINGIFY(HasPassthruOperand)
+ STRINGIFY(HasPolicyOperand)
+ }
+ return OS;
+}
+
+llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, enum RVVRequire Require) {
+ switch (Require) {
+ STRINGIFY(RVV_REQ_RV64)
+ STRINGIFY(RVV_REQ_Zvfhmin)
+ STRINGIFY(RVV_REQ_Xsfvcp)
+ STRINGIFY(RVV_REQ_Xsfvfnrclipxfqf)
+ STRINGIFY(RVV_REQ_Xsfvfwmaccqqq)
+ STRINGIFY(RVV_REQ_Xsfvqmaccdod)
+ STRINGIFY(RVV_REQ_Xsfvqmaccqoq)
+ STRINGIFY(RVV_REQ_Zvbb)
+ STRINGIFY(RVV_REQ_Zvbc)
+ STRINGIFY(RVV_REQ_Zvkb)
+ STRINGIFY(RVV_REQ_Zvkg)
+ STRINGIFY(RVV_REQ_Zvkned)
+ STRINGIFY(RVV_REQ_Zvknha)
+ STRINGIFY(RVV_REQ_Zvknhb)
+ STRINGIFY(RVV_REQ_Zvksed)
+ STRINGIFY(RVV_REQ_Zvksh)
+ STRINGIFY(RVV_REQ_Zvfbfwma)
+ STRINGIFY(RVV_REQ_Zvfbfmin)
+ STRINGIFY(RVV_REQ_Zvfh)
+ STRINGIFY(RVV_REQ_Experimental)
+ default:
----------------
topperc wrote:
This looks dangerous. How will we know if we forget to update this switch?
https://github.com/llvm/llvm-project/pull/133710
More information about the cfe-commits
mailing list