X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTransforms%2FScalar%2FTailRecursionElimination.cpp;h=9fb8ddc3d2c1c15475efd0cb73cb66e36c70c8cf;hb=6a565e5be6c3daa69a32d2cf879df8699c7e0f88;hp=9de138892143725c1aa086c96bbcef0bd937fbba;hpb=a0ec3f9b7b826b9b40b80199923b664bad808cce;p=oota-llvm.git diff --git a/lib/Transforms/Scalar/TailRecursionElimination.cpp b/lib/Transforms/Scalar/TailRecursionElimination.cpp index 9de13889214..9fb8ddc3d2c 100644 --- a/lib/Transforms/Scalar/TailRecursionElimination.cpp +++ b/lib/Transforms/Scalar/TailRecursionElimination.cpp @@ -145,19 +145,20 @@ static bool CanTRE(AllocaInst *AI) { isa(AI->getArraySize()); } +namespace { struct AllocaCaptureTracker : public CaptureTracker { AllocaCaptureTracker() : Captured(false) {} - void tooManyUses() { Captured = true; } + void tooManyUses() LLVM_OVERRIDE { Captured = true; } - bool shouldExplore(Use *U) { + bool shouldExplore(Use *U) LLVM_OVERRIDE { Value *V = U->getUser(); if (isa(V) || isa(V)) UsesAlloca.insert(V); return true; } - bool captured(Use *U) { + bool captured(Use *U) LLVM_OVERRIDE { if (isa(U->getUser())) return false; Captured = true; @@ -165,8 +166,9 @@ struct AllocaCaptureTracker : public CaptureTracker { } bool Captured; - SmallPtrSet UsesAlloca; + SmallPtrSet UsesAlloca; }; +} // end anonymous namespace bool TailCallElim::runOnFunction(Function &F) { // If this function is a varargs function, we won't be able to PHI the args