[llvm] [TableGen][NFC] Refactor/deduplicate emitAction. (PR #137434)

Jason Eckhardt via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 26 05:55:03 PDT 2025


================
@@ -125,6 +126,56 @@ void CallingConvEmitter::emitCallingConv(const Record *CC, raw_ostream &O) {
 
 void CallingConvEmitter::emitAction(const Record *Action, indent Indent,
                                     raw_ostream &O) {
+
+  auto EmitRegList = [&](const ListInit *RL, const StringRef RLName) {
+    O << Indent << "static const MCPhysReg " << RLName << "[] = {\n";
+    O << Indent << "  ";
+    ListSeparator LS;
+    for (const Init *V : RL->getValues())
+      O << LS << getQualifiedName(dyn_cast<DefInit>(V)->getDef());
----------------
nvjle wrote:

Correct, it should not fail. Done.

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


More information about the llvm-commits mailing list