diff options
author | Juergen Ributzka <juergen@apple.com> | 2014-07-11 20:50:47 +0000 |
---|---|---|
committer | Juergen Ributzka <juergen@apple.com> | 2014-07-11 20:50:47 +0000 |
commit | 4ce9863d0bc423bb4616e6ca14337e6c900339b8 (patch) | |
tree | 485fbf71f2935bd6cc2e13d69db24b662f4023c1 /llvm/lib/CodeGen/Analysis.cpp | |
parent | 5dd32136b9a422348918ef5b12ea8420ad4cb907 (diff) | |
download | bcm5719-llvm-4ce9863d0bc423bb4616e6ca14337e6c900339b8.tar.gz bcm5719-llvm-4ce9863d0bc423bb4616e6ca14337e6c900339b8.zip |
[FastISel] Make isInTailCallPosition independent of SelectionDAG.
Break out the arguemnts required from SelectionDAG, so that this function can
also be used by FastISel.
llvm-svn: 212844
Diffstat (limited to 'llvm/lib/CodeGen/Analysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/Analysis.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/Analysis.cpp b/llvm/lib/CodeGen/Analysis.cpp index 1bdf312e46c..3740d03b62d 100644 --- a/llvm/lib/CodeGen/Analysis.cpp +++ b/llvm/lib/CodeGen/Analysis.cpp @@ -475,7 +475,8 @@ static bool nextRealType(SmallVectorImpl<CompositeType *> &SubTypes, /// between it and the return. /// /// This function only tests target-independent requirements. -bool llvm::isInTailCallPosition(ImmutableCallSite CS, const SelectionDAG &DAG) { +bool llvm::isInTailCallPosition(ImmutableCallSite CS, const TargetMachine &TM, + const TargetLoweringBase &TLI) { const Instruction *I = CS.getInstruction(); const BasicBlock *ExitBB = I->getParent(); const TerminatorInst *Term = ExitBB->getTerminator(); @@ -490,8 +491,7 @@ bool llvm::isInTailCallPosition(ImmutableCallSite CS, const SelectionDAG &DAG) { // longjmp on x86), it can end up causing miscompilation that has not // been fully understood. if (!Ret && - (!DAG.getTarget().Options.GuaranteedTailCallOpt || - !isa<UnreachableInst>(Term))) + (!TM.Options.GuaranteedTailCallOpt || !isa<UnreachableInst>(Term))) return false; // If I will have a chain, make sure no other instruction that will have a @@ -509,8 +509,7 @@ bool llvm::isInTailCallPosition(ImmutableCallSite CS, const SelectionDAG &DAG) { return false; } - return returnTypeIsEligibleForTailCall(ExitBB->getParent(), I, Ret, - *DAG.getTarget().getTargetLowering()); + return returnTypeIsEligibleForTailCall(ExitBB->getParent(), I, Ret, TLI); } bool llvm::returnTypeIsEligibleForTailCall(const Function *F, |