[PATCH] D123764: [llvm-objdump] Implemented PrintBranchImmAsAddress for MIPS

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 15 09:43:52 PDT 2022


MaskRay accepted this revision.
MaskRay added a comment.
This revision is now accepted and ready to land.
Herald added a subscriber: StephenFan.

Looks great!



================
Comment at: llvm/lib/Target/Mips/MCTargetDesc/MipsInstPrinter.cpp:172
+  } else
+    O << formatImm(Op.getImm());
+}
----------------
Add braces if `then` branch uses braces. https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements


================
Comment at: llvm/lib/Target/Mips/MCTargetDesc/MipsInstPrinter.cpp:246
   OS << "\t" << Str << "\t";
-  printOperand(&MI, OpNo, OS);
+  IsBranch ? printBranchOperand(&MI, Address, OpNo, STI, OS)
+           : printOperand(&MI, OpNo, STI, OS);
----------------
The idiom is to prefer it to the conditional operator if the return value is not used.

ditto below


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123764/new/

https://reviews.llvm.org/D123764



More information about the llvm-commits mailing list