Skip to content

Commit

Permalink
For ARM disassembly only print 32 unsigned bits for the address of br…
Browse files Browse the repository at this point in the history
…anch

targets so if the branch target has the high bit set it does not get printed as:
	 beq     0xffffffff8008c404


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154685 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
enderby committed Apr 13, 2012
1 parent 4423477 commit 6c22695
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ void ARMInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
} else {
assert(Op.isExpr() && "unknown operand kind in printOperand");
// If a symbolic branch target was added as a constant expression then print
// that address in hex.
// that address in hex. And only print 32 unsigned bits for the address.
const MCConstantExpr *BranchTarget = dyn_cast<MCConstantExpr>(Op.getExpr());
int64_t Address;
if (BranchTarget && BranchTarget->EvaluateAsAbsolute(Address)) {
O << "0x";
O.write_hex(Address);
O.write_hex((uint32_t)Address);
}
else {
// Otherwise, just print the expression.
Expand Down

0 comments on commit 6c22695

Please sign in to comment.