[llvm] r187050 - TRE: Move class into anonymous namespace.

Benjamin Kramer benny.kra at googlemail.com
Wed Jul 24 09:12:08 PDT 2013


Author: d0k
Date: Wed Jul 24 11:12:08 2013
New Revision: 187050

URL: http://llvm.org/viewvc/llvm-project?rev=187050&view=rev
Log:
TRE: Move class into anonymous namespace.

While there shrink a dangerously large SmallPtrSet.

Modified:
    llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp?rev=187050&r1=187049&r2=187050&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp Wed Jul 24 11:12:08 2013
@@ -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 Cap
   }
 
   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





More information about the llvm-commits mailing list