Clean up the use of static and anonymous namespaces. This turned up
[oota-llvm.git] / lib / Transforms / IPO / InlineSimple.cpp
index d72edf84805ee0707f441ad504f95314823c7cc0..63a4798cce1dc933cc00b5fdcd1188bb4eea8b78 100644 (file)
@@ -35,18 +35,28 @@ namespace {
     InlineCostAnalyzer CA;
   public:
     SimpleInliner() : Inliner(&ID) {}
+    SimpleInliner(int Threshold) : Inliner(&ID, Threshold) {}
     static char ID; // Pass identification, replacement for typeid
     int getInlineCost(CallSite CS) {
       return CA.getInlineCost(CS, NeverInline);
     }
+    float getInlineFudgeFactor(CallSite CS) {
+      return CA.getInlineFudgeFactor(CS);
+    }
     virtual bool doInitialization(CallGraph &CG);
   };
-  char SimpleInliner::ID = 0;
-  RegisterPass<SimpleInliner> X("inline", "Function Integration/Inlining");
 }
 
+char SimpleInliner::ID = 0;
+static RegisterPass<SimpleInliner>
+X("inline", "Function Integration/Inlining");
+
 Pass *llvm::createFunctionInliningPass() { return new SimpleInliner(); }
 
+Pass *llvm::createFunctionInliningPass(int Threshold) { 
+  return new SimpleInliner(Threshold);
+}
+
 // doInitialization - Initializes the vector of functions that have been
 // annotated with the noinline attribute.
 bool SimpleInliner::doInitialization(CallGraph &CG) {