Clean up the formatting and doxygen for the simple inliner a bit. No
authorChandler Carruth <chandlerc@gmail.com>
Mon, 21 Jan 2013 11:39:14 +0000 (11:39 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 21 Jan 2013 11:39:14 +0000 (11:39 +0000)
functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173028 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/InlineSimple.cpp

index 9682923d20de3d15af53a443e5c600ed6d82d2b9..b6a4e3725f691fc7bf4334984834cd0f8481171f 100644 (file)
@@ -28,24 +28,35 @@ using namespace llvm;
 
 namespace {
 
-  class SimpleInliner : public Inliner {
-    InlineCostAnalyzer CA;
-  public:
-    SimpleInliner() : Inliner(ID) {
-      initializeSimpleInlinerPass(*PassRegistry::getPassRegistry());
-    }
-    SimpleInliner(int Threshold) : Inliner(ID, Threshold,
-                                           /*InsertLifetime*/true) {
-      initializeSimpleInlinerPass(*PassRegistry::getPassRegistry());
-    }
-    static char ID; // Pass identification, replacement for typeid
-    InlineCost getInlineCost(CallSite CS) {
-      return CA.getInlineCost(CS, getInlineThreshold(CS));
-    }
-    using llvm::Pass::doInitialization;
-    virtual bool doInitialization(CallGraph &CG);
-  };
-}
+/// \brief Actaul inliner pass implementation.
+///
+/// The common implementation of the inlining logic is shared between this
+/// inliner pass and the always inliner pass. The two passes use different cost
+/// analyses to determine when to inline.
+class SimpleInliner : public Inliner {
+  InlineCostAnalyzer CA;
+
+public:
+  SimpleInliner() : Inliner(ID) {
+    initializeSimpleInlinerPass(*PassRegistry::getPassRegistry());
+  }
+
+  SimpleInliner(int Threshold)
+      : Inliner(ID, Threshold, /*InsertLifetime*/ true) {
+    initializeSimpleInlinerPass(*PassRegistry::getPassRegistry());
+  }
+
+  static char ID; // Pass identification, replacement for typeid
+
+  InlineCost getInlineCost(CallSite CS) {
+    return CA.getInlineCost(CS, getInlineThreshold(CS));
+  }
+
+  using llvm::Pass::doInitialization;
+  virtual bool doInitialization(CallGraph &CG);
+};
+
+} // end anonymous namespace
 
 char SimpleInliner::ID = 0;
 INITIALIZE_PASS_BEGIN(SimpleInliner, "inline",