[llvm] [RISCV][MC] Emit Better Token Diagnostics (PR #209700)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 16:48:11 PDT 2026


================
@@ -2800,21 +2830,15 @@ static void emitMatchRegisterAltName(const CodeGenTarget &Target,
 
 /// emitOperandDiagnosticTypes - Emit the operand matching diagnostic types.
 static void emitOperandDiagnosticTypes(AsmMatcherInfo &Info, raw_ostream &OS) {
-  // Get the set of diagnostic types from all of the operand classes.
   std::set<StringRef> Types;
-  for (const auto &OpClassEntry : Info.AsmOperandClasses) {
-    if (!OpClassEntry.second->DiagnosticType.empty())
-      Types.insert(OpClassEntry.second->DiagnosticType);
-  }
-  for (const auto &OpClassEntry : Info.RegisterClassClasses) {
-    if (!OpClassEntry.second->DiagnosticType.empty())
-      Types.insert(OpClassEntry.second->DiagnosticType);
+  for (const auto &CI : Info.Classes) {
+    if (!CI.DiagnosticType.empty())
+      Types.insert(CI.DiagnosticType);
   }
 
   if (Types.empty())
     return;
 
-  // Now emit the enum entries.
----------------
topperc wrote:

Why did this comment get removed?

https://github.com/llvm/llvm-project/pull/209700


More information about the llvm-commits mailing list