aboutsummaryrefslogtreecommitdiff
path: root/llvm/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
commita10fff51d9d6bdf99676dd432fa5c528b83c51bd (patch)
tree957128c29e4626b83ff766059545b58e0b7a6a3e /llvm/lib/CodeGen/MachineFunction.cpp
parent1f35454e991034305e3b9de014e1efcddd3986e1 (diff)
downloadllvm-a10fff51d9d6bdf99676dd432fa5c528b83c51bd.zip
llvm-a10fff51d9d6bdf99676dd432fa5c528b83c51bd.tar.gz
llvm-a10fff51d9d6bdf99676dd432fa5c528b83c51bd.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. llvm-svn: 45467
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index 037e3e4..595159b 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/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
//===----------------------------------------------------------------------===//