Skip to content

Commit 7224749

Browse files
[clang] Use SmallDenseMap::contains (NFC)
1 parent a678ed4 commit 7224749

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,12 @@ llvm::Constant *CodeGenModule::getBuiltinLibFunction(const FunctionDecl *FD,
145145
// PPC, after backend supports IEEE 128-bit style libcalls.
146146
if (getTriple().isPPC64() &&
147147
&getTarget().getLongDoubleFormat() == &llvm::APFloat::IEEEquad() &&
148-
F128Builtins.find(BuiltinID) != F128Builtins.end())
148+
F128Builtins.contains(BuiltinID))
149149
Name = F128Builtins[BuiltinID];
150150
else if (getTriple().isOSAIX() &&
151151
&getTarget().getLongDoubleFormat() ==
152152
&llvm::APFloat::IEEEdouble() &&
153-
AIXLongDouble64Builtins.find(BuiltinID) !=
154-
AIXLongDouble64Builtins.end())
153+
AIXLongDouble64Builtins.contains(BuiltinID))
155154
Name = AIXLongDouble64Builtins[BuiltinID];
156155
else
157156
Name = Context.BuiltinInfo.getName(BuiltinID).substr(10);

clang/lib/Sema/SemaTemplateInstantiate.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4173,7 +4173,7 @@ void LocalInstantiationScope::InstantiatedLocal(const Decl *D, Decl *Inst) {
41734173
LocalInstantiationScope *Current = this;
41744174
while (Current->CombineWithOuterScope && Current->Outer) {
41754175
Current = Current->Outer;
4176-
assert(Current->LocalDecls.find(D) == Current->LocalDecls.end() &&
4176+
assert(!Current->LocalDecls.contains(D) &&
41774177
"Instantiated local in inner and outer scopes");
41784178
}
41794179
#endif
@@ -4197,7 +4197,7 @@ void LocalInstantiationScope::MakeInstantiatedLocalArgPack(const Decl *D) {
41974197
// This should be the first time we've been told about this decl.
41984198
for (LocalInstantiationScope *Current = this;
41994199
Current && Current->CombineWithOuterScope; Current = Current->Outer)
4200-
assert(Current->LocalDecls.find(D) == Current->LocalDecls.end() &&
4200+
assert(!Current->LocalDecls.contains(D) &&
42014201
"Creating local pack after instantiation of local");
42024202
#endif
42034203

0 commit comments

Comments
 (0)