diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2013-01-21 11:39:14 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2013-01-21 11:39:14 +0000 |
commit | 5a47127c4c1aeed8a4caac5bcd25301eb69bd461 (patch) | |
tree | 6174b0ffbd04413c97e9d8c4464951089883dac4 | |
parent | 78e1cdaba3cad6e85ff631542052bbb718c7e588 (diff) | |
download | llvm-5a47127c4c1aeed8a4caac5bcd25301eb69bd461.tar.gz llvm-5a47127c4c1aeed8a4caac5bcd25301eb69bd461.tar.bz2 llvm-5a47127c4c1aeed8a4caac5bcd25301eb69bd461.tar.xz |
Clean up the formatting and doxygen for the simple inliner a bit. No
functionality changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173028 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/IPO/InlineSimple.cpp | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/lib/Transforms/IPO/InlineSimple.cpp b/lib/Transforms/IPO/InlineSimple.cpp index 9682923d20..b6a4e3725f 100644 --- a/lib/Transforms/IPO/InlineSimple.cpp +++ b/lib/Transforms/IPO/InlineSimple.cpp @@ -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", |