From 7139090fd29481bc91db6023d613fd5389ebfcb2 Mon Sep 17 00:00:00 2001 From: Alkis Evlogimenos Date: Thu, 18 Dec 2003 22:40:24 +0000 Subject: 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 --- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/TwoAddressInstructionPass.cpp') 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 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 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(); -- cgit v1.2.3