Add a clear() method to PriorityQueue.
[oota-llvm.git] / lib / Transforms / IPO / InlineSimple.cpp
index ebd8a595f21eb924fcb6b4163ca95c19bd5034be..63a4798cce1dc933cc00b5fdcd1188bb4eea8b78 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -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) {