X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=lib%2FTransforms%2FScalar%2FTailRecursionElimination.cpp;h=299b767eaa81a2b17ce778192a6f111612542580;hp=9fb8ddc3d2c1c15475efd0cb73cb66e36c70c8cf;hb=d628f19f5df9e4033adce5af969049e90a90ae5d;hpb=6a565e5be6c3daa69a32d2cf879df8699c7e0f88 diff --git a/lib/Transforms/Scalar/TailRecursionElimination.cpp b/lib/Transforms/Scalar/TailRecursionElimination.cpp index 9fb8ddc3d2c..299b767eaa8 100644 --- a/lib/Transforms/Scalar/TailRecursionElimination.cpp +++ b/lib/Transforms/Scalar/TailRecursionElimination.cpp @@ -149,16 +149,16 @@ namespace { struct AllocaCaptureTracker : public CaptureTracker { AllocaCaptureTracker() : Captured(false) {} - void tooManyUses() LLVM_OVERRIDE { Captured = true; } + void tooManyUses() override { Captured = true; } - bool shouldExplore(Use *U) LLVM_OVERRIDE { + bool shouldExplore(Use *U) override { Value *V = U->getUser(); if (isa(V) || isa(V)) UsesAlloca.insert(V); return true; } - bool captured(Use *U) LLVM_OVERRIDE { + bool captured(Use *U) override { if (isa(U->getUser())) return false; Captured = true; @@ -171,6 +171,9 @@ struct AllocaCaptureTracker : public CaptureTracker { } // end anonymous namespace bool TailCallElim::runOnFunction(Function &F) { + if (skipOptnoneFunction(F)) + return false; + // If this function is a varargs function, we won't be able to PHI the args // right, so don't even try to convert it... if (F.getFunctionType()->isVarArg()) return false; @@ -426,7 +429,7 @@ TailCallElim::FindTRECandidate(Instruction *TI, // lower the call to fabs into inline code. if (BB == &F->getEntryBlock() && FirstNonDbg(BB->front()) == CI && - FirstNonDbg(llvm::next(BB->begin())) == TI && + FirstNonDbg(std::next(BB->begin())) == TI && CI->getCalledFunction() && !TTI->isLoweredToCall(CI->getCalledFunction())) { // A single-block function with just a call and a return. Check that