diff options
Diffstat (limited to 'lib/Target/X86/X86ISelLowering.cpp')
-rw-r--r-- | lib/Target/X86/X86ISelLowering.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index e9df3f5337..8c40b3ca70 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -650,6 +650,17 @@ X86TargetLowering::X86TargetLowering(TargetMachine &TM) } +/// getPICJumpTableRelocaBase - Returns relocation base for the given PIC +/// jumptable. +SDOperand X86TargetLowering::getPICJumpTableRelocBase(SDOperand Table, + SelectionDAG &DAG) const { + if (usesGlobalOffsetTable()) + return DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, getPointerTy()); + if (!Subtarget->isPICStyleRIPRel()) + return DAG.getNode(X86ISD::GlobalBaseReg, getPointerTy()); + return Table; +} + //===----------------------------------------------------------------------===// // Return Value Calling Convention Implementation //===----------------------------------------------------------------------===// |