diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-26 05:58:28 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-26 05:58:28 +0000 |
commit | beeb93e6ba48af2661eabc4872d8b159fb43e5db (patch) | |
tree | e63ff6ede38987fd5319fe7214f6d9fee5c9eefd /lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
parent | 13e97a29d9dfa5602f93a8c546f112c5d029e8f7 (diff) |
add a new MachineJumpTableInfo::getJTISymbol method,
use it to implement the default TargetLowering::getPICJumpTableRelocBaseExpr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94523 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/TargetLowering.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 34a31788ed..ccdedded90 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -13,6 +13,7 @@ #include "llvm/Target/TargetLowering.h" #include "llvm/MC/MCAsmInfo.h" +#include "llvm/MC/MCExpr.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetMachine.h" @@ -812,6 +813,7 @@ unsigned TargetLowering::getJumpTableEncoding() const { SDValue TargetLowering::getPICJumpTableRelocBase(SDValue Table, SelectionDAG &DAG) const { + // FIXME: Eliminate usesGlobalOffsetTable() in favor of JTEntryKind. if (usesGlobalOffsetTable()) return DAG.getGLOBAL_OFFSET_TABLE(getPointerTy()); return Table; @@ -824,10 +826,10 @@ const MCExpr * TargetLowering::getPICJumpTableRelocBaseExpr(const MachineJumpTableInfo *MJTI, unsigned JTI, MCContext &Ctx) const { - assert(0 && "FIXME: IMPLEMENT ME"); + // The normal PIC reloc base is the label at the start of the jump table. + return MCSymbolRefExpr::Create(MJTI->getJTISymbol(JTI, Ctx), Ctx); } - bool TargetLowering::isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const { // Assume that everything is safe in static mode. |