diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-05-27 20:26:41 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-05-27 20:26:41 +0000 | 
| commit | ff0cc061ecf297f1556e906d229826fd709f37d6 (patch) | |
| tree | bd13a22d9db57ccf3eddbc07b32c18109521d050 /contrib/llvm/lib/CodeGen/Analysis.cpp | |
| parent | e14ba20ace4c6ab45aca5130defd992ab7d6bf5f (diff) | |
| parent | 5a5ac124e1efaf208671f01c46edb15f29ed2a0b (diff) | |
Notes
Diffstat (limited to 'contrib/llvm/lib/CodeGen/Analysis.cpp')
| -rw-r--r-- | contrib/llvm/lib/CodeGen/Analysis.cpp | 16 | 
1 files changed, 7 insertions, 9 deletions
diff --git a/contrib/llvm/lib/CodeGen/Analysis.cpp b/contrib/llvm/lib/CodeGen/Analysis.cpp index 2e8af9eb0048..3224fac25cb4 100644 --- a/contrib/llvm/lib/CodeGen/Analysis.cpp +++ b/contrib/llvm/lib/CodeGen/Analysis.cpp @@ -295,8 +295,8 @@ static const Value *getNoopInput(const Value *V,      } else if (const InsertValueInst *IVI = dyn_cast<InsertValueInst>(V)) {        // Value may come from either the aggregate or the scalar        ArrayRef<unsigned> InsertLoc = IVI->getIndices(); -      if (std::equal(InsertLoc.rbegin(), InsertLoc.rend(), -                     ValLoc.rbegin())) { +      if (ValLoc.size() >= InsertLoc.size() && +          std::equal(InsertLoc.begin(), InsertLoc.end(), ValLoc.rbegin())) {          // The type being inserted is a nested sub-type of the aggregate; we          // have to remove those initial indices to get the location we're          // interested in for the operand. @@ -312,8 +312,7 @@ static const Value *getNoopInput(const Value *V,        // previous aggregate. Combine the two paths to obtain the true address of        // our element.        ArrayRef<unsigned> ExtractLoc = EVI->getIndices(); -      std::copy(ExtractLoc.rbegin(), ExtractLoc.rend(), -                std::back_inserter(ValLoc)); +      ValLoc.append(ExtractLoc.rbegin(), ExtractLoc.rend());        NoopInput = Op;      }      // Terminate if we couldn't find anything to look through. @@ -518,8 +517,9 @@ bool llvm::isInTailCallPosition(ImmutableCallSite CS, const TargetMachine &TM) {          return false;      } +  const Function *F = ExitBB->getParent();    return returnTypeIsEligibleForTailCall( -      ExitBB->getParent(), I, Ret, *TM.getSubtargetImpl()->getTargetLowering()); +      F, I, Ret, *TM.getSubtargetImpl(*F)->getTargetLowering());  }  bool llvm::returnTypeIsEligibleForTailCall(const Function *F, @@ -600,10 +600,8 @@ bool llvm::returnTypeIsEligibleForTailCall(const Function *F,      // The manipulations performed when we're looking through an insertvalue or      // an extractvalue would happen at the front of the RetPath list, so since      // we have to copy it anyway it's more efficient to create a reversed copy. -    using std::copy; -    SmallVector<unsigned, 4> TmpRetPath, TmpCallPath; -    copy(RetPath.rbegin(), RetPath.rend(), std::back_inserter(TmpRetPath)); -    copy(CallPath.rbegin(), CallPath.rend(), std::back_inserter(TmpCallPath)); +    SmallVector<unsigned, 4> TmpRetPath(RetPath.rbegin(), RetPath.rend()); +    SmallVector<unsigned, 4> TmpCallPath(CallPath.rbegin(), CallPath.rend());      // Finally, we can check whether the value produced by the tail call at this      // index is compatible with the value we return.  | 
