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

Holio Lin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 01:47:21 PST 2022


holio0 updated this revision to Diff 473597.
holio0 added a comment.

[AArch64InstPrinter] Print TargetAddress as an uint64_t

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

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

Differential Revision: https://reviews.llvm.org/D137260


Repository:
  rG LLVM Github Monorepo

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

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
@@ -1613,7 +1613,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.473597.patch
Type: text/x-patch
Size: 645 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221107/edcaee56/attachment.bin>


More information about the llvm-commits mailing list