mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-14 17:34:41 +00:00
moves doInitialization and doFinalization to the Pass class and removes some unreachable code in MachineModuleInfo
reviewed by Evan Cheng <evan.cheng@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169164 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f7e78487de
commit
49eb628c21
@ -39,6 +39,9 @@ public:
|
||||
// whatever action is necessary for the specified Loop.
|
||||
virtual bool runOnLoop(Loop *L, LPPassManager &LPM) = 0;
|
||||
|
||||
using llvm::Pass::doInitialization;
|
||||
using llvm::Pass::doFinalization;
|
||||
|
||||
// Initialization and finalization hooks.
|
||||
virtual bool doInitialization(Loop *L, LPPassManager &LPM) {
|
||||
return false;
|
||||
|
@ -57,6 +57,9 @@ public:
|
||||
/// @return The pass to print the LLVM IR in the region.
|
||||
Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
|
||||
|
||||
using llvm::Pass::doInitialization;
|
||||
using llvm::Pass::doFinalization;
|
||||
|
||||
virtual bool doInitialization(Region *R, RGPassManager &RGM) { return false; }
|
||||
virtual bool doFinalization() { return false; }
|
||||
//@}
|
||||
|
@ -39,6 +39,9 @@ public:
|
||||
/// corresponding to a CallGraph.
|
||||
Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
|
||||
|
||||
using llvm::Pass::doInitialization;
|
||||
using llvm::Pass::doFinalization;
|
||||
|
||||
/// doInitialization - This method is called before the SCC's of the program
|
||||
/// has been processed, allowing the pass to do initialization as necessary.
|
||||
virtual bool doInitialization(CallGraph &CG) {
|
||||
|
@ -180,12 +180,6 @@ public:
|
||||
const MCObjectFileInfo *MOFI);
|
||||
~MachineModuleInfo();
|
||||
|
||||
using ModulePass::doInitialization;
|
||||
bool doInitialization();
|
||||
|
||||
using ModulePass::doFinalization;
|
||||
bool doFinalization();
|
||||
|
||||
/// EndFunction - Discard function meta information.
|
||||
///
|
||||
void EndFunction();
|
||||
|
@ -104,6 +104,16 @@ public:
|
||||
return PassID;
|
||||
}
|
||||
|
||||
/// doInitialization - Virtual method overridden by subclasses to do
|
||||
/// any necessary initialization before any pass is run.
|
||||
///
|
||||
virtual bool doInitialization(Module &) { return false; }
|
||||
|
||||
/// doFinalization - Virtual method overriden by subclasses to do any
|
||||
/// necessary clean up after all passes have run.
|
||||
///
|
||||
virtual bool doFinalization(Module &) { return false; }
|
||||
|
||||
/// print - Print out the internal state of the pass. This is called by
|
||||
/// Analyze to print out the contents of an analysis. Otherwise it is not
|
||||
/// necessary to implement this method. Beware that the module pointer MAY be
|
||||
@ -227,20 +237,10 @@ public:
|
||||
/// createPrinterPass - Get a module printer pass.
|
||||
Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
|
||||
|
||||
/// doInitialization - Virtual method overridden by subclasses to do
|
||||
/// any necessary initialization before any pass is run.
|
||||
///
|
||||
virtual bool doInitialization(Module &) { return false; }
|
||||
|
||||
/// runOnModule - Virtual method overriden by subclasses to process the module
|
||||
/// being operated on.
|
||||
virtual bool runOnModule(Module &M) = 0;
|
||||
|
||||
/// doFinalization - Virtual method overriden by subclasses to do any
|
||||
/// necessary clean up after all passes have run.
|
||||
///
|
||||
virtual bool doFinalization(Module &) { return false; }
|
||||
|
||||
virtual void assignPassManager(PMStack &PMS,
|
||||
PassManagerType T);
|
||||
|
||||
@ -297,21 +297,11 @@ public:
|
||||
/// createPrinterPass - Get a function printer pass.
|
||||
Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
|
||||
|
||||
/// doInitialization - Virtual method overridden by subclasses to do
|
||||
/// any necessary per-module initialization.
|
||||
///
|
||||
virtual bool doInitialization(Module &);
|
||||
|
||||
/// runOnFunction - Virtual method overriden by subclasses to do the
|
||||
/// per-function processing of the pass.
|
||||
///
|
||||
virtual bool runOnFunction(Function &F) = 0;
|
||||
|
||||
/// doFinalization - Virtual method overriden by subclasses to do any post
|
||||
/// processing needed after all passes have run.
|
||||
///
|
||||
virtual bool doFinalization(Module &);
|
||||
|
||||
virtual void assignPassManager(PMStack &PMS,
|
||||
PassManagerType T);
|
||||
|
||||
@ -338,10 +328,8 @@ public:
|
||||
/// createPrinterPass - Get a basic block printer pass.
|
||||
Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
|
||||
|
||||
/// doInitialization - Virtual method overridden by subclasses to do
|
||||
/// any necessary per-module initialization.
|
||||
///
|
||||
virtual bool doInitialization(Module &);
|
||||
using llvm::Pass::doInitialization;
|
||||
using llvm::Pass::doFinalization;
|
||||
|
||||
/// doInitialization - Virtual method overridden by BasicBlockPass subclasses
|
||||
/// to do any necessary per-function initialization.
|
||||
@ -358,11 +346,6 @@ public:
|
||||
///
|
||||
virtual bool doFinalization(Function &);
|
||||
|
||||
/// doFinalization - Virtual method overriden by subclasses to do any post
|
||||
/// processing needed after all passes have run.
|
||||
///
|
||||
virtual bool doFinalization(Module &);
|
||||
|
||||
virtual void assignPassManager(PMStack &PMS,
|
||||
PassManagerType T);
|
||||
|
||||
|
@ -281,21 +281,6 @@ MachineModuleInfo::~MachineModuleInfo() {
|
||||
AddrLabelSymbols = 0;
|
||||
}
|
||||
|
||||
/// doInitialization - Initialize the state for a new module.
|
||||
///
|
||||
bool MachineModuleInfo::doInitialization() {
|
||||
assert(AddrLabelSymbols == 0 && "Improperly initialized");
|
||||
return false;
|
||||
}
|
||||
|
||||
/// doFinalization - Tear down the state after completion of a module.
|
||||
///
|
||||
bool MachineModuleInfo::doFinalization() {
|
||||
delete AddrLabelSymbols;
|
||||
AddrLabelSymbols = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// EndFunction - Discard function meta information.
|
||||
///
|
||||
void MachineModuleInfo::EndFunction() {
|
||||
|
@ -133,16 +133,6 @@ Pass *FunctionPass::createPrinterPass(raw_ostream &O,
|
||||
return createPrintFunctionPass(Banner, &O);
|
||||
}
|
||||
|
||||
bool FunctionPass::doInitialization(Module &) {
|
||||
// By default, don't do anything.
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FunctionPass::doFinalization(Module &) {
|
||||
// By default, don't do anything.
|
||||
return false;
|
||||
}
|
||||
|
||||
PassManagerType FunctionPass::getPotentialPassManagerType() const {
|
||||
return PMT_FunctionPassManager;
|
||||
}
|
||||
@ -157,11 +147,6 @@ Pass *BasicBlockPass::createPrinterPass(raw_ostream &O,
|
||||
llvm_unreachable("BasicBlockPass printing unsupported.");
|
||||
}
|
||||
|
||||
bool BasicBlockPass::doInitialization(Module &) {
|
||||
// By default, don't do anything.
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BasicBlockPass::doInitialization(Function &) {
|
||||
// By default, don't do anything.
|
||||
return false;
|
||||
@ -172,11 +157,6 @@ bool BasicBlockPass::doFinalization(Function &) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BasicBlockPass::doFinalization(Module &) {
|
||||
// By default, don't do anything.
|
||||
return false;
|
||||
}
|
||||
|
||||
PassManagerType BasicBlockPass::getPotentialPassManagerType() const {
|
||||
return PMT_BasicBlockPassManager;
|
||||
}
|
||||
|
@ -309,6 +309,9 @@ public:
|
||||
/// whether any of the passes modifies the module, and if so, return true.
|
||||
bool runOnModule(Module &M);
|
||||
|
||||
using llvm::Pass::doInitialization;
|
||||
using llvm::Pass::doFinalization;
|
||||
|
||||
/// doInitialization - Run all of the initializers for the module passes.
|
||||
///
|
||||
bool doInitialization();
|
||||
@ -402,6 +405,9 @@ public:
|
||||
/// whether any of the passes modifies the module, and if so, return true.
|
||||
bool run(Module &M);
|
||||
|
||||
using llvm::Pass::doInitialization;
|
||||
using llvm::Pass::doFinalization;
|
||||
|
||||
/// doInitialization - Run all of the initializers for the module passes.
|
||||
///
|
||||
bool doInitialization();
|
||||
|
Loading…
x
Reference in New Issue
Block a user