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 | 7139090fd29481bc91db6023d613fd5389ebfcb2 (patch) | |
| tree | 97983535ea4efc5afda562d7d1df4e6e95924b45 /llvm/lib/CodeGen | |
| parent | bbe0f1d7956f8ca3e024c8494f965e44d2280600 (diff) | |
| download | bcm5719-llvm-7139090fd29481bc91db6023d613fd5389ebfcb2.tar.gz bcm5719-llvm-7139090fd29481bc91db6023d613fd5389ebfcb2.zip | |
Remove TwoAddressInstruction from the public headers and add an ID
instead, since this pass doesn't expose any state to its users.
llvm-svn: 10520
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/LiveIntervals.cpp | 3 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/RegAllocLocal.cpp | 3 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | 21 |
3 files changed, 21 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervals.cpp b/llvm/lib/CodeGen/LiveIntervals.cpp index d818d0b7b01..74426d5aadc 100644 --- a/llvm/lib/CodeGen/LiveIntervals.cpp +++ b/llvm/lib/CodeGen/LiveIntervals.cpp @@ -24,7 +24,6 @@ #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/Passes.h" #include "llvm/CodeGen/SSARegMap.h" -#include "llvm/CodeGen/TwoAddressInstructionPass.h" #include "llvm/Target/MRegisterInfo.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" @@ -50,7 +49,7 @@ void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const AU.addRequired<LiveVariables>(); AU.addPreservedID(PHIEliminationID); AU.addRequiredID(PHIEliminationID); - AU.addRequired<TwoAddressInstructionPass>(); + AU.addRequiredID(TwoAddressInstructionPassID); MachineFunctionPass::getAnalysisUsage(AU); } diff --git a/llvm/lib/CodeGen/RegAllocLocal.cpp b/llvm/lib/CodeGen/RegAllocLocal.cpp index d3e80e08e81..88699d0bcb4 100644 --- a/llvm/lib/CodeGen/RegAllocLocal.cpp +++ b/llvm/lib/CodeGen/RegAllocLocal.cpp @@ -19,7 +19,6 @@ #include "llvm/CodeGen/SSARegMap.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/LiveVariables.h" -#include "llvm/CodeGen/TwoAddressInstructionPass.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" #include "Support/CommandLine.h" @@ -113,7 +112,7 @@ namespace { if (!DisableKill) AU.addRequired<LiveVariables>(); AU.addRequiredID(PHIEliminationID); - AU.addRequired<TwoAddressInstructionPass>(); + AU.addRequiredID(TwoAddressInstructionPassID); MachineFunctionPass::getAnalysisUsage(AU); } diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp index 0716ca92a3c..7bd3f04beeb 100644 --- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/llvm/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>(); |

