aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/IPO/InlineSimple.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2013-01-21 11:39:14 +0000
committerChandler Carruth <chandlerc@gmail.com>2013-01-21 11:39:14 +0000
commit0df3e5310c7ed389a698fcd1a1721992bcfbd325 (patch)
treebd0c74f523e493d5330187cb0e0b85e0f3d81539 /llvm/lib/Transforms/IPO/InlineSimple.cpp
parent664e570b59cfd403aecbe6374465f9a6a3f404da (diff)
downloadllvm-0df3e5310c7ed389a698fcd1a1721992bcfbd325.zip
llvm-0df3e5310c7ed389a698fcd1a1721992bcfbd325.tar.gz
llvm-0df3e5310c7ed389a698fcd1a1721992bcfbd325.tar.bz2
Clean up the formatting and doxygen for the simple inliner a bit. No
functionality changed. llvm-svn: 173028
Diffstat (limited to 'llvm/lib/Transforms/IPO/InlineSimple.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/InlineSimple.cpp47
1 files changed, 29 insertions, 18 deletions
diff --git a/llvm/lib/Transforms/IPO/InlineSimple.cpp b/llvm/lib/Transforms/IPO/InlineSimple.cpp
index 9682923..b6a4e37 100644
--- a/llvm/lib/Transforms/IPO/InlineSimple.cpp
+++ b/llvm/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",