return Name;
assert(GUIDToFuncNameMap && "GUIDToFuncNameMap needs to be popluated first");
- auto iter = GUIDToFuncNameMap->find(std::stoull(Name.data()));
- if (iter == GUIDToFuncNameMap->end())
- return StringRef();
- return iter->second;
+ return GUIDToFuncNameMap->lookup(std::stoull(Name.data()));
}
/// Returns the line offset to the start line of the subprogram.
// If we have an equals sign, remember the value.
if (EqualPos == StringRef::npos) {
// Look up the option.
- auto I = Sub.OptionsMap.find(Arg);
- if (I == Sub.OptionsMap.end())
- return nullptr;
-
- return I != Sub.OptionsMap.end() ? I->second : nullptr;
+ return Sub.OptionsMap.lookup(Arg);
}
// If the argument before the = is a valid option name and the option allows
}
const Symbol *Object::findSymbol(size_t UniqueId) const {
- auto It = SymbolMap.find(UniqueId);
- if (It == SymbolMap.end())
- return nullptr;
- return It->second;
+ return SymbolMap.lookup(UniqueId);
}
Error Object::removeSymbols(
}
const Section *Object::findSection(ssize_t UniqueId) const {
- auto It = SectionMap.find(UniqueId);
- if (It == SectionMap.end())
- return nullptr;
- return It->second;
+ return SectionMap.lookup(UniqueId);
}
void Object::removeSections(function_ref<bool(const Section &)> ToRemove) {
const CodeGenSubRegIndex *
CodeGenRegBank::findSubRegIdx(const Record* Def) const {
- auto I = Def2SubRegIdx.find(Def);
- return (I == Def2SubRegIdx.end()) ? nullptr : I->second;
+ return Def2SubRegIdx.lookup(Def);
}
CodeGenRegister *CodeGenRegBank::getReg(Record *Def) {
/// getRegisterByName - If there is a register with the specific AsmName,
/// return it.
const CodeGenRegister *CodeGenTarget::getRegisterByName(StringRef Name) const {
- const StringMap<CodeGenRegister*> &Regs = getRegBank().getRegistersByName();
- StringMap<CodeGenRegister*>::const_iterator I = Regs.find(Name);
- if (I == Regs.end())
- return nullptr;
- return I->second;
+ return getRegBank().getRegistersByName().lookup(Name);
}
std::vector<ValueTypeByHwMode> CodeGenTarget::getRegisterVTs(Record *R)
void declareOperand(unsigned InstrID, unsigned OpIdx);
GIMatchTreeInstrInfo *getInstrInfo(unsigned ID) const {
- auto I = InstrIDToInfo.find(ID);
- if (I != InstrIDToInfo.end())
- return I->second;
- return nullptr;
+ return InstrIDToInfo.lookup(ID);
}
void dump(raw_ostream &OS) const {