mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-06 04:31:08 +00:00
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:
parent
78e1cdaba3
commit
5a47127c4c
@ -28,24 +28,35 @@ using namespace llvm;
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class SimpleInliner : public Inliner {
|
/// \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;
|
InlineCostAnalyzer CA;
|
||||||
public:
|
|
||||||
|
public:
|
||||||
SimpleInliner() : Inliner(ID) {
|
SimpleInliner() : Inliner(ID) {
|
||||||
initializeSimpleInlinerPass(*PassRegistry::getPassRegistry());
|
initializeSimpleInlinerPass(*PassRegistry::getPassRegistry());
|
||||||
}
|
}
|
||||||
SimpleInliner(int Threshold) : Inliner(ID, Threshold,
|
|
||||||
/*InsertLifetime*/true) {
|
SimpleInliner(int Threshold)
|
||||||
|
: Inliner(ID, Threshold, /*InsertLifetime*/ true) {
|
||||||
initializeSimpleInlinerPass(*PassRegistry::getPassRegistry());
|
initializeSimpleInlinerPass(*PassRegistry::getPassRegistry());
|
||||||
}
|
}
|
||||||
|
|
||||||
static char ID; // Pass identification, replacement for typeid
|
static char ID; // Pass identification, replacement for typeid
|
||||||
|
|
||||||
InlineCost getInlineCost(CallSite CS) {
|
InlineCost getInlineCost(CallSite CS) {
|
||||||
return CA.getInlineCost(CS, getInlineThreshold(CS));
|
return CA.getInlineCost(CS, getInlineThreshold(CS));
|
||||||
}
|
}
|
||||||
|
|
||||||
using llvm::Pass::doInitialization;
|
using llvm::Pass::doInitialization;
|
||||||
virtual bool doInitialization(CallGraph &CG);
|
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",
|
||||||
|
Loading…
Reference in New Issue
Block a user