diff options
author | Dan Gohman <gohman@apple.com> | 2009-07-31 01:52:50 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-07-31 01:52:50 +0000 |
commit | 933c762371fe8cc6e2ef5d00d6866f4924852fed (patch) | |
tree | 7ed04e07511afdbf1ed211a509a0c9314caca84d /include/llvm/CodeGen/MachineFunctionPass.h | |
parent | 376cd007ec2da67bddd15d68623e51a6e122869c (diff) |
Manage MachineFunctions with an analysis Pass instead of the Annotable
mechanism. To support this, make MachineFunctionPass a little more
complete.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77654 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineFunctionPass.h')
-rw-r--r-- | include/llvm/CodeGen/MachineFunctionPass.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/include/llvm/CodeGen/MachineFunctionPass.h b/include/llvm/CodeGen/MachineFunctionPass.h index 6b5e64abc4..6f7c216382 100644 --- a/include/llvm/CodeGen/MachineFunctionPass.h +++ b/include/llvm/CodeGen/MachineFunctionPass.h @@ -24,19 +24,25 @@ namespace llvm { - // FIXME: This pass should declare that the pass does not invalidate any LLVM - // passes. -struct MachineFunctionPass : public FunctionPass { +/// MachineFunctionPass - This class adapts the FunctionPass interface to +/// allow convenient creation of passes that operate on the MachineFunction +/// representation. Instead of overriding runOnFunction, subclasses +/// override runOnMachineFunction. +class MachineFunctionPass : public FunctionPass { +protected: explicit MachineFunctionPass(intptr_t ID) : FunctionPass(ID) {} explicit MachineFunctionPass(void *ID) : FunctionPass(ID) {} -protected: /// runOnMachineFunction - This method must be overloaded to perform the /// desired machine code transformation or analysis. /// virtual bool runOnMachineFunction(MachineFunction &MF) = 0; -public: + /// getAnalysisUsage - Subclasses that override getAnalysisUsage + /// must call this. + virtual void getAnalysisUsage(AnalysisUsage &AU) const; + +private: bool runOnFunction(Function &F); }; |