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
This commit is contained in:
Chandler Carruth 2013-01-21 11:39:14 +00:00
parent 78e1cdaba3
commit 5a47127c4c

View File

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