bugfixes, overlapping lanerecords check

This commit is contained in:
caheckman 2019-10-18 14:01:53 -04:00
parent 04d28bcc4e
commit ce0ab31576
7 changed files with 56 additions and 13 deletions

View file

@ -817,16 +817,33 @@ void Architecture::parseIncidentalCopy(const Element *el)
void Architecture::parseLaneSizes(const Element *el)
{
const List &list(el->getChildren());
const List &childList(el->getChildren());
List::const_iterator iter;
LanedRegister lanedRegister; // Only allocate once
for(iter=list.begin();iter!=list.end();++iter) {
for(iter=childList.begin();iter!=childList.end();++iter) {
if (lanedRegister.restoreXml(*iter, this)) {
lanerecords.push_back(lanedRegister);
}
}
if (lanerecords.empty()) return;
lanerecords.sort();
// Dedup records that are contained by (the following) records
list<LanedRegister>::const_iterator viter = lanerecords.begin();
list<LanedRegister>::const_iterator nextiter = viter;
++nextiter;
while(nextiter != lanerecords.end()) {
if ((*viter).contains(*nextiter)) {
lanerecords.erase(nextiter);
nextiter = viter;
++nextiter;
}
else {
++viter;
++nextiter;
}
}
}
/// Create a stack space and a stack-pointer register from this \<stackpointer> element