Changeset 4444 for icGREP


Ignore:
Timestamp:
Jan 27, 2015, 2:37:36 PM (5 years ago)
Author:
nmedfort
Message:

Swapped boost flat_set for stl vector in PabloAST

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/pabloAST.h

    r4443 r4444  
    1010#include <llvm/Support/Casting.h>
    1111#include <llvm/Support/Compiler.h>
    12 #include <boost/container/flat_set.hpp>
     12#include <vector>
    1313#include <slab_allocator.h>
    1414#include <iterator>
     
    3131public:
    3232
    33     using Users = boost::container::flat_set<PabloAST *>;
     33    using Users = std::vector<PabloAST*>;
    3434    using user_iterator = Users::iterator;
    3535    using const_user_iterator = Users::const_iterator;
     
    106106    inline void addUser(PabloAST * user) {
    107107        assert (user);
    108         mUsers.insert(user);
     108        auto pos = std::lower_bound(mUsers.begin(), mUsers.end(), user);
     109        if (LLVM_UNLIKELY(pos != mUsers.end() && *pos == user)) {
     110            return;
     111        }
     112        mUsers.insert(pos, user);
    109113    }
    110114    inline void removeUser(PabloAST * user) {
    111115        assert (user);
    112         auto pos = mUsers.find(user);
    113         if (LLVM_UNLIKELY(pos == mUsers.end())) {
     116        auto pos = std::lower_bound(mUsers.begin(), mUsers.end(), user);
     117        if (LLVM_UNLIKELY(pos == mUsers.end() || *pos != user)) {
    114118            return;
    115119        }
Note: See TracChangeset for help on using the changeset viewer.