summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-22 00:44:05 +0000
committerChris Lattner <sabre@nondot.org>2009-12-22 00:44:05 +0000
commit6211d7ba4be1802d81e6e3b45c8f277ac4599d28 (patch)
tree5d261d4d326552b760e08c16857a4495a41e1d20 /llvm/lib/Target
parentb99b2693f3ad5c875e7844acdd1053b95f287248 (diff)
downloadbcm5719-llvm-6211d7ba4be1802d81e6e3b45c8f277ac4599d28.tar.gz
bcm5719-llvm-6211d7ba4be1802d81e6e3b45c8f277ac4599d28.zip
print pcrel immediates as signed values instead of unsigned so that we
get things like this out of the disassembler: 0x100000ecb: callq -96 instead of: 0x100000ecb: callq 4294967200 rdar://7491123 llvm-svn: 91864
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp b/llvm/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp
index 8ec5b62192e..c74b97af308 100644
--- a/llvm/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp
+++ b/llvm/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp
@@ -45,12 +45,14 @@ void X86ATTInstPrinter::printSSECC(const MCInst *MI, unsigned Op) {
}
/// print_pcrel_imm - This is used to print an immediate value that ends up
-/// being encoded as a pc-relative value. These print slightly differently, for
-/// example, a $ is not emitted.
+/// being encoded as a pc-relative value (e.g. for jumps and calls). These
+/// print slightly differently than normal immediates. For example, a $ is not
+/// emitted.
void X86ATTInstPrinter::print_pcrel_imm(const MCInst *MI, unsigned OpNo) {
const MCOperand &Op = MI->getOperand(OpNo);
if (Op.isImm())
- O << Op.getImm();
+ // Print this as a signed 32-bit value.
+ O << (int)Op.getImm();
else {
assert(Op.isExpr() && "unknown pcrel immediate operand");
Op.getExpr()->print(O, &MAI);
OpenPOWER on IntegriCloud