summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-11-06 14:39:49 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-11-06 14:39:49 +0000
commit26cfbea73872e0553a8449bfb14e12102414185e (patch)
tree4ed9a07fd69c448a3960085abace4d417e508353 /llvm/lib
parent7ecd22ca4a205788ce8228d60bf5e67bb06fdfb6 (diff)
downloadbcm5719-llvm-26cfbea73872e0553a8449bfb14e12102414185e.tar.gz
bcm5719-llvm-26cfbea73872e0553a8449bfb14e12102414185e.zip
Compute the correct jump table entries on 32 bit windows.
On 32 bit windows we use label differences and .set does not suppress rolocations, a combination that was not used before r220256. This fixes PR21497. llvm-svn: 221456
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index ba42742dd35..61f1d1b653e 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1247,8 +1247,9 @@ void AsmPrinter::EmitJumpTableEntry(const MachineJumpTableInfo *MJTI,
break;
}
Value = MCSymbolRefExpr::Create(MBB->getSymbol(), OutContext);
- const MCExpr *JTI = MCSymbolRefExpr::Create(GetJTISymbol(UID), OutContext);
- Value = MCBinaryExpr::CreateSub(Value, JTI, OutContext);
+ const TargetLowering *TLI = TM.getSubtargetImpl()->getTargetLowering();
+ const MCExpr *Base = TLI->getPICJumpTableRelocBaseExpr(MF, UID, OutContext);
+ Value = MCBinaryExpr::CreateSub(Value, Base, OutContext);
break;
}
}
OpenPOWER on IntegriCloud