Skip to content

Commit

Permalink
[clang] Use SmallDenseMap::contains (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata committed Aug 27, 2023
1 parent a678ed4 commit 7224749
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions clang/lib/CodeGen/CGBuiltin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,12 @@ llvm::Constant *CodeGenModule::getBuiltinLibFunction(const FunctionDecl *FD,
// PPC, after backend supports IEEE 128-bit style libcalls.
if (getTriple().isPPC64() &&
&getTarget().getLongDoubleFormat() == &llvm::APFloat::IEEEquad() &&
F128Builtins.find(BuiltinID) != F128Builtins.end())
F128Builtins.contains(BuiltinID))
Name = F128Builtins[BuiltinID];
else if (getTriple().isOSAIX() &&
&getTarget().getLongDoubleFormat() ==
&llvm::APFloat::IEEEdouble() &&
AIXLongDouble64Builtins.find(BuiltinID) !=
AIXLongDouble64Builtins.end())
AIXLongDouble64Builtins.contains(BuiltinID))
Name = AIXLongDouble64Builtins[BuiltinID];
else
Name = Context.BuiltinInfo.getName(BuiltinID).substr(10);
Expand Down
4 changes: 2 additions & 2 deletions clang/lib/Sema/SemaTemplateInstantiate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4173,7 +4173,7 @@ void LocalInstantiationScope::InstantiatedLocal(const Decl *D, Decl *Inst) {
LocalInstantiationScope *Current = this;
while (Current->CombineWithOuterScope && Current->Outer) {
Current = Current->Outer;
assert(Current->LocalDecls.find(D) == Current->LocalDecls.end() &&
assert(!Current->LocalDecls.contains(D) &&
"Instantiated local in inner and outer scopes");
}
#endif
Expand All @@ -4197,7 +4197,7 @@ void LocalInstantiationScope::MakeInstantiatedLocalArgPack(const Decl *D) {
// This should be the first time we've been told about this decl.
for (LocalInstantiationScope *Current = this;
Current && Current->CombineWithOuterScope; Current = Current->Outer)
assert(Current->LocalDecls.find(D) == Current->LocalDecls.end() &&
assert(!Current->LocalDecls.contains(D) &&
"Creating local pack after instantiation of local");
#endif

Expand Down

0 comments on commit 7224749

Please sign in to comment.