mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-23 15:29:51 +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 {
|
||||
|
||||
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",
|
||||
|
Loading…
Reference in New Issue
Block a user