Formatting and comment fixes to the always inliner.

Formatting fixes brought to you by clang-format.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173029 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chandler Carruth 2013-01-21 11:39:16 +00:00
parent 5a47127c4c
commit 0378e3916a

View File

@ -30,29 +30,34 @@ using namespace llvm;
namespace { namespace {
// AlwaysInliner only inlines functions that are mark as "always inline". /// \brief Inliner pass which only handles "always inline" functions.
class AlwaysInliner : public Inliner { class AlwaysInliner : public Inliner {
InlineCostAnalyzer CA; InlineCostAnalyzer CA;
public:
public:
// Use extremely low threshold. // Use extremely low threshold.
AlwaysInliner() : Inliner(ID, -2000000000, /*InsertLifetime*/true) { AlwaysInliner() : Inliner(ID, -2000000000, /*InsertLifetime*/ true) {
initializeAlwaysInlinerPass(*PassRegistry::getPassRegistry()); initializeAlwaysInlinerPass(*PassRegistry::getPassRegistry());
} }
AlwaysInliner(bool InsertLifetime) : Inliner(ID, -2000000000,
InsertLifetime) { AlwaysInliner(bool InsertLifetime)
: Inliner(ID, -2000000000, InsertLifetime) {
initializeAlwaysInlinerPass(*PassRegistry::getPassRegistry()); initializeAlwaysInlinerPass(*PassRegistry::getPassRegistry());
} }
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid
virtual InlineCost getInlineCost(CallSite CS); virtual InlineCost getInlineCost(CallSite CS);
using llvm::Pass::doInitialization;
using llvm::Pass::doFinalization; using llvm::Pass::doFinalization;
virtual bool doFinalization(CallGraph &CG) { virtual bool doFinalization(CallGraph &CG) {
return removeDeadFunctions(CG, /*AlwaysInlineOnly=*/true); return removeDeadFunctions(CG, /*AlwaysInlineOnly=*/ true);
} }
using llvm::Pass::doInitialization;
virtual bool doInitialization(CallGraph &CG); virtual bool doInitialization(CallGraph &CG);
}; };
} }
char AlwaysInliner::ID = 0; char AlwaysInliner::ID = 0;
@ -95,8 +100,6 @@ InlineCost AlwaysInliner::getInlineCost(CallSite CS) {
return InlineCost::getNever(); return InlineCost::getNever();
} }
// doInitialization - Initializes the vector of functions that have not
// been annotated with the "always inline" attribute.
bool AlwaysInliner::doInitialization(CallGraph &CG) { bool AlwaysInliner::doInitialization(CallGraph &CG) {
CA.setDataLayout(getAnalysisIfAvailable<DataLayout>()); CA.setDataLayout(getAnalysisIfAvailable<DataLayout>());
return false; return false;