/* This file is part of the dynarmic project. * Copyright (c) 2018 MerryMage * This software may be used and distributed according to the terms of the GNU * General Public License version 2 or any later version. */ #include #include #include #include "backend_x64/block_range_information.h" #include "common/common_types.h" namespace Dynarmic { namespace BackendX64 { template void BlockRangeInformation::AddRange(boost::icl::discrete_interval range, IR::LocationDescriptor location) { block_ranges.add(std::make_pair(range, std::set{location})); } template void BlockRangeInformation::ClearCache() { block_ranges.clear(); } template std::unordered_set BlockRangeInformation::InvalidateRanges(const boost::icl::interval_set& ranges) { std::unordered_set erase_locations; for (auto invalidate_interval : ranges) { auto pair = block_ranges.equal_range(invalidate_interval); for (auto it = pair.first; it != pair.second; ++it) { for (const auto &descriptor : it->second) { erase_locations.insert(descriptor); } } } // TODO: EFFICIENCY: Remove ranges that are to be erased. return erase_locations; } template class BlockRangeInformation; template class BlockRangeInformation; } // namespace BackendX64 } // namespace Dynarmic