mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-20 12:31:40 +00:00
Add more constness to CodeGenRegisters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153667 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
41e2073f62
commit
c6a96ff6ae
@ -231,7 +231,7 @@ CodeGenRegister::getSubRegs(CodeGenRegBank &RegBank) {
|
||||
}
|
||||
|
||||
void
|
||||
CodeGenRegister::addSubRegsPreOrder(SetVector<CodeGenRegister*> &OSet,
|
||||
CodeGenRegister::addSubRegsPreOrder(SetVector<const CodeGenRegister*> &OSet,
|
||||
CodeGenRegBank &RegBank) const {
|
||||
assert(SubRegsComplete && "Must precompute sub-registers");
|
||||
std::vector<Record*> Indices = TheDef->getValueAsListOfDefs("SubRegIndices");
|
||||
@ -1095,7 +1095,7 @@ CodeGenRegBank::getRegClassForRegister(Record *R) {
|
||||
}
|
||||
|
||||
BitVector CodeGenRegBank::computeCoveredRegisters(ArrayRef<Record*> Regs) {
|
||||
SetVector<CodeGenRegister*> Set;
|
||||
SetVector<const CodeGenRegister*> Set;
|
||||
|
||||
// First add Regs with all sub-registers.
|
||||
for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
|
||||
@ -1110,7 +1110,7 @@ BitVector CodeGenRegBank::computeCoveredRegisters(ArrayRef<Record*> Regs) {
|
||||
for (unsigned i = 0; i != Set.size(); ++i) {
|
||||
const CodeGenRegister::SuperRegList &SR = Set[i]->getSuperRegs();
|
||||
for (unsigned j = 0, e = SR.size(); j != e; ++j) {
|
||||
CodeGenRegister *Super = SR[j];
|
||||
const CodeGenRegister *Super = SR[j];
|
||||
if (!Super->CoveredBySubRegs || Set.count(Super))
|
||||
continue;
|
||||
// This new super-register is covered by its sub-registers.
|
||||
|
@ -110,11 +110,11 @@ namespace llvm {
|
||||
}
|
||||
|
||||
// Add sub-registers to OSet following a pre-order defined by the .td file.
|
||||
void addSubRegsPreOrder(SetVector<CodeGenRegister*> &OSet,
|
||||
void addSubRegsPreOrder(SetVector<const CodeGenRegister*> &OSet,
|
||||
CodeGenRegBank&) const;
|
||||
|
||||
// List of super-registers in topological order, small to large.
|
||||
typedef std::vector<CodeGenRegister*> SuperRegList;
|
||||
typedef std::vector<const CodeGenRegister*> SuperRegList;
|
||||
|
||||
// Get the list of super-registers.
|
||||
// This is only valid after computeDerivedInfo has visited all registers.
|
||||
|
@ -306,7 +306,7 @@ RegisterInfoEmitter::runMCDesc(raw_ostream &OS, CodeGenTarget &Target,
|
||||
if (Reg.getSubRegs().empty())
|
||||
continue;
|
||||
// getSubRegs() orders by SubRegIndex. We want a topological order.
|
||||
SetVector<CodeGenRegister*> SR;
|
||||
SetVector<const CodeGenRegister*> SR;
|
||||
Reg.addSubRegsPreOrder(SR, RegBank);
|
||||
OS << " /* " << Reg.getName() << "_SubRegsSet */ ";
|
||||
for (unsigned j = 0, je = SR.size(); j != je; ++j)
|
||||
@ -351,7 +351,7 @@ RegisterInfoEmitter::runMCDesc(raw_ostream &OS, CodeGenTarget &Target,
|
||||
OS << "/* " << Reg->getName() << "_SubRegsSet */ " << SubRegIndex
|
||||
<< ", ";
|
||||
// FIXME not very nice to recalculate this
|
||||
SetVector<CodeGenRegister*> SR;
|
||||
SetVector<const CodeGenRegister*> SR;
|
||||
Reg->addSubRegsPreOrder(SR, RegBank);
|
||||
SubRegIndex += SR.size() + 1;
|
||||
} else
|
||||
|
Loading…
x
Reference in New Issue
Block a user