[llvm] [RISCV] Improve readability of RISCVGenCompressionInstEmitter. NFC (PR #134834)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 8 10:11:19 PDT 2025


================
@@ -909,14 +910,15 @@ void CompressInstEmitter::emitCompressInstEmitter(raw_ostream &OS,
 
   if (!ImmLeafPredicates.empty()) {
     OS << "static bool " << TargetName
-       << "ValidateMachineOperand(const MachineOperand &MO,\n"
-       << "                  const " << TargetName << "Subtarget *Subtarget,\n"
-       << "                  unsigned PredicateIndex) {\n"
-       << "  int64_t Imm = MO.getImm();\n"
-       << "  switch (PredicateIndex) {\n"
-       << "  default:\n"
-       << "    llvm_unreachable(\"Unknown ImmLeaf Predicate kind\");\n"
-       << "    break;\n";
+       << "ValidateMachineOperand(const MachineOperand &MO,\n";
+    OS.indent(40) << "const " << TargetName << "Subtarget *Subtarget,\n";
----------------
topperc wrote:

Should the indentation here be based on the length of `TargetName`?

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


More information about the llvm-commits mailing list