summaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-07-24 16:12:08 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-07-24 16:12:08 +0000
commit6a565e5be6c3daa69a32d2cf879df8699c7e0f88 (patch)
tree2ceef4bee2770caf7103cc662deb2d7d5153f27e /lib/Transforms
parent3a0a4d0c5c4561ba397d03bdce00c88d5e6bdb87 (diff)
downloadllvm-6a565e5be6c3daa69a32d2cf879df8699c7e0f88.tar.gz
llvm-6a565e5be6c3daa69a32d2cf879df8699c7e0f88.tar.bz2
llvm-6a565e5be6c3daa69a32d2cf879df8699c7e0f88.tar.xz
TRE: Move class into anonymous namespace.
While there shrink a dangerously large SmallPtrSet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187050 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/TailRecursionElimination.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/TailRecursionElimination.cpp b/lib/Transforms/Scalar/TailRecursionElimination.cpp
index 9de1388921..9fb8ddc3d2 100644
--- a/lib/Transforms/Scalar/TailRecursionElimination.cpp
+++ b/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