aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/CodeGen/RegAlloc/LiveRangeInfo.cpp23
-rw-r--r--lib/CodeGen/RegAlloc/LiveRangeInfo.h13
-rw-r--r--lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp23
-rw-r--r--lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h13
4 files changed, 24 insertions, 48 deletions
diff --git a/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp b/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp
index bb1b0bb089..f8e4b4f3a9 100644
--- a/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp
+++ b/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp
@@ -205,24 +205,19 @@ void LiveRangeInfo::constructLiveRanges() {
// 1) suggest colors for call and return args.
// 2) create new LRs for implicit defs in machine instructions
//---------------------------------------------------------------------------
-void LiveRangeInfo::suggestRegs4CallRets()
-{
- CallRetInstrListType::iterator It = CallRetInstrList.begin();
- for( ; It != CallRetInstrList.end(); ++It ) {
-
+void LiveRangeInfo::suggestRegs4CallRets() {
+ std::vector<MachineInstr*>::iterator It = CallRetInstrList.begin();
+ for( ; It != CallRetInstrList.end(); ++It) {
MachineInstr *MInst = *It;
- MachineOpCode OpCode = MInst->getOpCode();
+ MachineOpCode OpCode = MInst->getOpCode();
- if( (TM.getInstrInfo()).isReturn(OpCode) )
- MRI.suggestReg4RetValue( MInst, *this);
-
- else if( (TM.getInstrInfo()).isCall( OpCode ) )
- MRI.suggestRegs4CallArgs( MInst, *this);
-
+ if ((TM.getInstrInfo()).isReturn(OpCode))
+ MRI.suggestReg4RetValue(MInst, *this);
+ else if ((TM.getInstrInfo()).isCall(OpCode))
+ MRI.suggestRegs4CallArgs(MInst, *this);
else
- assert( 0 && "Non call/ret instr in CallRetInstrList" );
+ assert( 0 && "Non call/ret instr in CallRetInstrList" );
}
-
}
diff --git a/lib/CodeGen/RegAlloc/LiveRangeInfo.h b/lib/CodeGen/RegAlloc/LiveRangeInfo.h
index 48abdc0da5..05e9aa8510 100644
--- a/lib/CodeGen/RegAlloc/LiveRangeInfo.h
+++ b/lib/CodeGen/RegAlloc/LiveRangeInfo.h
@@ -32,7 +32,6 @@ class Function;
class Instruction;
typedef hash_map<const Value*, LiveRange*> LiveRangeMapType;
-typedef std::vector<MachineInstr*> CallRetInstrListType;
//----------------------------------------------------------------------------
// Class LiveRangeInfo
@@ -53,7 +52,7 @@ class LiveRangeInfo {
const MachineRegInfo& MRI; // machine reg info
- CallRetInstrListType CallRetInstrList; // a list of all call/ret instrs
+ std::vector<MachineInstr*> CallRetInstrList; // a list of all call/ret instrs
//------------ Private methods (see LiveRangeInfo.cpp for description)-------
@@ -90,20 +89,14 @@ public:
// return the common live range map for this method
//
- inline const LiveRangeMapType *const getLiveRangeMap() const
+ inline const LiveRangeMapType *getLiveRangeMap() const
{ return &LiveRangeMap; }
// Method sed to get the corresponding live range of a Value
//
- inline LiveRange *getLiveRangeForValue( const Value *const Val)
+ inline LiveRange *getLiveRangeForValue( const Value *Val)
{ return LiveRangeMap[Val]; }
- // Method used to get the Call and Return instruction list
- //
- inline CallRetInstrListType &getCallRetInstrList() {
- return CallRetInstrList;
- }
-
// Method for coalescing live ranges. Called only after interference info
// is calculated.
//
diff --git a/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp b/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp
index bb1b0bb089..f8e4b4f3a9 100644
--- a/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp
+++ b/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp
@@ -205,24 +205,19 @@ void LiveRangeInfo::constructLiveRanges() {
// 1) suggest colors for call and return args.
// 2) create new LRs for implicit defs in machine instructions
//---------------------------------------------------------------------------
-void LiveRangeInfo::suggestRegs4CallRets()
-{
- CallRetInstrListType::iterator It = CallRetInstrList.begin();
- for( ; It != CallRetInstrList.end(); ++It ) {
-
+void LiveRangeInfo::suggestRegs4CallRets() {
+ std::vector<MachineInstr*>::iterator It = CallRetInstrList.begin();
+ for( ; It != CallRetInstrList.end(); ++It) {
MachineInstr *MInst = *It;
- MachineOpCode OpCode = MInst->getOpCode();
+ MachineOpCode OpCode = MInst->getOpCode();
- if( (TM.getInstrInfo()).isReturn(OpCode) )
- MRI.suggestReg4RetValue( MInst, *this);
-
- else if( (TM.getInstrInfo()).isCall( OpCode ) )
- MRI.suggestRegs4CallArgs( MInst, *this);
-
+ if ((TM.getInstrInfo()).isReturn(OpCode))
+ MRI.suggestReg4RetValue(MInst, *this);
+ else if ((TM.getInstrInfo()).isCall(OpCode))
+ MRI.suggestRegs4CallArgs(MInst, *this);
else
- assert( 0 && "Non call/ret instr in CallRetInstrList" );
+ assert( 0 && "Non call/ret instr in CallRetInstrList" );
}
-
}
diff --git a/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h b/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h
index 48abdc0da5..05e9aa8510 100644
--- a/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h
+++ b/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h
@@ -32,7 +32,6 @@ class Function;
class Instruction;
typedef hash_map<const Value*, LiveRange*> LiveRangeMapType;
-typedef std::vector<MachineInstr*> CallRetInstrListType;
//----------------------------------------------------------------------------
// Class LiveRangeInfo
@@ -53,7 +52,7 @@ class LiveRangeInfo {
const MachineRegInfo& MRI; // machine reg info
- CallRetInstrListType CallRetInstrList; // a list of all call/ret instrs
+ std::vector<MachineInstr*> CallRetInstrList; // a list of all call/ret instrs
//------------ Private methods (see LiveRangeInfo.cpp for description)-------
@@ -90,20 +89,14 @@ public:
// return the common live range map for this method
//
- inline const LiveRangeMapType *const getLiveRangeMap() const
+ inline const LiveRangeMapType *getLiveRangeMap() const
{ return &LiveRangeMap; }
// Method sed to get the corresponding live range of a Value
//
- inline LiveRange *getLiveRangeForValue( const Value *const Val)
+ inline LiveRange *getLiveRangeForValue( const Value *Val)
{ return LiveRangeMap[Val]; }
- // Method used to get the Call and Return instruction list
- //
- inline CallRetInstrListType &getCallRetInstrList() {
- return CallRetInstrList;
- }
-
// Method for coalescing live ranges. Called only after interference info
// is calculated.
//