[PATCH] D137260: [AArch64InstPrinter] Print TargetAddress as an uint64_t

Holio Lin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 2 08:35:22 PDT 2022


holio0 created this revision.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
holio0 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Outputs readable addresses by printed 'TargetAddress' as an uint64_t
value.

`bl     -0x37efd56628` => `bl     0xffffffc8102a99d8`


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137260

Files:
  llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp


Index: llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
===================================================================
--- llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
+++ llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
@@ -1589,7 +1589,7 @@
       dyn_cast<MCConstantExpr>(MI->getOperand(OpNum).getExpr());
   int64_t TargetAddress;
   if (BranchTarget && BranchTarget->evaluateAsAbsolute(TargetAddress)) {
-    O << formatHex(TargetAddress);
+    O << formatHex((uint64_t) TargetAddress);
   } else {
     // Otherwise, just print the expression.
     MI->getOperand(OpNum).getExpr()->print(O, &MAI);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137260.472628.patch
Type: text/x-patch
Size: 646 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221102/4a710620/attachment.bin>


More information about the llvm-commits mailing list