diff --git a/ir/memory.cpp b/ir/memory.cpp index d9959c9aa..6e7ba323d 100644 --- a/ir/memory.cpp +++ b/ir/memory.cpp @@ -918,9 +918,9 @@ Memory::AliasSet Memory::computeAliasing(const Pointer &ptr, unsigned bytes, return aliasing; } -template void Memory::access(const Pointer &ptr, unsigned bytes, uint64_t align, - bool write, Fn &fn) { + bool write, const + function &fn) { auto aliasing = computeAliasing(ptr, bytes, align, write); unsigned has_local = aliasing.numMayAlias(true); unsigned has_nonlocal = aliasing.numMayAlias(false); @@ -972,12 +972,12 @@ vector Memory::load(const Pointer &ptr, unsigned bytes, set &undef, expr offset = ptr.getShortOffset(); unsigned off_bits = Pointer::bitsShortOffset(); - auto fn = [&](const MemBlock &blk, unsigned bid, bool local, expr &&cond) { + auto fn = [&](MemBlock &blk, unsigned bid, bool local, expr &&cond) { bool is_poison = (type & blk.type) == DATA_NONE; for (unsigned i = 0; i < loaded_bytes; ++i) { unsigned idx = left2right ? i : (loaded_bytes - i - 1); expr off = offset + expr::mkUInt(idx, off_bits); - loaded[i].add(is_poison ? poison : blk.val.load(off), std::move(cond)); + loaded[i].add(is_poison ? poison : blk.val.load(off), cond); if (!is_poison) undef.insert(blk.undef.begin(), blk.undef.end()); } diff --git a/ir/memory.h b/ir/memory.h index d04e0bc70..256975282 100644 --- a/ir/memory.h +++ b/ir/memory.h @@ -179,9 +179,9 @@ class Memory { AliasSet computeAliasing(const Pointer &ptr, unsigned bytes, uint64_t align, bool write) const; - template void access(const Pointer &ptr, unsigned btyes, uint64_t align, bool write, - Fn &fn); + const std::function &fn); std::vector load(const Pointer &ptr, unsigned bytes, std::set &undef, uint64_t align,