aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2002-10-28 00:28:31 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2002-10-28 00:28:31 +0000
commitfce1143bcfa73f61845002fa50473d1a01384202 (patch)
treef8953fdcdd5a3ff127e9897746af825ff28eebc3
parent6f8fd25697c2aec8c915c34f3c90ee52b77b8f56 (diff)
Changed `MachineCodeForMethod' to `MachineFunction'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4301 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/CodeGen/MachineBasicBlock.h22
-rw-r--r--include/llvm/CodeGen/MachineCodeForBasicBlock.h22
-rw-r--r--include/llvm/CodeGen/MachineCodeForMethod.h19
-rw-r--r--include/llvm/CodeGen/MachineFunction.h26
-rw-r--r--include/llvm/Target/MachineInstrInfo.h2
-rw-r--r--include/llvm/Target/TargetFrameInfo.h20
-rw-r--r--include/llvm/Target/TargetInstrInfo.h2
-rw-r--r--lib/CodeGen/InstrSched/InstrScheduling.cpp4
-rw-r--r--lib/CodeGen/InstrSched/SchedGraph.h4
-rw-r--r--lib/CodeGen/InstrSelection/InstrSelection.cpp4
-rw-r--r--lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp2
-rw-r--r--lib/CodeGen/MachineFunction.cpp32
-rw-r--r--lib/CodeGen/RegAlloc/PhyRegAlloc.cpp6
-rw-r--r--lib/CodeGen/RegAlloc/PhyRegAlloc.h4
-rw-r--r--lib/Target/MachineFrameInfo.cpp6
-rw-r--r--lib/Target/SparcV9/InstrSched/InstrScheduling.cpp4
-rw-r--r--lib/Target/SparcV9/InstrSched/SchedGraph.h4
-rw-r--r--lib/Target/SparcV9/InstrSelection/InstrSelection.cpp4
-rw-r--r--lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp2
-rw-r--r--lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp6
-rw-r--r--lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h4
-rw-r--r--lib/Target/SparcV9/SparcV9AsmPrinter.cpp4
-rw-r--r--lib/Target/SparcV9/SparcV9InstrInfo.cpp20
-rw-r--r--lib/Target/SparcV9/SparcV9InstrSelection.cpp6
-rw-r--r--lib/Target/SparcV9/SparcV9Internals.h14
-rw-r--r--lib/Target/SparcV9/SparcV9PrologEpilogInserter.cpp6
-rw-r--r--lib/Target/SparcV9/SparcV9RegInfo.cpp8
-rw-r--r--lib/Target/SparcV9/SparcV9StackSlots.cpp4
-rw-r--r--lib/Target/SparcV9/SparcV9TargetMachine.cpp10
-rw-r--r--lib/Target/TargetMachine.cpp6
30 files changed, 144 insertions, 133 deletions
diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h
index a95103f35f..1a3c7a00f6 100644
--- a/include/llvm/CodeGen/MachineBasicBlock.h
+++ b/include/llvm/CodeGen/MachineBasicBlock.h
@@ -1,27 +1,31 @@
-//===-- llvm/CodeGen/MachineCodeForBasicBlock.h -----------------*- C++ -*--=//
+//===-- llvm/CodeGen/MachineBasicBlock.h ------------------------*- C++ -*--=//
//
// Collect the sequence of machine instructions for a basic block.
//
//===---------------------------------------------------------------------===//
-#ifndef LLVM_CODEGEN_MACHINECODEFORBASICBLOCK_H
-#define LLVM_CODEGEN_MACHINECODEFORBASICBLOCK_H
+#ifndef LLVM_CODEGEN_MACHINEBASICBLOCK_H
+#define LLVM_CODEGEN_MACHINEBASICBLOCK_H
#include "llvm/BasicBlock.h"
class MachineInstr;
extern AnnotationID MCFBB_AID;
-class MachineCodeForBasicBlock : public Annotation {
+// FIXME: this should go away soon
+class MachineBasicBlock;
+typedef MachineBasicBlock MachineCodeForBasicBlock;
+
+class MachineBasicBlock: public Annotation {
std::vector<MachineInstr*> Insts;
public:
- MachineCodeForBasicBlock();
- ~MachineCodeForBasicBlock() {}
+ MachineBasicBlock();
+ ~MachineBasicBlock() {}
- // Static methods to retrieve or destroy the MachineCodeForBasicBlock
+ // Static methods to retrieve or destroy the MachineBasicBlock
// object for a given basic block.
- static MachineCodeForBasicBlock& get(const BasicBlock *bb) {
- return *(MachineCodeForBasicBlock*)bb->getOrCreateAnnotation(MCFBB_AID);
+ static MachineBasicBlock& get(const BasicBlock *bb) {
+ return *(MachineBasicBlock*)bb->getOrCreateAnnotation(MCFBB_AID);
}
static void destroy(const BasicBlock *bb) {
diff --git a/include/llvm/CodeGen/MachineCodeForBasicBlock.h b/include/llvm/CodeGen/MachineCodeForBasicBlock.h
index a95103f35f..1a3c7a00f6 100644
--- a/include/llvm/CodeGen/MachineCodeForBasicBlock.h
+++ b/include/llvm/CodeGen/MachineCodeForBasicBlock.h
@@ -1,27 +1,31 @@
-//===-- llvm/CodeGen/MachineCodeForBasicBlock.h -----------------*- C++ -*--=//
+//===-- llvm/CodeGen/MachineBasicBlock.h ------------------------*- C++ -*--=//
//
// Collect the sequence of machine instructions for a basic block.
//
//===---------------------------------------------------------------------===//
-#ifndef LLVM_CODEGEN_MACHINECODEFORBASICBLOCK_H
-#define LLVM_CODEGEN_MACHINECODEFORBASICBLOCK_H
+#ifndef LLVM_CODEGEN_MACHINEBASICBLOCK_H
+#define LLVM_CODEGEN_MACHINEBASICBLOCK_H
#include "llvm/BasicBlock.h"
class MachineInstr;
extern AnnotationID MCFBB_AID;
-class MachineCodeForBasicBlock : public Annotation {
+// FIXME: this should go away soon
+class MachineBasicBlock;
+typedef MachineBasicBlock MachineCodeForBasicBlock;
+
+class MachineBasicBlock: public Annotation {
std::vector<MachineInstr*> Insts;
public:
- MachineCodeForBasicBlock();
- ~MachineCodeForBasicBlock() {}
+ MachineBasicBlock();
+ ~MachineBasicBlock() {}
- // Static methods to retrieve or destroy the MachineCodeForBasicBlock
+ // Static methods to retrieve or destroy the MachineBasicBlock
// object for a given basic block.
- static MachineCodeForBasicBlock& get(const BasicBlock *bb) {
- return *(MachineCodeForBasicBlock*)bb->getOrCreateAnnotation(MCFBB_AID);
+ static MachineBasicBlock& get(const BasicBlock *bb) {
+ return *(MachineBasicBlock*)bb->getOrCreateAnnotation(MCFBB_AID);
}
static void destroy(const BasicBlock *bb) {
diff --git a/include/llvm/CodeGen/MachineCodeForMethod.h b/include/llvm/CodeGen/MachineCodeForMethod.h
index 742d4b5c0f..00f3cdee58 100644
--- a/include/llvm/CodeGen/MachineCodeForMethod.h
+++ b/include/llvm/CodeGen/MachineCodeForMethod.h
@@ -1,4 +1,4 @@
-//===-- llvm/CodeGen/MachineCodeForMethod.h ----------------------*- C++ -*--=//
+//===-- llvm/CodeGen/MachineFunction.h ----------------------*- C++ -*--=//
//
// Purpose:
// Collect native machine code information for a method.
@@ -6,8 +6,8 @@
// to be stored with each method.
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CODEGEN_MACHINECODEFORMETHOD_H
-#define LLVM_CODEGEN_MACHINECODEFORMETHOD_H
+#ifndef LLVM_CODEGEN_MACHINEFUNCTION_H
+#define LLVM_CODEGEN_MACHINEFUNCTION_H
#include "llvm/Annotation.h"
#include "Support/NonCopyable.h"
@@ -19,8 +19,11 @@ class Constant;
class Type;
class TargetMachine;
+// FIXME: this should go away soon
+class MachineFunction;
+typedef MachineFunction MachineCodeForMethod;
-class MachineCodeForMethod : private Annotation {
+class MachineFunction : private Annotation {
hash_set<const Constant*> constantsForConstPool;
hash_map<const Value*, int> offsets;
const Function* method;
@@ -36,20 +39,20 @@ class MachineCodeForMethod : private Annotation {
bool automaticVarsAreaFrozen;
public:
- /*ctor*/ MachineCodeForMethod(const Function* function,
+ /*ctor*/ MachineFunction(const Function* function,
const TargetMachine& target);
// The next two methods are used to construct and to retrieve
- // the MachineCodeForMethod object for the given method.
+ // the MachineFunction object for the given method.
// construct() -- Allocates and initializes for a given method and target
// get() -- Returns a handle to the object.
// This should not be called before "construct()"
// for a given Method.
//
- static MachineCodeForMethod& construct(const Function *method,
+ static MachineFunction& construct(const Function *method,
const TargetMachine &target);
static void destruct(const Function *F);
- static MachineCodeForMethod& get(const Function* function);
+ static MachineFunction& get(const Function* function);
//
// Accessors for global information about generated code for a method.
diff --git a/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h
index 742d4b5c0f..141838f600 100644
--- a/include/llvm/CodeGen/MachineFunction.h
+++ b/include/llvm/CodeGen/MachineFunction.h
@@ -1,13 +1,13 @@
-//===-- llvm/CodeGen/MachineCodeForMethod.h ----------------------*- C++ -*--=//
+//===-- llvm/CodeGen/MachineFunction.h ---------------------------*- C++ -*--=//
//
-// Purpose:
-// Collect native machine code information for a method.
-// This allows target-specific information about the generated code
-// to be stored with each method.
+// Collect native machine code information for a method. This allows
+// target-specific information about the generated code to be stored with each
+// method.
+//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CODEGEN_MACHINECODEFORMETHOD_H
-#define LLVM_CODEGEN_MACHINECODEFORMETHOD_H
+#ifndef LLVM_CODEGEN_MACHINEFUNCTION_H
+#define LLVM_CODEGEN_MACHINEFUNCTION_H
#include "llvm/Annotation.h"
#include "Support/NonCopyable.h"
@@ -20,7 +20,7 @@ class Type;
class TargetMachine;
-class MachineCodeForMethod : private Annotation {
+class MachineFunction : private Annotation {
hash_set<const Constant*> constantsForConstPool;
hash_map<const Value*, int> offsets;
const Function* method;
@@ -36,20 +36,20 @@ class MachineCodeForMethod : private Annotation {
bool automaticVarsAreaFrozen;
public:
- /*ctor*/ MachineCodeForMethod(const Function* function,
- const TargetMachine& target);
+ /*ctor*/ MachineFunction(const Function* function,
+ const TargetMachine& target);
// The next two methods are used to construct and to retrieve
- // the MachineCodeForMethod object for the given method.
+ // the MachineFunction object for the given method.
// construct() -- Allocates and initializes for a given method and target
// get() -- Returns a handle to the object.
// This should not be called before "construct()"
// for a given Method.
//
- static MachineCodeForMethod& construct(const Function *method,
+ static MachineFunction& construct(const Function *method,
const TargetMachine &target);
static void destruct(const Function *F);
- static MachineCodeForMethod& get(const Function* function);
+ static MachineFunction& get(const Function* function);
//
// Accessors for global information about generated code for a method.
diff --git a/include/llvm/Target/MachineInstrInfo.h b/include/llvm/Target/MachineInstrInfo.h
index 6bfe7e5d67..8fe4d3b4f6 100644
--- a/include/llvm/Target/MachineInstrInfo.h
+++ b/include/llvm/Target/MachineInstrInfo.h
@@ -275,7 +275,7 @@ public:
// The generated instructions are returned in `mvec'.
// Any temp. registers (TmpInstruction) created are recorded in mcfi.
// Symbolic constants or constants that must be accessed from memory
- // are added to the constant pool via MachineCodeForMethod::get(F).
+ // are added to the constant pool via MachineFunction::get(F).
//
virtual void CreateCodeToLoadConst(const TargetMachine& target,
Function* F,
diff --git a/include/llvm/Target/TargetFrameInfo.h b/include/llvm/Target/TargetFrameInfo.h
index c6d2a94316..699966a35e 100644
--- a/include/llvm/Target/TargetFrameInfo.h
+++ b/include/llvm/Target/TargetFrameInfo.h
@@ -10,7 +10,7 @@
#include "Support/NonCopyable.h"
#include <vector>
-class MachineCodeForMethod;
+class MachineFunction;
class TargetMachine;
struct MachineFrameInfo : public NonCopyableV {
@@ -41,24 +41,24 @@ public:
// The first few methods have default machine-independent implementations.
// The rest must be implemented by the machine-specific subclass.
//
- virtual int getIncomingArgOffset (MachineCodeForMethod& mcInfo,
+ virtual int getIncomingArgOffset (MachineFunction& mcInfo,
unsigned argNum) const;
- virtual int getOutgoingArgOffset (MachineCodeForMethod& mcInfo,
+ virtual int getOutgoingArgOffset (MachineFunction& mcInfo,
unsigned argNum) const;
- virtual int getFirstIncomingArgOffset (MachineCodeForMethod& mcInfo,
+ virtual int getFirstIncomingArgOffset (MachineFunction& mcInfo,
bool& growUp) const=0;
- virtual int getFirstOutgoingArgOffset (MachineCodeForMethod& mcInfo,
+ virtual int getFirstOutgoingArgOffset (MachineFunction& mcInfo,
bool& growUp) const=0;
- virtual int getFirstOptionalOutgoingArgOffset (MachineCodeForMethod&,
+ virtual int getFirstOptionalOutgoingArgOffset (MachineFunction&,
bool& growUp) const=0;
- virtual int getFirstAutomaticVarOffset (MachineCodeForMethod& mcInfo,
+ virtual int getFirstAutomaticVarOffset (MachineFunction& mcInfo,
bool& growUp) const=0;
- virtual int getRegSpillAreaOffset (MachineCodeForMethod& mcInfo,
+ virtual int getRegSpillAreaOffset (MachineFunction& mcInfo,
bool& growUp) const=0;
- virtual int getTmpAreaOffset (MachineCodeForMethod& mcInfo,
+ virtual int getTmpAreaOffset (MachineFunction& mcInfo,
bool& growUp) const=0;
- virtual int getDynamicAreaOffset (MachineCodeForMethod& mcInfo,
+ virtual int getDynamicAreaOffset (MachineFunction& mcInfo,
bool& growUp) const=0;
//
diff --git a/include/llvm/Target/TargetInstrInfo.h b/include/llvm/Target/TargetInstrInfo.h
index 6bfe7e5d67..8fe4d3b4f6 100644
--- a/include/llvm/Target/TargetInstrInfo.h
+++ b/include/llvm/Target/TargetInstrInfo.h
@@ -275,7 +275,7 @@ public:
// The generated instructions are returned in `mvec'.
// Any temp. registers (TmpInstruction) created are recorded in mcfi.
// Symbolic constants or constants that must be accessed from memory
- // are added to the constant pool via MachineCodeForMethod::get(F).
+ // are added to the constant pool via MachineFunction::get(F).
//
virtual void CreateCodeToLoadConst(const TargetMachine& target,
Function* F,
diff --git a/lib/CodeGen/InstrSched/InstrScheduling.cpp b/lib/CodeGen/InstrSched/InstrScheduling.cpp
index 9818b70838..ea20a3e92a 100644
--- a/lib/CodeGen/InstrSched/InstrScheduling.cpp
+++ b/lib/CodeGen/InstrSched/InstrScheduling.cpp
@@ -9,7 +9,7 @@
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineCodeForInstruction.h"
#include "llvm/CodeGen/MachineCodeForBasicBlock.h"
-#include "llvm/CodeGen/MachineCodeForMethod.h"
+#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/Analysis/LiveVar/FunctionLiveVarInfo.h" // FIXME: Remove when modularized better
#include "llvm/Target/TargetMachine.h"
#include "llvm/BasicBlock.h"
@@ -1542,7 +1542,7 @@ bool InstructionSchedulingWithSSA::runOnFunction(Function &F)
if (SchedDebugLevel >= Sched_PrintMachineCode)
{
cerr << "\n*** Machine instructions after INSTRUCTION SCHEDULING\n";
- MachineCodeForMethod::get(&F).dump();
+ MachineFunction::get(&F).dump();
}
return false;
diff --git a/lib/CodeGen/InstrSched/SchedGraph.h b/lib/CodeGen/InstrSched/SchedGraph.h
index eac9c1c6d6..514e565477 100644
--- a/lib/CodeGen/InstrSched/SchedGraph.h
+++ b/lib/CodeGen/InstrSched/SchedGraph.h
@@ -31,7 +31,7 @@ class RegToRefVecMap;
class ValueToDefVecMap;
class RefVec;
class MachineInstr;
-class MachineCodeForBasicBlock;
+class MachineBasicBlock;
/******************** Exported Data Types and Constants ********************/
@@ -312,7 +312,7 @@ private:
const TargetMachine& target);
void addCallCCEdges (const std::vector<SchedGraphNode*>& memNod,
- MachineCodeForBasicBlock& bbMvec,
+ MachineBasicBlock& bbMvec,
const TargetMachine& target);
void addMachineRegEdges (RegToRefVecMap& regToRefVecMap,
diff --git a/lib/CodeGen/InstrSelection/InstrSelection.cpp b/lib/CodeGen/InstrSelection/InstrSelection.cpp
index a9d1331c94..83ce0a7dfe 100644
--- a/lib/CodeGen/InstrSelection/InstrSelection.cpp
+++ b/lib/CodeGen/InstrSelection/InstrSelection.cpp
@@ -12,7 +12,7 @@
#include "llvm/CodeGen/InstrForest.h"
#include "llvm/CodeGen/MachineCodeForInstruction.h"
#include "llvm/CodeGen/MachineCodeForBasicBlock.h"
-#include "llvm/CodeGen/MachineCodeForMethod.h"
+#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/Target/MachineRegInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Function.h"
@@ -155,7 +155,7 @@ bool InstructionSelection::runOnFunction(Function &F)
if (SelectDebugLevel >= Select_PrintMachineCode)
{
cerr << "\n*** Machine instructions after INSTRUCTION SELECTION\n";
- MachineCodeForMethod::get(&F).dump();
+ MachineFunction::get(&F).dump();
}
return true;
diff --git a/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp b/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
index 731f3355af..b2f5b22f4c 100644
--- a/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
+++ b/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
@@ -10,7 +10,7 @@
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrAnnot.h"
#include "llvm/CodeGen/MachineCodeForInstruction.h"
-#include "llvm/CodeGen/MachineCodeForMethod.h"
+#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/InstrForest.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/MachineRegInfo.h"
diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp
index e809e31a62..b9f1ae28ae 100644
--- a/lib/CodeGen/MachineFunction.cpp
+++ b/lib/CodeGen/MachineFunction.cpp
@@ -6,7 +6,7 @@
// to be stored with each function.
//===---------------------------------------------------------------------===//
-#include "llvm/CodeGen/MachineCodeForMethod.h"
+#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h" // For debug output
#include "llvm/CodeGen/MachineCodeForBasicBlock.h"
#include "llvm/Target/TargetMachine.h"
@@ -30,27 +30,27 @@ static AnnotationID MCFM_AID(
// This should not be called before "construct()"
// for a given Function.
//
-MachineCodeForMethod&
-MachineCodeForMethod::construct(const Function *M, const TargetMachine &Tar)
+MachineFunction&
+MachineFunction::construct(const Function *M, const TargetMachine &Tar)
{
assert(M->getAnnotation(MCFM_AID) == 0 &&
"Object already exists for this function!");
- MachineCodeForMethod* mcInfo = new MachineCodeForMethod(M, Tar);
+ MachineFunction* mcInfo = new MachineFunction(M, Tar);
M->addAnnotation(mcInfo);
return *mcInfo;
}
void
-MachineCodeForMethod::destruct(const Function *M)
+MachineFunction::destruct(const Function *M)
{
bool Deleted = M->deleteAnnotation(MCFM_AID);
assert(Deleted && "Machine code did not exist for function!");
}
-MachineCodeForMethod&
-MachineCodeForMethod::get(const Function *F)
+MachineFunction&
+MachineFunction::get(const Function *F)
{
- MachineCodeForMethod *mc = (MachineCodeForMethod*)F->getAnnotation(MCFM_AID);
+ MachineFunction *mc = (MachineFunction*)F->getAnnotation(MCFM_AID);
assert(mc && "Call construct() method first to allocate the object");
return *mc;
}
@@ -122,7 +122,7 @@ SizeToAlignment(unsigned int size, const TargetMachine& target)
/*ctor*/
-MachineCodeForMethod::MachineCodeForMethod(const Function *F,
+MachineFunction::MachineFunction(const Function *F,
const TargetMachine& target)
: Annotation(MCFM_AID),
method(F), staticStackSize(0),
@@ -138,7 +138,7 @@ MachineCodeForMethod::MachineCodeForMethod(const Function *F,
}
int
-MachineCodeForMethod::computeOffsetforLocalVar(const TargetMachine& target,
+MachineFunction::computeOffsetforLocalVar(const TargetMachine& target,
const Value* val,
unsigned int& getPaddedSize,
unsigned int sizeToUse)
@@ -160,7 +160,7 @@ MachineCodeForMethod::computeOffsetforLocalVar(const TargetMachine& target,
}
int
-MachineCodeForMethod::allocateLocalVar(const TargetMachine& target,
+MachineFunction::allocateLocalVar(const TargetMachine& target,
const Value* val,
unsigned int sizeToUse)
{
@@ -183,7 +183,7 @@ MachineCodeForMethod::allocateLocalVar(const TargetMachine& target,
}
int
-MachineCodeForMethod::allocateSpilledValue(const TargetMachine& target,
+MachineFunction::allocateSpilledValue(const TargetMachine& target,
const Type* type)
{
assert(! spillsAreaFrozen &&
@@ -208,7 +208,7 @@ MachineCodeForMethod::allocateSpilledValue(const TargetMachine& target,
}
int
-MachineCodeForMethod::pushTempValue(const TargetMachine& target,
+MachineFunction::pushTempValue(const TargetMachine& target,
unsigned int size)
{
unsigned int align = SizeToAlignment(size, target);
@@ -228,20 +228,20 @@ MachineCodeForMethod::pushTempValue(const TargetMachine& target,
}
void
-MachineCodeForMethod::popAllTempValues(const TargetMachine& target)
+MachineFunction::popAllTempValues(const TargetMachine& target)
{
resetTmpAreaSize(); // clear tmp area to reuse
}
int
-MachineCodeForMethod::getOffset(const Value* val) const
+MachineFunction::getOffset(const Value* val) const
{
hash_map<const Value*, int>::const_iterator pair = offsets.find(val);
return (pair == offsets.end())? INVALID_FRAME_OFFSET : pair->second;
}
void
-MachineCodeForMethod::dump() const
+MachineFunction::dump() const
{
std::cerr << "\n" << method->getReturnType()
<< " \"" << method->getName() << "\"\n";
diff --git a/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp b/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp
index 5fc6a4d5c0..9899dbc71c 100644
--- a/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp
+++ b/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp
@@ -10,7 +10,7 @@
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrAnnot.h"
#include "llvm/CodeGen/MachineCodeForBasicBlock.h"
-#include "llvm/CodeGen/MachineCodeForMethod.h"
+#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/Analysis/LiveVar/FunctionLiveVarInfo.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Target/TargetMachine.h"
@@ -78,7 +78,7 @@ Pass *getRegisterAllocator(TargetMachine &T) {
PhyRegAlloc::PhyRegAlloc(Function *F, const TargetMachine& tm,
FunctionLiveVarInfo *Lvi, LoopInfo *LDC)
: TM(tm), Meth(F),
- mcInfo(MachineCodeForMethod::get(F)),
+ mcInfo(MachineFunction::get(F)),
LVI(Lvi), LRI(F, tm, RegClassList),
MRI(tm.getRegInfo()),
NumOfRegClasses(MRI.getNumOfRegClasses()),
@@ -1194,7 +1194,7 @@ void PhyRegAlloc::allocateRegisters()
if (DEBUG_RA) {
cerr << "\n**** Machine Code After Register Allocation:\n\n";
- MachineCodeForMethod::get(Meth).dump();
+ MachineFunction::get(Meth).dump();
}
}
diff --git a/lib/CodeGen/RegAlloc/PhyRegAlloc.h b/lib/CodeGen/RegAlloc/PhyRegAlloc.h
index da4d2fd8ec..ca517138b7 100644
--- a/lib/CodeGen/RegAlloc/PhyRegAlloc.h
+++ b/lib/CodeGen/RegAlloc/PhyRegAlloc.h
@@ -35,7 +35,7 @@
#include <vector>
#include <map>
-class MachineCodeForMethod;
+class MachineFunction;
class MachineRegInfo;
class FunctionLiveVarInfo;
class MachineInstr;
@@ -71,7 +71,7 @@ class PhyRegAlloc: public NonCopyable {
std::vector<RegClass *> RegClassList; // vector of register classes
const TargetMachine &TM; // target machine
const Function *Meth; // name of the function we work on
- MachineCodeForMethod &mcInfo; // descriptor for method's native code
+ MachineFunction &mcInfo; // descriptor for method's native code
FunctionLiveVarInfo *const LVI; // LV information for this method
// (already computed for BBs)
LiveRangeInfo LRI; // LR info (will be computed)
diff --git a/lib/Target/MachineFrameInfo.cpp b/lib/Target/MachineFrameInfo.cpp
index 0eeacbc2b0..4d2fab230e 100644
--- a/lib/Target/MachineFrameInfo.cpp
+++ b/lib/Target/MachineFrameInfo.cpp
@@ -7,10 +7,10 @@
//===----------------------------------------------------------------------===//
#include "llvm/Target/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineCodeForMethod.h"
+#include "llvm/CodeGen/MachineFunction.h"
int
-MachineFrameInfo::getIncomingArgOffset(MachineCodeForMethod& mcInfo,
+MachineFrameInfo::getIncomingArgOffset(MachineFunction& mcInfo,
unsigned argNum) const
{
assert(argsOnStackHaveFixedSize());
@@ -25,7 +25,7 @@ MachineFrameInfo::getIncomingArgOffset(MachineCodeForMethod& mcInfo,
int
-MachineFrameInfo::getOutgoingArgOffset(MachineCodeForMethod& mcInfo,
+MachineFrameInfo::getOutgoingArgOffset(MachineFunction& mcInfo,
unsigned argNum) const
{
assert(argsOnStackHaveFixedSize());
diff --git a/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp b/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp
index 9818b70838..ea20a3e92a 100644
--- a/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp
+++ b/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp
@@ -9,7 +9,7 @@
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineCodeForInstruction.h"
#include "llvm/CodeGen/MachineCodeForBasicBlock.h"
-#include "llvm/CodeGen/MachineCodeForMethod.h"
+#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/Analysis/LiveVar/FunctionLiveVarInfo.h" // FIXME: Remove when modularized better
#include "llvm/Target/TargetMachine.h"
#include "llvm/BasicBlock.h"
@@ -1542,7 +1542,7 @@ bool InstructionSchedulingWithSSA::runOnFunction(Function &F)
if (SchedDebugLevel >= Sched_PrintMachineCode)
{
cerr << "\n*** Machine instructions after INSTRUCTION SCHEDULING\n";
- MachineCodeForMethod::get(&F).dump();
+ MachineFunction::get(&F).dump();
}
return false;
diff --git a/lib/Target/SparcV9/InstrSched/SchedGraph.h b/lib/Target/SparcV9/InstrSched/SchedGraph.h
index eac9c1c6d6..514e565477 100644
--- a/lib/Target/SparcV9/InstrSched/SchedGraph.h
+++ b/lib/Target/SparcV9/InstrSched/SchedGraph.h
@@ -31,7 +31,7 @@ class RegToRefVecMap;
class ValueToDefVecMap;
class RefVec;
class MachineInstr;
-class MachineCodeForBasicBlock;
+class MachineBasicBlock;
/******************** Exported Data Types and Constants ********************/
@@ -312,7 +312,7 @@ private:
const TargetMachine& target);
void addCallCCEdges (const std::vector<SchedGraphNode*>& memNod,
- MachineCodeForBasicBlock& bbMvec,
+ MachineBasicBlock& bbMvec,
const TargetMachine& target);
void addMachineRegEdges (RegToRefVecMap& regToRefVecMap,
diff --git a/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp b/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp
index a9d1331c94..83ce0a7dfe 100644
--- a/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp
+++ b/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp
@@ -12,7 +12,7 @@
#include "llvm/CodeGen/InstrForest.h"
#include "llvm/CodeGen/MachineCodeForInstruction.h"
#include "llvm/CodeGen/MachineCodeForBasicBlock.h"
-#include "llvm/CodeGen/MachineCodeForMethod.h"
+#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/Target/MachineRegInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Function.h"
@@ -155,7 +155,7 @@ bool InstructionSelection::runOnFunction(Function &F)
if (SelectDebugLevel >= Select_PrintMachineCode)
{
cerr << "\n*** Machine instructions after INSTRUCTION SELECTION\n";
- MachineCodeForMethod::get(&F).dump();
+ MachineFunction::get(&F).dump();
}
return true;
diff --git a/lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp b/lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp
index 731f3355af..b2f5b22f4c 100644
--- a/lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp
+++ b/lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp
@@ -10,7 +10,7 @@
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrAnnot.h"
#include "llvm/CodeGen/MachineCodeForInstruction.h"
-#include "llvm/CodeGen/MachineCodeForMethod.h"
+#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/InstrForest.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/MachineRegInfo.h"
diff --git a/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp
index 5fc6a4d5c0..9899dbc71c 100644
--- a/lib/Targe