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 | 978b977ac6a900c6645201b9bd346bdfd5687274 (patch) | |
| tree | e63ff6ede38987fd5319fe7214f6d9fee5c9eefd /lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
| parent | 9f5b9c18ef28e8b61bf04bba0470933d25c05830 (diff) | |
| download | external_llvm-978b977ac6a900c6645201b9bd346bdfd5687274.zip external_llvm-978b977ac6a900c6645201b9bd346bdfd5687274.tar.gz external_llvm-978b977ac6a900c6645201b9bd346bdfd5687274.tar.bz2 | |
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 34a3178..ccdedde 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. |
