summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2012-04-09 20:32:12 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2012-04-09 20:32:12 +0000
commit8483a6c47d5ec7f265f951061eef6a117b3ddb07 (patch)
treecd66f74c731ef623da6cdcda88dae4702f96ce3c /llvm/lib
parente0e38f61a5467224bcff4dac5128f95d7369a99e (diff)
downloadbcm5719-llvm-8483a6c47d5ec7f265f951061eef6a117b3ddb07.tar.gz
bcm5719-llvm-8483a6c47d5ec7f265f951061eef6a117b3ddb07.zip
Have TargetLowering::getPICJumpTableRelocBase return a node that points to the
GOT if jump table uses 64-bit gp-relative relocation. llvm-svn: 154341
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 82a91de2bbc..09a2b1f3d7a 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -1079,8 +1079,12 @@ unsigned TargetLowering::getJumpTableEncoding() const {
SDValue TargetLowering::getPICJumpTableRelocBase(SDValue Table,
SelectionDAG &DAG) const {
// If our PIC model is GP relative, use the global offset table as the base.
- if (getJumpTableEncoding() == MachineJumpTableInfo::EK_GPRel32BlockAddress)
+ unsigned JTEncoding = getJumpTableEncoding();
+
+ if ((JTEncoding == MachineJumpTableInfo::EK_GPRel64BlockAddress) ||
+ (JTEncoding == MachineJumpTableInfo::EK_GPRel32BlockAddress))
return DAG.getGLOBAL_OFFSET_TABLE(getPointerTy());
+
return Table;
}
OpenPOWER on IntegriCloud