diff options
| author | Owen Anderson <resistor@mac.com> | 2011-08-30 22:10:03 +0000 |
|---|---|---|
| committer | Owen Anderson <resistor@mac.com> | 2011-08-30 22:10:03 +0000 |
| commit | d16fb43b1f06c60068e0593c3ba55021bc675e10 (patch) | |
| tree | e4f002441036ff224b3f5296a3c9d5b54d94c734 /llvm/lib/Target/ARM/MCTargetDesc | |
| parent | 543c89fb15b6846731cadca904cffe411c19196a (diff) | |
| download | bcm5719-llvm-d16fb43b1f06c60068e0593c3ba55021bc675e10.tar.gz bcm5719-llvm-d16fb43b1f06c60068e0593c3ba55021bc675e10.zip | |
Fix encoding of PC-relative Thumb1 LDR's when using immediate offsets instead of labels.
llvm-svn: 138835
Diffstat (limited to 'llvm/lib/Target/ARM/MCTargetDesc')
| -rw-r--r-- | llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp b/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp index b798a3c226d..ab2162cbebb 100644 --- a/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp +++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp @@ -930,7 +930,10 @@ getAddrModeISOpValue(const MCInst &MI, unsigned OpIdx, uint32_t ARMMCCodeEmitter:: getAddrModePCOpValue(const MCInst &MI, unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups) const { - return ::getBranchTargetOpValue(MI, OpIdx, ARM::fixup_arm_thumb_cp, Fixups); + const MCOperand MO = MI.getOperand(OpIdx); + if (MO.isExpr()) + return ::getBranchTargetOpValue(MI, OpIdx, ARM::fixup_arm_thumb_cp, Fixups); + return (MO.getImm() >> 2); } /// getAddrMode5OpValue - Return encoding info for 'reg +/- imm10' operand. |

