diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2016-06-26 22:13:55 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2016-06-26 22:13:55 +0000 |
commit | 73b2bb0c65a69efe10930d227025005b8c819642 (patch) | |
tree | 9ea1d92e4750af9afb522673f0cfb9d7f67e5072 | |
parent | 9200e60f15c16aff1666782186f2070cfb8316ae (diff) |
Refactor a duplicated predicate. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273826 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Target/TargetLowering.h | 2 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/TargetLowering.cpp | 4 | ||||
-rw-r--r-- | lib/Target/ARM/ARMISelLowering.cpp | 4 | ||||
-rw-r--r-- | lib/Target/ARM/ARMISelLowering.h | 1 | ||||
-rw-r--r-- | lib/Target/X86/X86ISelLowering.cpp | 4 | ||||
-rw-r--r-- | lib/Target/X86/X86ISelLowering.h | 1 |
6 files changed, 6 insertions, 10 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index 4de8017237c..ee988547450 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -2176,6 +2176,8 @@ public: /// NOTE: The TargetMachine owns TLOF. explicit TargetLowering(const TargetMachine &TM); + bool isPositionIndependent() const; + /// Returns true by value, base pointer and offset pointer and addressing mode /// by reference if the node's address can be legally represented as /// pre-indexed load / store address. diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index dc7bb7ca817..5f091c88375 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -44,6 +44,10 @@ const char *TargetLowering::getTargetNodeName(unsigned Opcode) const { return nullptr; } +bool TargetLowering::isPositionIndependent() const { + return getTargetMachine().getRelocationModel() == Reloc::PIC_; +} + /// Check whether a given call node is in tail position within its function. If /// so, it sets Chain to the input chain of the tail call. bool TargetLowering::isInTailCallPosition(SelectionDAG &DAG, SDNode *Node, diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp index a7d986e09ef..dd7f5218bd5 100644 --- a/lib/Target/ARM/ARMISelLowering.cpp +++ b/lib/Target/ARM/ARMISelLowering.cpp @@ -1569,10 +1569,6 @@ void ARMTargetLowering::PassF64ArgInRegs(const SDLoc &dl, SelectionDAG &DAG, } } -bool ARMTargetLowering::isPositionIndependent() const { - return getTargetMachine().getRelocationModel() == Reloc::PIC_; -} - /// LowerCall - Lowering a call into a callseq_start <- /// ARMISD:CALL <- callseq_end chain. Also add input and output parameter /// nodes. diff --git a/lib/Target/ARM/ARMISelLowering.h b/lib/Target/ARM/ARMISelLowering.h index af8b3fb006e..94f8e6c8ae3 100644 --- a/lib/Target/ARM/ARMISelLowering.h +++ b/lib/Target/ARM/ARMISelLowering.h @@ -230,7 +230,6 @@ namespace llvm { explicit ARMTargetLowering(const TargetMachine &TM, const ARMSubtarget &STI); - bool isPositionIndependent() const; unsigned getJumpTableEncoding() const override; bool useSoftFloat() const override; diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 10d525a43ae..ebd7fa619f7 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -12978,10 +12978,6 @@ static SDValue LowerToTLSExecModel(GlobalAddressSDNode *GA, SelectionDAG &DAG, return DAG.getNode(ISD::ADD, dl, PtrVT, ThreadPointer, Offset); } -bool X86TargetLowering::isPositionIndependent() const { - return getTargetMachine().getRelocationModel() == Reloc::PIC_; -} - SDValue X86TargetLowering::LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const { diff --git a/lib/Target/X86/X86ISelLowering.h b/lib/Target/X86/X86ISelLowering.h index 6cb858709d3..af7c270c7f2 100644 --- a/lib/Target/X86/X86ISelLowering.h +++ b/lib/Target/X86/X86ISelLowering.h @@ -656,7 +656,6 @@ namespace llvm { // X86 Implementation of the TargetLowering interface class X86TargetLowering final : public TargetLowering { public: - bool isPositionIndependent() const; explicit X86TargetLowering(const X86TargetMachine &TM, const X86Subtarget &STI); |