mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
[Analysis, IR] Use *Map::lookup (NFC)
This commit is contained in:
parent
db085a4bfd
commit
d6be2b089a
@ -815,8 +815,7 @@ void RegionInfoBase<Tr>::verifyAnalysis() const {
|
||||
// Region pass manager support.
|
||||
template <class Tr>
|
||||
typename Tr::RegionT *RegionInfoBase<Tr>::getRegionFor(BlockT *BB) const {
|
||||
typename BBtoRegionMap::const_iterator I = BBtoRegion.find(BB);
|
||||
return I != BBtoRegion.end() ? I->second : nullptr;
|
||||
return BBtoRegion.lookup(BB);
|
||||
}
|
||||
|
||||
template <class Tr>
|
||||
|
@ -655,11 +655,7 @@ public:
|
||||
/// \returns nullptr if contains no such member.
|
||||
InstTy *getMember(uint32_t Index) const {
|
||||
int32_t Key = SmallestKey + Index;
|
||||
auto Member = Members.find(Key);
|
||||
if (Member == Members.end())
|
||||
return nullptr;
|
||||
|
||||
return Member->second;
|
||||
return Members.lookup(Key);
|
||||
}
|
||||
|
||||
/// Get the index for the given member. Unlike the key in the member
|
||||
@ -777,9 +773,7 @@ public:
|
||||
/// \returns nullptr if doesn't have such group.
|
||||
InterleaveGroup<Instruction> *
|
||||
getInterleaveGroup(const Instruction *Instr) const {
|
||||
if (InterleaveGroupMap.count(Instr))
|
||||
return InterleaveGroupMap.find(Instr)->second;
|
||||
return nullptr;
|
||||
return InterleaveGroupMap.lookup(Instr);
|
||||
}
|
||||
|
||||
iterator_range<SmallPtrSetIterator<llvm::InterleaveGroup<Instruction> *>>
|
||||
|
@ -40,14 +40,12 @@ PassRegistry::~PassRegistry() = default;
|
||||
|
||||
const PassInfo *PassRegistry::getPassInfo(const void *TI) const {
|
||||
sys::SmartScopedReader<true> Guard(Lock);
|
||||
MapType::const_iterator I = PassInfoMap.find(TI);
|
||||
return I != PassInfoMap.end() ? I->second : nullptr;
|
||||
return PassInfoMap.lookup(TI);
|
||||
}
|
||||
|
||||
const PassInfo *PassRegistry::getPassInfo(StringRef Arg) const {
|
||||
sys::SmartScopedReader<true> Guard(Lock);
|
||||
StringMapType::const_iterator I = PassInfoStringMap.find(Arg);
|
||||
return I != PassInfoStringMap.end() ? I->second : nullptr;
|
||||
return PassInfoStringMap.lookup(Arg);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -561,8 +561,7 @@ GCPtrTracker::GCPtrTracker(const Function &F, const DominatorTree &DT,
|
||||
}
|
||||
|
||||
BasicBlockState *GCPtrTracker::getBasicBlockState(const BasicBlock *BB) {
|
||||
auto it = BlockMap.find(BB);
|
||||
return it != BlockMap.end() ? it->second : nullptr;
|
||||
return BlockMap.lookup(BB);
|
||||
}
|
||||
|
||||
const BasicBlockState *GCPtrTracker::getBasicBlockState(
|
||||
|
Loading…
Reference in New Issue
Block a user