diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-07-24 16:12:08 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-07-24 16:12:08 +0000 |
| commit | 328da33d19837bdd113f8525ffce070f6ec10153 (patch) | |
| tree | 892ea1dc4d44e76da1ef3e622ea19ab4f3346409 /llvm/lib/Transforms/Scalar | |
| parent | db5a0a5818750ebcd075ee2b3f56c87447c0c411 (diff) | |
| download | bcm5719-llvm-328da33d19837bdd113f8525ffce070f6ec10153.tar.gz bcm5719-llvm-328da33d19837bdd113f8525ffce070f6ec10153.zip | |
TRE: Move class into anonymous namespace.
While there shrink a dangerously large SmallPtrSet.
llvm-svn: 187050
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp index 9de13889214..9fb8ddc3d2c 100644 --- a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp +++ b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp @@ -145,19 +145,20 @@ static bool CanTRE(AllocaInst *AI) { isa<ConstantInt>(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<CallInst>(V) || isa<InvokeInst>(V)) UsesAlloca.insert(V); return true; } - bool captured(Use *U) { + bool captured(Use *U) LLVM_OVERRIDE { if (isa<ReturnInst>(U->getUser())) return false; Captured = true; @@ -165,8 +166,9 @@ struct AllocaCaptureTracker : public CaptureTracker { } bool Captured; - SmallPtrSet<const Value *, 64> UsesAlloca; + SmallPtrSet<const Value *, 16> 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 |

