Skip to content
Snippets Groups Projects
Commit 2a190e00 authored by MDM's avatar MDM
Browse files
parents e873767b 8dd06ace
No related branches found
No related tags found
No related merge requests found
......@@ -75,8 +75,8 @@ XCFGVisitor<D>::XCFGVisitor(const CFGCollection& _cfgs, D& domain)
// Record nodes and CFG next nodes
int bbi = 0, cfgi = 0;
for(CFGCollection::Iter cfg(cfgs); cfg; cfg++, cfgi++)
for(CFG::BlockIter bb = cfg->blocks(); bb; bb++, bbi++) {
for(CFGCollection::Iter cfg(cfgs); cfg(); cfg++, cfgi++)
for(CFG::BlockIter bb = cfg->blocks(); bb(); bb++, bbi++) {
nodes[bbi].bb = bb;
nodes[bbi].cfg = cfgi;
if(bb->isSynth()) {
......@@ -94,7 +94,7 @@ template <class D>
XCFGVisitor<D>::~XCFGVisitor(void) {
// Release INDEX on CFGs
for(CFGCollection::Iter cfg(cfgs); cfg; cfg++)
for(CFGCollection::Iter cfg(cfgs); cfg(); cfg++)
cfg->removeProp(&INDEX);
// Free memory
......@@ -115,7 +115,7 @@ void XCFGVisitor<D>::visitPreds(XIterativeDFA< XCFGVisitor<D> >& engine, int nod
else if(info.from != -1)
engine.nextPred(info.from);
else
for(BasicBlock::EdgeIter edge = info.bb->ins(); edge; edge++)
for(BasicBlock::EdgeIter edge = info.bb->ins(); edge(); edge++)
engine.nextPred(offs[info.cfg] + edge->source()->index());
}
......
......@@ -273,7 +273,7 @@ inline int WideningFixPoint<Listener>::collect2(Block* bb, const GC *gc) const {
// mark all the states on edge going out from bb
int i = 0;
for(Block::EdgeIter out = bb->ins(); out; out++) {
for(Block::EdgeIter out = bb->ins(); out(); out++) {
typename Listener::Problem::Domain* s = *STATE(*out);
if (s != 0) {
s->collect(gc);
......
......@@ -65,7 +65,7 @@ public:
: _prob(prob), _set(set), _id(id) {
const CFGCollection *col = INVOLVED_CFGS(ws);
for(int i = 0; i < col->count(); i++)
for(CFG::BlockIter bb = col->get(i)->blocks(); bb; bb++)
for(CFG::BlockIter bb = col->get(i)->blocks(); bb(); bb++)
prob.init(_id(bb)[_set], prob.bottom());
}
......
......@@ -222,10 +222,16 @@ void ILPGenerator::sortEvents(Vector<EventCase>& events) {
class EventCaseComparator {
public:
static inline int compare(const EventCase& c1, const EventCase& c2) {
if(c1.part() != c2.part())
if(c1.part() != c2.part()){
return c1.part() - c2.part();
else
}
else{
if (c1.event()->inst()->address() != c2.event()->inst()->address())
return c1.event()->inst()->address().compare(c2.event()->inst()->address());
else
//return reinterpret_cast<intptr_t>(c2.event()->unit()) - reinterpret_cast<intptr_t>(c1.event()->unit());
return -Comparator<const hard::PipelineUnit *>::compare(c2.event()->unit(),c1.event()->unit());
}
}
};
elm::quicksort(events, EventCaseComparator());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment