diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2016-06-28 20:13:36 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2016-06-28 20:13:36 +0000 |
| commit | b1556c42ced74d34c0178e19dd8b0b046862beee (patch) | |
| tree | 4ddb5921951e59462d352a27d1809c3cf5536004 /llvm/lib/CodeGen | |
| parent | 2012d744f49715ff6a3eea5c63e722e11e8674e9 (diff) | |
| download | bcm5719-llvm-b1556c42ced74d34c0178e19dd8b0b046862beee.tar.gz bcm5719-llvm-b1556c42ced74d34c0178e19dd8b0b046862beee.zip | |
Use isPositionIndependent in a few more places.
I think this converts all the simple cases that really just care about
the generated code being position independent or not. The remaining
uses are a bit more complicated and are checking things like "is this
a library or executable" or "can this symbol be preempted".
llvm-svn: 274055
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 37099c468cb..a355e09824e 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -125,7 +125,7 @@ AsmPrinter::~AsmPrinter() { } bool AsmPrinter::isPositionIndependent() const { - return TM.getRelocationModel() == Reloc::PIC_; + return TM.isPositionIndependent(); } /// getFunctionNumber - Return a unique ID for the current function. diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index ac68bcdb426..cb3224bfb43 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -3510,7 +3510,7 @@ bool SelectionDAGLegalize::ExpandNode(SDNode *Node) { MachinePointerInfo::getJumpTable(DAG.getMachineFunction()), MemVT, false, false, false, 0); Addr = LD; - if (TM.getRelocationModel() == Reloc::PIC_) { + if (TM.isPositionIndependent()) { // For PIC, the sequence is: // BRIND(load(Jumptable + index) + RelocBase) // RelocBase can be JumpTable, GOT or some sort of global base. diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 10dcb0a266d..184f0805692 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -45,7 +45,7 @@ const char *TargetLowering::getTargetNodeName(unsigned Opcode) const { } bool TargetLowering::isPositionIndependent() const { - return getTargetMachine().getRelocationModel() == Reloc::PIC_; + return getTargetMachine().isPositionIndependent(); } /// Check whether a given call node is in tail position within its function. If |

