Commit 76d900ba authored by Julien Balette-Pape's avatar Julien Balette-Pape
Browse files

debug continue

parent d0e23d58
...@@ -9,7 +9,7 @@ namespace lrusecurity ...@@ -9,7 +9,7 @@ namespace lrusecurity
{ {
struct Ptr_addr_comparator struct Ptr_addr_comparator
{ {
bool operator()(const otawa::Address* a, const otawa::Address*b ) const {return *a < *b;} bool operator()(const otawa::Address* a, const otawa::Address* b ) const {return *a < *b;}
}; };
class ACSSecurity : public elm::AllocArray<std::set <otawa::Address *, Ptr_addr_comparator>> class ACSSecurity : public elm::AllocArray<std::set <otawa::Address *, Ptr_addr_comparator>>
...@@ -22,8 +22,10 @@ namespace lrusecurity ...@@ -22,8 +22,10 @@ namespace lrusecurity
(*this)[i] = std::set <otawa::Address *, Ptr_addr_comparator>(); (*this)[i] = std::set <otawa::Address *, Ptr_addr_comparator>();
} }
ACSSecurity(int n, otawa::Address addr) : elm::AllocArray<std::set <otawa::Address *, Ptr_addr_comparator>>(n) { ACSSecurity(int n, otawa::Address addr) : elm::AllocArray<std::set <otawa::Address *, Ptr_addr_comparator>>(n) {
for (int i = 0; i < n; i++) for (int i = 0; i < n; i++){
(*this)[i] = std::set <otawa::Address *, Ptr_addr_comparator>({&addr}); (*this)[i] = std::set <otawa::Address *, Ptr_addr_comparator>();
(*this)[i].insert({&addr});
}
} }
void print(int set, const otawa::icat3::LBlockCollection& coll, elm::io::Output& out= elm::cout) const; void print(int set, const otawa::icat3::LBlockCollection& coll, elm::io::Output& out= elm::cout) const;
}; };
......
...@@ -113,13 +113,12 @@ protected: ...@@ -113,13 +113,12 @@ protected:
ACSSecurity prev = (*EXIST_HIT_PREV_IN(bb))[set]; ACSSecurity prev = (*EXIST_HIT_PREV_IN(bb))[set];
int index = otawa::icat3::LBLOCK(access)->index(); int index = otawa::icat3::LBLOCK(access)->index();
number = prev[index].size(); number = prev[index].size();
std::set<otawa::Address *, Ptr_addr_comparator>::iterator iter = prev[index].begin(); std::set<otawa::Address *, Ptr_addr_comparator>::iterator iter;
int debug = 1; int debug = 0; //FIXME
while (iter != prev[index].end()){ for (iter = prev[index].begin(); iter != prev[index].end(); iter++){
_out << *(*iter) << "\n\t\t\t\t\b"; _out << *(*iter) << "\n\t\t\t\t\b";
iter++;
_out << debug;
debug++; debug++;
_out << debug;
} }
// REMONTEE // REMONTEE
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment