diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2013-01-21 11:39:16 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2013-01-21 11:39:16 +0000 |
commit | 7e88e744479ebd8121741460bfbac2e541756d1c (patch) | |
tree | 590b3c46ab9e5aa4dc917765304dfe8b5d52623b /llvm/lib/Transforms | |
parent | 0df3e5310c7ed389a698fcd1a1721992bcfbd325 (diff) | |
download | bcm5719-llvm-7e88e744479ebd8121741460bfbac2e541756d1c.tar.gz bcm5719-llvm-7e88e744479ebd8121741460bfbac2e541756d1c.zip |
Formatting and comment fixes to the always inliner.
Formatting fixes brought to you by clang-format.
llvm-svn: 173029
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/IPO/InlineAlways.cpp | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/llvm/lib/Transforms/IPO/InlineAlways.cpp b/llvm/lib/Transforms/IPO/InlineAlways.cpp index 29718034b41..5937fab472b 100644 --- a/llvm/lib/Transforms/IPO/InlineAlways.cpp +++ b/llvm/lib/Transforms/IPO/InlineAlways.cpp @@ -30,29 +30,34 @@ using namespace llvm; namespace { - // AlwaysInliner only inlines functions that are mark as "always inline". - class AlwaysInliner : public Inliner { - InlineCostAnalyzer CA; - public: - // Use extremely low threshold. - AlwaysInliner() : Inliner(ID, -2000000000, /*InsertLifetime*/true) { - initializeAlwaysInlinerPass(*PassRegistry::getPassRegistry()); - } - AlwaysInliner(bool InsertLifetime) : Inliner(ID, -2000000000, - InsertLifetime) { - initializeAlwaysInlinerPass(*PassRegistry::getPassRegistry()); - } - static char ID; // Pass identification, replacement for typeid - virtual InlineCost getInlineCost(CallSite CS); - - using llvm::Pass::doInitialization; - using llvm::Pass::doFinalization; - - virtual bool doFinalization(CallGraph &CG) { - return removeDeadFunctions(CG, /*AlwaysInlineOnly=*/true); - } - virtual bool doInitialization(CallGraph &CG); - }; +/// \brief Inliner pass which only handles "always inline" functions. +class AlwaysInliner : public Inliner { + InlineCostAnalyzer CA; + +public: + // Use extremely low threshold. + AlwaysInliner() : Inliner(ID, -2000000000, /*InsertLifetime*/ true) { + initializeAlwaysInlinerPass(*PassRegistry::getPassRegistry()); + } + + AlwaysInliner(bool InsertLifetime) + : Inliner(ID, -2000000000, InsertLifetime) { + initializeAlwaysInlinerPass(*PassRegistry::getPassRegistry()); + } + + static char ID; // Pass identification, replacement for typeid + + virtual InlineCost getInlineCost(CallSite CS); + + using llvm::Pass::doFinalization; + virtual bool doFinalization(CallGraph &CG) { + return removeDeadFunctions(CG, /*AlwaysInlineOnly=*/ true); + } + + using llvm::Pass::doInitialization; + virtual bool doInitialization(CallGraph &CG); +}; + } char AlwaysInliner::ID = 0; @@ -95,8 +100,6 @@ InlineCost AlwaysInliner::getInlineCost(CallSite CS) { return InlineCost::getNever(); } -// doInitialization - Initializes the vector of functions that have not -// been annotated with the "always inline" attribute. bool AlwaysInliner::doInitialization(CallGraph &CG) { CA.setDataLayout(getAnalysisIfAvailable<DataLayout>()); return false; |