[llvm-commits] CVS: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp RegAllocLocal.cpp LiveIntervals.cpp

Alkis Evlogimenos alkis at cs.uiuc.edu
Thu Dec 18 16:41:01 PST 2003


Changes in directory llvm/lib/CodeGen:

TwoAddressInstructionPass.cpp updated: 1.1 -> 1.2
RegAllocLocal.cpp updated: 1.35 -> 1.36
LiveIntervals.cpp updated: 1.11 -> 1.12

---
Log message:

Remove TwoAddressInstruction from the public headers and add an ID
instead, since this pass doesn't expose any state to its users.


---
Diffs of the changes:  (+21 -6)

Index: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
diff -u llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.1 llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.2
--- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.1	Thu Dec 18 07:06:03 2003
+++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp	Thu Dec 18 16:40:23 2003
@@ -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",
@@ -44,6 +59,8 @@
     Statistic<> numInstrsAdded("twoaddressinstruction",
                                "Number of instructions added");
 };
+
+const PassInfo *llvm::TwoAddressInstructionPassID = X.getPassInfo();
 
 void TwoAddressInstructionPass::getAnalysisUsage(AnalysisUsage &AU) const
 {


Index: llvm/lib/CodeGen/RegAllocLocal.cpp
diff -u llvm/lib/CodeGen/RegAllocLocal.cpp:1.35 llvm/lib/CodeGen/RegAllocLocal.cpp:1.36
--- llvm/lib/CodeGen/RegAllocLocal.cpp:1.35	Thu Dec 18 07:08:52 2003
+++ llvm/lib/CodeGen/RegAllocLocal.cpp	Thu Dec 18 16:40:23 2003
@@ -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);
     }
 


Index: llvm/lib/CodeGen/LiveIntervals.cpp
diff -u llvm/lib/CodeGen/LiveIntervals.cpp:1.11 llvm/lib/CodeGen/LiveIntervals.cpp:1.12
--- llvm/lib/CodeGen/LiveIntervals.cpp:1.11	Thu Dec 18 07:15:02 2003
+++ llvm/lib/CodeGen/LiveIntervals.cpp	Thu Dec 18 16:40:24 2003
@@ -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);
 }
 





More information about the llvm-commits mailing list