diff options
author | Alkis Evlogimenos <alkis@evlogimenos.com> | 2003-12-18 22:40:24 +0000 |
---|---|---|
committer | Alkis Evlogimenos <alkis@evlogimenos.com> | 2003-12-18 22:40:24 +0000 |
commit | 4c080863de86448d905beab27686da823b6d44c1 (patch) | |
tree | 62e104baee7dd17b6f324af45a95d7bdabd07ec9 /lib/CodeGen/TwoAddressInstructionPass.cpp | |
parent | 78cb3f218ae2b6e7200e81a21642fd2d269e46c7 (diff) | |
download | external_llvm-4c080863de86448d905beab27686da823b6d44c1.zip external_llvm-4c080863de86448d905beab27686da823b6d44c1.tar.gz external_llvm-4c080863de86448d905beab27686da823b6d44c1.tar.bz2 |
Remove TwoAddressInstruction from the public headers and add an ID
instead, since this pass doesn't expose any state to its users.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10520 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TwoAddressInstructionPass.cpp')
-rw-r--r-- | lib/CodeGen/TwoAddressInstructionPass.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp index 0716ca9..7bd3f04 100644 --- a/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -16,7 +16,6 @@ //===----------------------------------------------------------------------===// #define DEBUG_TYPE "twoaddrinstr" -#include "llvm/CodeGen/TwoAddressInstructionPass.h" #include "llvm/Function.h" #include "llvm/CodeGen/LiveVariables.h" #include "llvm/CodeGen/MachineFrameInfo.h" @@ -36,7 +35,23 @@ using namespace llvm; namespace { - RegisterAnalysis<TwoAddressInstructionPass> X( + class TwoAddressInstructionPass : public MachineFunctionPass + { + private: + MachineFunction* mf_; + const TargetMachine* tm_; + const MRegisterInfo* mri_; + LiveVariables* lv_; + + public: + virtual void getAnalysisUsage(AnalysisUsage &AU) const; + + private: + /// runOnMachineFunction - pass entry point + bool runOnMachineFunction(MachineFunction&); + }; + + RegisterPass<TwoAddressInstructionPass> X( "twoaddressinstruction", "Two-Address instruction pass"); Statistic<> numTwoAddressInstrs("twoaddressinstruction", @@ -45,6 +60,8 @@ namespace { "Number of instructions added"); }; +const PassInfo *llvm::TwoAddressInstructionPassID = X.getPassInfo(); + void TwoAddressInstructionPass::getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved<LiveVariables>(); |