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
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index d818d0b..74426d5 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.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 @@
AU.addRequired<LiveVariables>();
AU.addPreservedID(PHIEliminationID);
AU.addRequiredID(PHIEliminationID);
- AU.addRequired<TwoAddressInstructionPass>();
+ AU.addRequiredID(TwoAddressInstructionPassID);
MachineFunctionPass::getAnalysisUsage(AU);
}
diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp
index d3e80e0..88699d0 100644
--- a/lib/CodeGen/RegAllocLocal.cpp
+++ b/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 @@
if (!DisableKill)
AU.addRequired<LiveVariables>();
AU.addRequiredID(PHIEliminationID);
- AU.addRequired<TwoAddressInstructionPass>();
+ AU.addRequiredID(TwoAddressInstructionPassID);
MachineFunctionPass::getAnalysisUsage(AU);
}
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 @@
"Number of instructions added");
};
+const PassInfo *llvm::TwoAddressInstructionPassID = X.getPassInfo();
+
void TwoAddressInstructionPass::getAnalysisUsage(AnalysisUsage &AU) const
{
AU.addPreserved<LiveVariables>();