Commit 4a31ac62 authored by Julien Balette-Pape's avatar Julien Balette-Pape

fix const

parent 0fb3a276
......@@ -7,24 +7,26 @@
namespace lrusecurity
{
/*
struct Compa_access
{
bool operator()(const otawa::icache::Access a, const otawa::icache::Access b) const {return &a < &b;}
};
*/
class ACSSecurity : public elm::AllocArray<std::set <otawa::icache::Access, Compa_access>>
class ACSSecurity : public elm::AllocArray<std::set <const otawa::icache::Access *>>
{
public:
ACSSecurity() = default;
ACSSecurity(int n) : elm::AllocArray<std::set <otawa::icache::Access, Compa_access>>(n){
ACSSecurity(int n) : elm::AllocArray<std::set <const otawa::icache::Access *>>(n){
for (int i = 0; i < n; i++)
(*this)[i] = std::set <otawa::icache::Access, Compa_access>();
(*this)[i] = std::set <const otawa::icache::Access *>();
}
ACSSecurity(int n, otawa::icache::Access access) : elm::AllocArray<std::set <otawa::icache::Access, Compa_access>>(n) {
ACSSecurity(int n, const otawa::icache::Access access) : elm::AllocArray<std::set <const otawa::icache::Access *>>(n) {
for (int i = 0; i < n; i++){
(*this)[i] = std::set <otawa::icache::Access, Compa_access>();
(*this)[i].insert(access);
(*this)[i] = std::set <const otawa::icache::Access *>();
(*this)[i].insert(&access);
}
}
void print(int set, const otawa::icat3::LBlockCollection& coll, elm::io::Output& out= elm::cout) const;
......
......@@ -42,10 +42,10 @@ bool ExistHitPrevDomain::equals(const t& acss, const t& bcss) const
int b = lb->index();
for (int i = 0; i < _n; i++){
if (i == b){
acss[i] = std::set<otawa::icache::Access, Compa_access>();
acss[i].insert(access);
acss[i] = std::set<const otawa::icache::Access *>();
acss[i].insert(&access);
} else if (ehManager.existHitAge(_coll[_set][i]) == _A)
acss[i] = std::set<otawa::icache::Access, Compa_access>();
acss[i] = std::set<const otawa::icache::Access *>();
}
}
......
......@@ -42,10 +42,10 @@ void ExistHitPrevODomain::fetch(t& acss, const icache::Access& access, lrupreana
int b = lb->index();
for (int i = 0; i < _n; i++){
if (i == b){
acss[i] = std::set<otawa::icache::Access, Compa_access>();
acss[i].insert(access);
acss[i] = std::set<const otawa::icache::Access *>();
acss[i].insert(&access);
} else if (mayManager.mayAge(_coll[_set][i]) == _A)
acss[i] = std::set<otawa::icache::Access, Compa_access>();
acss[i] = std::set<const otawa::icache::Access *>();
}
}
......
......@@ -46,10 +46,10 @@ void ExistHitPrevUDomain::fetch(t& acss, const icache::Access& access, lrupreana
int b = lb->index();
for (int i = 0; i < _n; i++){
if (i == b){
acss[i] = std::set<otawa::icache::Access, Compa_access>();
acss[i].insert(access);
acss[i] = std::set<const otawa::icache::Access *>();
acss[i].insert(&access);
} else if (ehManager.existHitAge(_coll[_set][i]) == _A)
acss[i] = std::set<otawa::icache::Access, Compa_access>();
acss[i] = std::set<const otawa::icache::Access *>();
}
}
......
......@@ -113,10 +113,10 @@ protected:
ACSSecurity prev = (*EXIST_HIT_PREV_IN(bb))[set];
int index = otawa::icat3::LBLOCK(access)->index();
number = prev[index].size();
std::set<otawa::Address>::iterator iter;
std::set<const otawa::icache::Access *>::iterator iter;
for (iter = prev[index].begin(); iter != prev[index].end(); iter++){
_out << *iter << "\n\t\t\t\t\b";
_out << (**iter).address() << "\n\t\t\t\t\b";
}
// REMONTEE
......
Markdown is supported
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