if (si && (si->machInst == mach_inst))
return si;
- DecodeCache::InstMap::iterator iter = instMap.find(mach_inst);
+ auto iter = instMap.find(mach_inst);
if (iter != instMap.end()) {
si = iter->second;
return si;
class BasicDecodeCache
{
private:
- DecodeCache::InstMap instMap;
+ DecodeCache::InstMap<TheISA::ExtMachInst> instMap;
DecodeCache::AddrMap<StaticInstPtr> decodePages;
public:
class Decoder
{
private:
- DecodeCache::InstMap instMap;
+ DecodeCache::InstMap<ExtMachInst> instMap;
bool aligned;
bool mid;
bool more;
StaticInstPtr
Decoder::decode(ExtMachInst mach_inst, Addr addr)
{
- DecodeCache::InstMap::iterator iter = instMap->find(mach_inst);
+ auto iter = instMap->find(mach_inst);
if (iter != instMap->end())
return iter->second;
typedef std::unordered_map<CacheKey, DecodePages *> AddrCacheMap;
AddrCacheMap addrCacheMap;
- DecodeCache::InstMap *instMap;
- typedef std::unordered_map<CacheKey, DecodeCache::InstMap *> InstCacheMap;
+ DecodeCache::InstMap<ExtMachInst> *instMap;
+ typedef std::unordered_map<
+ CacheKey, DecodeCache::InstMap<ExtMachInst> *> InstCacheMap;
static InstCacheMap instCacheMap;
public:
if (imIter != instCacheMap.end()) {
instMap = imIter->second;
} else {
- instMap = new DecodeCache::InstMap;
+ instMap = new DecodeCache::InstMap<ExtMachInst>;
instCacheMap[m5Reg] = instMap;
}
}
{
/// Hash for decoded instructions.
-typedef std::unordered_map<TheISA::ExtMachInst, StaticInstPtr> InstMap;
+template <typename EMI>
+using InstMap = std::unordered_map<EMI, StaticInstPtr>;
/// A sparse map from an Addr to a Value, stored in page chunks.
template<class Value>