aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-12-31 04:13:23 +0000
committerChris Lattner <sabre@nondot.org>2007-12-31 04:13:23 +0000
commit1b98919de35bee879f414e9b97b38eeb9df287bc (patch)
tree5686c82a5bfacdb56c5e7dabbf24990d70aac8d3 /lib/CodeGen/MachineFunction.cpp
parent888407cce69064cfc4de1581d3944ba74f308f74 (diff)
downloadexternal_llvm-1b98919de35bee879f414e9b97b38eeb9df287bc.zip
external_llvm-1b98919de35bee879f414e9b97b38eeb9df287bc.tar.gz
external_llvm-1b98919de35bee879f414e9b97b38eeb9df287bc.tar.bz2
Rename SSARegMap -> MachineRegisterInfo in keeping with the idea
that "machine" classes are used to represent the current state of the code being compiled. Given this expanded name, we can start moving other stuff into it. For now, move the UsedPhysRegs and LiveIn/LoveOuts vectors from MachineFunction into it. Update all the clients to match. This also reduces some needless #includes, such as MachineModuleInfo from MachineFunction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineFunction.cpp')
-rw-r--r--lib/CodeGen/MachineFunction.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp
index 037e3e4..595159b 100644
--- a/lib/CodeGen/MachineFunction.cpp
+++ b/lib/CodeGen/MachineFunction.cpp
@@ -14,12 +14,12 @@
//===----------------------------------------------------------------------===//
#include "llvm/DerivedTypes.h"
+#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/SSARegMap.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineConstantPool.h"
+#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
+#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetLowering.h"
@@ -122,11 +122,10 @@ void ilist_traits<MachineBasicBlock>::transferNodesFromList(
MachineFunction::MachineFunction(const Function *F,
const TargetMachine &TM)
: Annotation(MF_AID), Fn(F), Target(TM) {
- SSARegMapping = new SSARegMap();
+ RegInfo = new MachineRegisterInfo(*TM.getRegisterInfo());
MFInfo = 0;
FrameInfo = new MachineFrameInfo();
ConstantPool = new MachineConstantPool(TM.getTargetData());
- UsedPhysRegs.resize(TM.getRegisterInfo()->getNumRegs());
// Set up jump table.
const TargetData &TD = *TM.getTargetData();
@@ -141,7 +140,7 @@ MachineFunction::MachineFunction(const Function *F,
MachineFunction::~MachineFunction() {
BasicBlocks.clear();
- delete SSARegMapping;
+ delete RegInfo;
delete MFInfo;
delete FrameInfo;
delete ConstantPool;
@@ -208,9 +207,10 @@ void MachineFunction::print(std::ostream &OS) const {
const MRegisterInfo *MRI = getTarget().getRegisterInfo();
- if (!livein_empty()) {
+ if (!RegInfo->livein_empty()) {
OS << "Live Ins:";
- for (livein_iterator I = livein_begin(), E = livein_end(); I != E; ++I) {
+ for (MachineRegisterInfo::livein_iterator
+ I = RegInfo->livein_begin(), E = RegInfo->livein_end(); I != E; ++I) {
if (MRI)
OS << " " << MRI->getName(I->first);
else
@@ -221,9 +221,10 @@ void MachineFunction::print(std::ostream &OS) const {
}
OS << "\n";
}
- if (!liveout_empty()) {
+ if (!RegInfo->liveout_empty()) {
OS << "Live Outs:";
- for (liveout_iterator I = liveout_begin(), E = liveout_end(); I != E; ++I)
+ for (MachineRegisterInfo::liveout_iterator
+ I = RegInfo->liveout_begin(), E = RegInfo->liveout_end(); I != E; ++I)
if (MRI)
OS << " " << MRI->getName(*I);
else
@@ -324,11 +325,6 @@ MachineFunction& MachineFunction::get(const Function *F)
return *mc;
}
-void MachineFunction::clearSSARegMap() {
- delete SSARegMapping;
- SSARegMapping = 0;
-}
-
//===----------------------------------------------------------------------===//
// MachineFrameInfo implementation
//===----------------------------------------------------------------------===//