[llvm-commits] CVS: llvm/lib/Target/Sparc/EmitAssembly.cpp PrologEpilogCodeInserter.cpp Sparc.cpp SparcInstrInfo.cpp SparcInstrSelection.cpp SparcInternals.h SparcRegInfo.cpp

Misha Brukman brukman at neo.cs.uiuc.edu
Sun Oct 27 18:29:01 PST 2002


Changes in directory llvm/lib/Target/Sparc:

EmitAssembly.cpp updated: 1.63 -> 1.64
PrologEpilogCodeInserter.cpp updated: 1.14 -> 1.15
Sparc.cpp updated: 1.47 -> 1.48
SparcInstrInfo.cpp updated: 1.30 -> 1.31
SparcInstrSelection.cpp updated: 1.76 -> 1.77
SparcInternals.h updated: 1.67 -> 1.68
SparcRegInfo.cpp updated: 1.75 -> 1.76

---
Log message:

Changed `MachineCodeForMethod' to `MachineFunction'.


---
Diffs of the changes:

Index: llvm/lib/Target/Sparc/EmitAssembly.cpp
diff -u llvm/lib/Target/Sparc/EmitAssembly.cpp:1.63 llvm/lib/Target/Sparc/EmitAssembly.cpp:1.64
--- llvm/lib/Target/Sparc/EmitAssembly.cpp:1.63	Tue Oct 15 14:56:24 2002
+++ llvm/lib/Target/Sparc/EmitAssembly.cpp	Sun Oct 27 18:28:31 2002
@@ -14,7 +14,7 @@
 #include "SparcInternals.h"
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/CodeGen/MachineCodeForBasicBlock.h"
-#include "llvm/CodeGen/MachineCodeForMethod.h"
+#include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Module.h"
@@ -865,7 +865,7 @@
   for (Module::const_iterator I = M.begin(), E = M.end(); I != E; ++I)
     if (!I->isExternal()) {
       const hash_set<const Constant*> &pool =
-        MachineCodeForMethod::get(I).getConstantPoolValues();
+        MachineFunction::get(I).getConstantPoolValues();
       MC.insert(pool.begin(), pool.end());
     }
 }


Index: llvm/lib/Target/Sparc/PrologEpilogCodeInserter.cpp
diff -u llvm/lib/Target/Sparc/PrologEpilogCodeInserter.cpp:1.14 llvm/lib/Target/Sparc/PrologEpilogCodeInserter.cpp:1.15
--- llvm/lib/Target/Sparc/PrologEpilogCodeInserter.cpp:1.14	Sat Oct 12 19:24:06 2002
+++ llvm/lib/Target/Sparc/PrologEpilogCodeInserter.cpp	Sun Oct 27 18:28:31 2002
@@ -11,7 +11,7 @@
 
 #include "SparcInternals.h"
 #include "SparcRegClassInfo.h"
-#include "llvm/CodeGen/MachineCodeForMethod.h"
+#include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineCodeForBasicBlock.h"
 #include "llvm/CodeGen/MachineCodeForInstruction.h"
 #include "llvm/CodeGen/MachineInstr.h"
@@ -28,7 +28,7 @@
     const char *getPassName() const { return "Sparc Prolog/Epilog Inserter"; }
     
     bool runOnFunction(Function &F) {
-      MachineCodeForMethod &mcodeInfo = MachineCodeForMethod::get(&F);
+      MachineFunction &mcodeInfo = MachineFunction::get(&F);
       if (!mcodeInfo.isCompiledAsLeafMethod()) {
         InsertPrologCode(F);
         InsertEpilogCode(F);
@@ -60,7 +60,7 @@
   // immediate field, we have to use a free register to hold the size.
   // See the comments below for the choice of this register.
   // 
-  MachineCodeForMethod& mcInfo = MachineCodeForMethod::get(&F);
+  MachineFunction& mcInfo = MachineFunction::get(&F);
   unsigned int staticStackSize = mcInfo.getStaticStackSize();
   
   if (staticStackSize < (unsigned) frameInfo.getMinStackFrameSize())


Index: llvm/lib/Target/Sparc/Sparc.cpp
diff -u llvm/lib/Target/Sparc/Sparc.cpp:1.47 llvm/lib/Target/Sparc/Sparc.cpp:1.48
--- llvm/lib/Target/Sparc/Sparc.cpp:1.47	Thu Oct 24 21:01:33 2002
+++ llvm/lib/Target/Sparc/Sparc.cpp	Sun Oct 27 18:28:31 2002
@@ -8,7 +8,7 @@
 #include "SparcInternals.h"
 #include "llvm/Target/Sparc.h"
 #include "llvm/Function.h"
-#include "llvm/CodeGen/MachineCodeForMethod.h"
+#include "llvm/CodeGen/MachineFunction.h"
 using std::cerr;
 
 // Build the MachineInstruction Description Array...
@@ -39,7 +39,7 @@
 //---------------------------------------------------------------------------
 
 int
-UltraSparcFrameInfo::getFirstAutomaticVarOffset(MachineCodeForMethod& ,
+UltraSparcFrameInfo::getFirstAutomaticVarOffset(MachineFunction& ,
                                                 bool& pos) const
 {
   pos = false;                          // static stack area grows downwards
@@ -47,7 +47,7 @@
 }
 
 int
-UltraSparcFrameInfo::getRegSpillAreaOffset(MachineCodeForMethod& mcInfo,
+UltraSparcFrameInfo::getRegSpillAreaOffset(MachineFunction& mcInfo,
                                            bool& pos) const
 {
   mcInfo.freezeAutomaticVarsArea();     // ensure no more auto vars are added
@@ -58,7 +58,7 @@
 }
 
 int
-UltraSparcFrameInfo::getTmpAreaOffset(MachineCodeForMethod& mcInfo,
+UltraSparcFrameInfo::getTmpAreaOffset(MachineFunction& mcInfo,
                                       bool& pos) const
 {
   mcInfo.freezeAutomaticVarsArea();     // ensure no more auto vars are added
@@ -72,7 +72,7 @@
 }
 
 int
-UltraSparcFrameInfo::getDynamicAreaOffset(MachineCodeForMethod& mcInfo,
+UltraSparcFrameInfo::getDynamicAreaOffset(MachineFunction& mcInfo,
                                           bool& pos) const
 {
   // Dynamic stack area grows downwards starting at top of opt-args area.


Index: llvm/lib/Target/Sparc/SparcInstrInfo.cpp
diff -u llvm/lib/Target/Sparc/SparcInstrInfo.cpp:1.30 llvm/lib/Target/Sparc/SparcInstrInfo.cpp:1.31
--- llvm/lib/Target/Sparc/SparcInstrInfo.cpp:1.30	Sun Oct 13 14:39:13 2002
+++ llvm/lib/Target/Sparc/SparcInstrInfo.cpp	Sun Oct 27 18:28:31 2002
@@ -6,7 +6,7 @@
 #include "SparcInstrSelectionSupport.h"
 #include "llvm/CodeGen/InstrSelection.h"
 #include "llvm/CodeGen/InstrSelectionSupport.h"
-#include "llvm/CodeGen/MachineCodeForMethod.h"
+#include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineCodeForInstruction.h"
 #include "llvm/Function.h"
 #include "llvm/Constants.h"
@@ -361,7 +361,7 @@
 // GlobalValue, viz., the constant address of a global variable or function.
 // The generated instructions are returned in `mvec'.
 // Any temp. registers (TmpInstruction) created are recorded in mcfi.
-// Any stack space required is allocated via MachineCodeForMethod.
+// Any stack space required is allocated via MachineFunction.
 // 
 void
 UltraSparcInstrInfo::CreateCodeToLoadConst(const TargetMachine& target,
@@ -461,7 +461,7 @@
       mvec.push_back(MI);
       
       // Make sure constant is emitted to constant pool in assembly code.
-      MachineCodeForMethod::get(F).addToConstantPool(cast<Constant>(val));
+      MachineFunction::get(F).addToConstantPool(cast<Constant>(val));
     }
 }
 
@@ -471,7 +471,7 @@
 // val must be an integral type.  dest must be a Float or Double.
 // The generated instructions are returned in `mvec'.
 // Any temp. registers (TmpInstruction) created are recorded in mcfi.
-// Any stack space required is allocated via MachineCodeForMethod.
+// Any stack space required is allocated via MachineFunction.
 // 
 void
 UltraSparcInstrInfo::CreateCodeToCopyIntToFloat(const TargetMachine& target,
@@ -487,7 +487,7 @@
          && "Dest type must be float/double");
 
   // Get a stack slot to use for the copy
-  int offset = MachineCodeForMethod::get(F).allocateLocalVar(target, val); 
+  int offset = MachineFunction::get(F).allocateLocalVar(target, val); 
 
   // Get the size of the source value being copied. 
   size_t srcSize = target.DataLayout.getTypeSize(val->getType());
@@ -532,7 +532,7 @@
 // `val' to an integer register `dest' by copying to memory and back.
 // The generated instructions are returned in `mvec'.
 // Any temp. registers (TmpInstruction) created are recorded in mcfi.
-// Any stack space required is allocated via MachineCodeForMethod.
+// Any stack space required is allocated via MachineFunction.
 // 
 void
 UltraSparcInstrInfo::CreateCodeToCopyFloatToInt(const TargetMachine& target,
@@ -549,7 +549,7 @@
   assert((destTy->isIntegral() || isa<PointerType>(destTy))
          && "Dest type must be integer, bool or pointer");
 
-  int offset = MachineCodeForMethod::get(F).allocateLocalVar(target, val); 
+  int offset = MachineFunction::get(F).allocateLocalVar(target, val); 
 
   // Store instruction stores `val' to [%fp+offset].
   // The store opCode is based only the source value being copied.
@@ -579,7 +579,7 @@
 // Create instruction(s) to copy src to dest, for arbitrary types
 // The generated instructions are returned in `mvec'.
 // Any temp. registers (TmpInstruction) created are recorded in mcfi.
-// Any stack space required is allocated via MachineCodeForMethod.
+// Any stack space required is allocated via MachineFunction.
 // 
 void
 UltraSparcInstrInfo::CreateCopyInstructionsByType(const TargetMachine& target,
@@ -675,7 +675,7 @@
 // from an arbitrary-sized integer value (sized in bits, not bytes).
 // The generated instructions are returned in `mvec'.
 // Any temp. registers (TmpInstruction) created are recorded in mcfi.
-// Any stack space required is allocated via MachineCodeForMethod.
+// Any stack space required is allocated via MachineFunction.
 // 
 void
 UltraSparcInstrInfo::CreateSignExtensionInstructions(
@@ -697,7 +697,7 @@
 // For SPARC v9, we sign-extend the given operand using SLL; SRL.
 // The generated instructions are returned in `mvec'.
 // Any temp. registers (TmpInstruction) created are recorded in mcfi.
-// Any stack space required is allocated via MachineCodeForMethod.
+// Any stack space required is allocated via MachineFunction.
 // 
 void
 UltraSparcInstrInfo::CreateZeroExtensionInstructions(


Index: llvm/lib/Target/Sparc/SparcInstrSelection.cpp
diff -u llvm/lib/Target/Sparc/SparcInstrSelection.cpp:1.76 llvm/lib/Target/Sparc/SparcInstrSelection.cpp:1.77
--- llvm/lib/Target/Sparc/SparcInstrSelection.cpp:1.76	Mon Oct 14 11:32:24 2002
+++ llvm/lib/Target/Sparc/SparcInstrSelection.cpp	Sun Oct 27 18:28:31 2002
@@ -12,7 +12,7 @@
 #include "llvm/CodeGen/MachineInstrAnnot.h"
 #include "llvm/CodeGen/InstrForest.h"
 #include "llvm/CodeGen/InstrSelection.h"
-#include "llvm/CodeGen/MachineCodeForMethod.h"
+#include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineCodeForInstruction.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/iTerminators.h"
@@ -843,7 +843,7 @@
   // and create a temporary Value to hold it.
   assert(result && result->getParent() && "Result value is not part of a fn?");
   Function *F = result->getParent()->getParent();
-  MachineCodeForMethod& mcInfo = MachineCodeForMethod::get(F);
+  MachineFunction& mcInfo = MachineFunction::get(F);
   bool growUp;
   ConstantSInt* dynamicAreaOffset =
     ConstantSInt::get(Type::IntTy,
@@ -885,7 +885,7 @@
   assert(result && result->getParent() &&
          "Result value is not part of a function?");
   Function *F = result->getParent()->getParent();
-  MachineCodeForMethod &mcInfo = MachineCodeForMethod::get(F);
+  MachineFunction &mcInfo = MachineFunction::get(F);
 
   // Check if the offset would small enough to use as an immediate in
   // load/stores (check LDX because all load/stores have the same-size immediate


Index: llvm/lib/Target/Sparc/SparcInternals.h
diff -u llvm/lib/Target/Sparc/SparcInternals.h:1.67 llvm/lib/Target/Sparc/SparcInternals.h:1.68
--- llvm/lib/Target/Sparc/SparcInternals.h:1.67	Sat Oct 12 19:06:04 2002
+++ llvm/lib/Target/Sparc/SparcInternals.h	Sun Oct 27 18:28:31 2002
@@ -560,32 +560,32 @@
   // particular function.  The frame contents are obtained from the
   // MachineCodeInfoForMethod object for the given function.
   // 
-  int getFirstIncomingArgOffset  (MachineCodeForMethod& mcInfo,
+  int getFirstIncomingArgOffset  (MachineFunction& mcInfo,
                                   bool& growUp) const
   {
     growUp = true;                         // arguments area grows upwards
     return FirstIncomingArgOffsetFromFP;
   }
-  int getFirstOutgoingArgOffset  (MachineCodeForMethod& mcInfo,
+  int getFirstOutgoingArgOffset  (MachineFunction& mcInfo,
                                   bool& growUp) const
   {
     growUp = true;                         // arguments area grows upwards
     return FirstOutgoingArgOffsetFromSP;
   }
-  int getFirstOptionalOutgoingArgOffset(MachineCodeForMethod& mcInfo,
+  int getFirstOptionalOutgoingArgOffset(MachineFunction& mcInfo,
                                         bool& growUp)const
   {
     growUp = true;                         // arguments area grows upwards
     return FirstOptionalOutgoingArgOffsetFromSP;
   }
   
-  int getFirstAutomaticVarOffset (MachineCodeForMethod& mcInfo,
+  int getFirstAutomaticVarOffset (MachineFunction& mcInfo,
                                   bool& growUp) const;
-  int getRegSpillAreaOffset      (MachineCodeForMethod& mcInfo,
+  int getRegSpillAreaOffset      (MachineFunction& mcInfo,
                                   bool& growUp) const;
-  int getTmpAreaOffset           (MachineCodeForMethod& mcInfo,
+  int getTmpAreaOffset           (MachineFunction& mcInfo,
                                   bool& growUp) const;
-  int getDynamicAreaOffset       (MachineCodeForMethod& mcInfo,
+  int getDynamicAreaOffset       (MachineFunction& mcInfo,
                                   bool& growUp) const;
 
   //


Index: llvm/lib/Target/Sparc/SparcRegInfo.cpp
diff -u llvm/lib/Target/Sparc/SparcRegInfo.cpp:1.75 llvm/lib/Target/Sparc/SparcRegInfo.cpp:1.76
--- llvm/lib/Target/Sparc/SparcRegInfo.cpp:1.75	Tue Oct 22 18:16:21 2002
+++ llvm/lib/Target/Sparc/SparcRegInfo.cpp	Sun Oct 27 18:28:31 2002
@@ -8,7 +8,7 @@
 #include "SparcInternals.h"
 #include "SparcRegClassInfo.h"
 #include "llvm/Target/Sparc.h"
-#include "llvm/CodeGen/MachineCodeForMethod.h"
+#include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/PhyRegAlloc.h"
 #include "llvm/CodeGen/InstrSelection.h"
 #include "llvm/CodeGen/InstrSelectionSupport.h"
@@ -477,7 +477,7 @@
                  regClassIDOfArgReg == IntRegClassID &&
                  "This should only be an Int register for an FP argument");
           
- 	  int TmpOff = MachineCodeForMethod::get(Meth).pushTempValue(target,  
+ 	  int TmpOff = MachineFunction::get(Meth).pushTempValue(target,  
                                                 getSpilledRegSize(regType));
 	  cpReg2MemMI(FirstAI->InstrnsBefore,
                       UniArgReg, getFramePointer(), TmpOff, IntRegType);
@@ -496,7 +496,7 @@
 	//
         const MachineFrameInfo& frameInfo = target.getFrameInfo();
 	int offsetFromFP =
-          frameInfo.getIncomingArgOffset(MachineCodeForMethod::get(Meth),
+          frameInfo.getIncomingArgOffset(MachineFunction::get(Meth),
                                          argNo);
         
 	cpMem2RegMI(FirstAI->InstrnsBefore,
@@ -544,7 +544,7 @@
 
         const MachineFrameInfo& frameInfo = target.getFrameInfo();
 	int offsetFromFP =
-          frameInfo.getIncomingArgOffset(MachineCodeForMethod::get(Meth),
+          frameInfo.getIncomingArgOffset(MachineFunction::get(Meth),
                                          argNo);
         
 	LR->modifySpillOffFromFP( offsetFromFP );





More information about the llvm-commits mailing list