-static bool AtomComp(const MCAtom *L, uint64_t Addr) {
- return L->getEndAddr() < Addr;
+static bool AtomComp(const MCAtom *LHS, const MCAtom *RHS) {
+ return LHS->getEndAddr() < RHS->getEndAddr();
+}
+
+MCModule::const_atom_iterator MCModule::atom_lower_bound(uint64_t Addr) const {
+ // This is a dummy atom, because VS 2008 doesn't like asymmetric comparators.
+ MCDataAtom AddrAtom(0, Addr, Addr);
+ return std::lower_bound(atom_begin(), atom_end(), &AddrAtom, AtomComp);
+}
+
+MCModule::atom_iterator MCModule::atom_lower_bound(uint64_t Addr) {
+ MCDataAtom AddrAtom(0, Addr, Addr);
+ return std::lower_bound(atom_begin(), atom_end(), &AddrAtom, AtomComp);