mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-12 12:48:59 +00:00
Use DenseMap::lookup (NFC)
This commit is contained in:
parent
fa1260697e
commit
fee57711fe
@ -133,8 +133,7 @@ void ParentMap::setParent(const Stmt *S, const Stmt *Parent) {
|
||||
|
||||
Stmt* ParentMap::getParent(Stmt* S) const {
|
||||
MapTy* M = (MapTy*) Impl;
|
||||
MapTy::iterator I = M->find(S);
|
||||
return I == M->end() ? nullptr : I->second;
|
||||
return M->lookup(S);
|
||||
}
|
||||
|
||||
Stmt *ParentMap::getParentIgnoreParens(Stmt *S) const {
|
||||
|
@ -83,7 +83,7 @@ void DAGTypeLegalizer::PerformExpensiveChecks() {
|
||||
SDValue Res(&Node, i);
|
||||
bool Failed = false;
|
||||
// Don't create a value in map.
|
||||
auto ResId = (ValueToIdMap.count(Res)) ? ValueToIdMap[Res] : 0;
|
||||
auto ResId = ValueToIdMap.lookup(Res);
|
||||
|
||||
unsigned Mapped = 0;
|
||||
if (ResId && (ReplacedValues.find(ResId) != ReplacedValues.end())) {
|
||||
|
@ -1159,11 +1159,9 @@ bool SampleProfileLoader::inlineHotFunctions(
|
||||
}
|
||||
for (CallBase *I : CIS) {
|
||||
Function *CalledFunction = I->getCalledFunction();
|
||||
InlineCandidate Candidate = {
|
||||
I,
|
||||
LocalNotInlinedCallSites.count(I) ? LocalNotInlinedCallSites[I]
|
||||
: nullptr,
|
||||
0 /* dummy count */, 1.0 /* dummy distribution factor */};
|
||||
InlineCandidate Candidate = {I, LocalNotInlinedCallSites.lookup(I),
|
||||
0 /* dummy count */,
|
||||
1.0 /* dummy distribution factor */};
|
||||
// Do not inline recursive calls.
|
||||
if (CalledFunction == &F)
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user