[llvm-commits] [regalloc_linearscan] CVS: llvm/lib/CodeGen/LiveIntervals.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Tue Nov 4 01:58:03 PST 2003
Changes in directory llvm/lib/CodeGen:
LiveIntervals.cpp updated: 1.1.2.4 -> 1.1.2.5
---
Log message:
Change private member variable names to have a trailing rather than a leading underscore.
---
Diffs of the changes: (+24 -24)
Index: llvm/lib/CodeGen/LiveIntervals.cpp
diff -u llvm/lib/CodeGen/LiveIntervals.cpp:1.1.2.4 llvm/lib/CodeGen/LiveIntervals.cpp:1.1.2.5
--- llvm/lib/CodeGen/LiveIntervals.cpp:1.1.2.4 Sun Oct 26 20:37:58 2003
+++ llvm/lib/CodeGen/LiveIntervals.cpp Tue Nov 4 01:57:28 2003
@@ -53,24 +53,24 @@
///
bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) {
DEBUG(std::cerr << "Machine Function\n");
- _mf = &fn;
- _tm = &fn.getTarget();
- _mri = _tm->getRegisterInfo();
- _lv = &getAnalysis<LiveVariables>();
+ mf_ = &fn;
+ tm_ = &fn.getTarget();
+ mri_ = tm_->getRegisterInfo();
+ lv_ = &getAnalysis<LiveVariables>();
// number MachineInstrs
unsigned miIndex = 0;
- for (MachineFunction::iterator mbb = _mf->begin(), mbbEnd = _mf->end();
+ for (MachineFunction::iterator mbb = mf_->begin(), mbbEnd = mf_->end();
mbb != mbbEnd; ++mbb) {
const std::pair<MachineBasicBlock*, unsigned>& entry =
- _lv->getMachineBasicBlockInfo(&*mbb);
- bool inserted = _i2mbbMap.insert(std::make_pair(entry.second,
+ lv_->getMachineBasicBlockInfo(&*mbb);
+ bool inserted = i2mbbMap_.insert(std::make_pair(entry.second,
entry.first)).second;
assert(inserted && "multiple index -> MachineBasicBlock");
for (MachineBasicBlock::iterator mi = mbb->begin(), miEnd = mbb->end();
mi != miEnd; ++mi) {
- inserted = _mi2iMap.insert(std::make_pair(*mi, miIndex++)).second;
+ inserted = mi2iMap_.insert(std::make_pair(*mi, miIndex++)).second;
assert(inserted && "multiple MachineInstr -> index mappings");
}
}
@@ -94,35 +94,35 @@
MachineInstr* instr,
unsigned reg)
{
- DEBUG(std::cerr << "\t\t\tregister: "; printRegName(_mri, reg));
+ DEBUG(std::cerr << "\t\t\tregister: "; printRegName(mri_, reg));
unsigned start = getInstructionIndex(instr);
- LiveVariables::VarInfo& vi = _lv->getVarInfo(reg);
+ LiveVariables::VarInfo& vi = lv_->getVarInfo(reg);
- Reg2IntervalMap::iterator r2iit = _r2iMap.find(reg);
- if (r2iit != _r2iMap.end()) {
+ Reg2IntervalMap::iterator r2iit = r2iMap_.find(reg);
+ if (r2iit != r2iMap_.end()) {
unsigned ii = r2iit->second;
- Interval& interval = _intervals[ii];
+ Interval& interval = intervals_[ii];
unsigned end = getInstructionIndex(mbb->back()) + 1;
interval.addRange(start, end);
DEBUG(std::cerr << " -> " << interval << '\n');
}
else {
// add new interval
- _intervals.push_back(Interval(reg));
- Interval& interval = _intervals.back();
+ intervals_.push_back(Interval(reg));
+ Interval& interval = intervals_.back();
// update interval index for this register
- _r2iMap[reg] = _intervals.size() - 1;
+ r2iMap_[reg] = intervals_.size() - 1;
- unsigned index = _lv->getMachineBasicBlockInfo(mbb).second;
+ unsigned index = lv_->getMachineBasicBlockInfo(mbb).second;
if (index < vi.AliveBlocks.size() && vi.AliveBlocks[index]) {
unsigned end = getInstructionIndex(mbb->back()) + 1;
interval.addRange(start, end);
}
for (Index2MbbMap::iterator
- it = _i2mbbMap.begin(), itEnd = _i2mbbMap.end();
+ it = i2mbbMap_.begin(), itEnd = i2mbbMap_.end();
it != itEnd; ++it) {
unsigned mbbIndex = it->first;
MachineBasicBlock* mbb2 = it->second;
@@ -145,9 +145,9 @@
unsigned LiveIntervals::getInstructionIndex(MachineInstr* instr)
{
- assert(_mi2iMap.find(instr) != _mi2iMap.end() &&
+ assert(mi2iMap_.find(instr) != mi2iMap_.end() &&
"instruction not assigned a number");
- return _mi2iMap.find(instr)->second;
+ return mi2iMap_.find(instr)->second;
}
/// computeIntervals - computes the live intervals for virtual
@@ -158,7 +158,7 @@
{
DEBUG(std::cerr << "computing live intervals:\n");
- for (Index2MbbMap::iterator it = _i2mbbMap.begin(), itEnd = _i2mbbMap.end();
+ for (Index2MbbMap::iterator it = i2mbbMap_.begin(), itEnd = i2mbbMap_.end();
it != itEnd; ++it) {
MachineBasicBlock* mbb = it->second;
DEBUG(std::cerr << "machine basic block: "
@@ -167,9 +167,9 @@
mi != miEnd; ++mi) {
MachineInstr* instr = *mi;
const TargetInstrDescriptor& tid =
- _tm->getInstrInfo().get(instr->getOpcode());
+ tm_->getInstrInfo().get(instr->getOpcode());
DEBUG(std::cerr << "\t\tinstruction["
- << _mi2iMap.find(instr)->second << "]: "
+ << mi2iMap_.find(instr)->second << "]: "
<< *instr << '\n');
for (int i = instr->getNumOperands() - 1; i >= 0; --i) {
@@ -187,6 +187,6 @@
}
}
- DEBUG(std::copy(_intervals.begin(), _intervals.end(),
+ DEBUG(std::copy(intervals_.begin(), intervals_.end(),
std::ostream_iterator<Interval>(std::cerr, "\n")));
}
More information about the llvm-commits
mailing list