Skip to content

Commit b9f9b3b

Browse files
authored
[SPIRV][NFC] Use DenseMap's lookup instead of find (llvm#164237)
[lookup](https://llvm.org/doxygen/classllvm_1_1DenseMapBase.html#a0b2ca98dc28c61793ff5c90d23e5f14e) does a find and returns the default if no matching element was found.
1 parent fbc2d06 commit b9f9b3b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,7 @@ struct ModuleAnalysisInfo {
169169

170170
MCRegister getFuncReg(const Function *F) {
171171
assert(F && "Function is null");
172-
auto FuncPtrRegPair = FuncMap.find(F);
173-
return FuncPtrRegPair == FuncMap.end() ? MCRegister()
174-
: FuncPtrRegPair->second;
172+
return FuncMap.lookup(F);
175173
}
176174
MCRegister getExtInstSetReg(unsigned SetNum) { return ExtInstSetMap[SetNum]; }
177175
InstrList &getMSInstrs(unsigned MSType) { return MS[MSType]; }

0 commit comments

Comments
 (0)