Commit d916b72c authored by Julien Balette-Pape's avatar Julien Balette-Pape

retour set + abandon pointeurs: fonctionne

parent 701cfa6d
......@@ -3,23 +3,23 @@
#include <otawa/icache/features.h>
#include <otawa/icat3/features.h>
#include <otawa/base.h>
#include <unordered_set>
#include <set>
namespace lrusecurity
{
class ACSSecurity : public elm::AllocArray<std::unordered_set <otawa::Address *>>
class ACSSecurity : public elm::AllocArray<std::set <otawa::Address>>
{
public:
ACSSecurity() = default;
ACSSecurity(int n) : elm::AllocArray<std::unordered_set <otawa::Address *>>(n){
ACSSecurity(int n) : elm::AllocArray<std::set <otawa::Address>>(n){
for (int i = 0; i < n; i++)
(*this)[i] = std::unordered_set <otawa::Address *>();
(*this)[i] = std::set <otawa::Address>();
}
ACSSecurity(int n, otawa::Address addr) : elm::AllocArray<std::unordered_set <otawa::Address *>>(n) {
ACSSecurity(int n, otawa::Address addr) : elm::AllocArray<std::set <otawa::Address>>(n) {
for (int i = 0; i < n; i++){
(*this)[i] = std::unordered_set <otawa::Address *>();
(*this)[i].insert({&addr});
(*this)[i] = std::set <otawa::Address>();
(*this)[i].insert(addr);
}
}
void print(int set, const otawa::icat3::LBlockCollection& coll, elm::io::Output& out= elm::cout) const;
......
#include "ExistHitPrevDomain.h"
#include <set>
using namespace otawa;
......@@ -41,11 +42,11 @@ bool ExistHitPrevDomain::equals(const t& acss, const t& bcss) const
int b = lb->index();
for (int i = 0; i < _n; i++){
if (i == b){
Address smol[] = {access.address()};
acss[i] = std::unordered_set<otawa::Address *>();
Address smol = access.address();
acss[i] = std::set<otawa::Address>();
acss[i].insert(smol);
} else if (ehManager.existHitAge(_coll[_set][i]) == _A)
acss[i] = std::unordered_set<otawa::Address *>();
acss[i] = std::set<otawa::Address>();
}
}
......
#include "ExistHitPrevODomain.h"
#include <unordered_set>
#include <set>
using namespace otawa;
......@@ -50,17 +50,11 @@ void ExistHitPrevODomain::fetch(t& acss, const icache::Access& access, lrupreana
int b = lb->index();
for (int i = 0; i < _n; i++){
if (i == b){
Address smol[] = {access.address()};
<<<<<<< HEAD
acss[i] = Bag<Address>(1, smol);
} else if (mayManager.mayAge(_coll[_set][i]) == _A)
acss[i] = Bag<Address>();
=======
acss[i] = std::unordered_set<otawa::Address *>();
Address smol = access.address();
acss[i] = std::set<otawa::Address>();
acss[i].insert(smol);
} else if (mayManager.mayAge(_coll[_set][i]) == _A)
acss[i] = std::unordered_set<otawa::Address *>();
>>>>>>> passage aux unordered set
acss[i] = std::set<otawa::Address>();
}
}
......
#include "ExistHitPrevUDomain.h"
#include <unordered_set>
#include <set>
using namespace otawa;
......@@ -46,11 +46,11 @@ void ExistHitPrevUDomain::fetch(t& acss, const icache::Access& access, lrupreana
int b = lb->index();
for (int i = 0; i < _n; i++){
if (i == b){
Address smol[] = {access.address()};
acss[i] = std::unordered_set<otawa::Address *>();
Address smol = access.address();
acss[i] = std::set<otawa::Address>();
acss[i].insert(smol);
} else if (ehManager.existHitAge(_coll[_set][i]) == _A)
acss[i] = std::unordered_set<otawa::Address *>();
acss[i] = std::set<otawa::Address>();
}
}
......
......@@ -6,7 +6,7 @@
#include <otawa/proc/BBProcessor.h>
#include <otawa/prog/Process.h>
#include <lruexact/features.h>
#include <unordered_set>
#include <set>
#include<iterator>
//#include "SecCFGOutput.h"
using namespace otawa;
......@@ -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::unordered_set<otawa::Address *>::iterator iter;
std::set<otawa::Address>::iterator iter;
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";
}
// 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