if (CurDecl->hasDefinition() || CurDecl->isReferenced()) {
continue; // Skip forward declarations that are used/referenced.
}
- if (FriendTypes.count(CurDecl->getTypeForDecl()) != 0) {
+ if (FriendTypes.contains(CurDecl->getTypeForDecl())) {
continue; // Skip forward declarations referenced as friend.
}
if (CurDecl->getLocation().isMacroID() ||
// Add all fields between current field up until the next initializer.
for (; Decl != std::end(OrderedDecls) && *Decl != InitDecl; ++Decl) {
if (const auto *D = dyn_cast<T>(*Decl)) {
- if (DeclsToInit.count(D) > 0)
+ if (DeclsToInit.contains(D))
Insertions.back().Initializers.emplace_back(getName(D));
}
}
// Add remaining decls that require initialization.
for (; Decl != std::end(OrderedDecls); ++Decl) {
if (const auto *D = dyn_cast<T>(*Decl)) {
- if (DeclsToInit.count(D) > 0)
+ if (DeclsToInit.contains(D))
Insertions.back().Initializers.emplace_back(getName(D));
}
}
//
// FIXME: Use a more efficient way to find a matching context.
for (auto &Context : Contexts) {
- if (Context.UsingTargetDecls.count(D->getCanonicalDecl()) > 0)
+ if (Context.UsingTargetDecls.contains(D->getCanonicalDecl()))
Context.IsUsed = true;
}
}
const auto *OriginalDeclaration =
Result.Nodes.getNodeAs<FunctionDecl>("functionDecl");
- if (VisitedDeclarations.count(OriginalDeclaration) > 0)
+ if (VisitedDeclarations.contains(OriginalDeclaration))
return; // Avoid multiple warnings.
const FunctionDecl *ParameterSourceDeclaration =
}
bool isValidAsmImmediate(const llvm::APInt &Value) const {
if (!ImmSet.empty())
- return Value.isSignedIntN(32) &&
- ImmSet.count(Value.getZExtValue()) != 0;
+ return Value.isSignedIntN(32) && ImmSet.contains(Value.getZExtValue());
return !ImmRange.isConstrained ||
(Value.sge(ImmRange.Min) && Value.sle(ImmRange.Max));
}
/// isDeclScope - Return true if this is the scope that the specified decl is
/// declared in.
- bool isDeclScope(const Decl *D) const { return DeclsInScope.count(D) != 0; }
+ bool isDeclScope(const Decl *D) const { return DeclsInScope.contains(D); }
/// Get the entity corresponding to this scope.
DeclContext *getEntity() const {
}
bool ASTImporterLookupTable::contains(DeclContext *DC, NamedDecl *ND) const {
- return 0 < lookup(DC, ND->getDeclName()).count(ND);
+ return lookup(DC, ND->getDeclName()).contains(ND);
}
void ASTImporterLookupTable::dump(DeclContext *DC) const {
for (const CXXBaseSpecifier &VBase : RD->vbases()) {
const CXXRecordDecl *BaseDecl = VBase.getType()->getAsCXXRecordDecl();
const ASTRecordLayout &BaseLayout = Context.getASTRecordLayout(BaseDecl);
- bool HasVtordisp = HasVtorDispSet.count(BaseDecl) > 0;
+ bool HasVtordisp = HasVtorDispSet.contains(BaseDecl);
// Insert padding between two bases if the left first one is zero sized or
// contains a zero sized subobject and the right is zero sized or one leads
// with a zero sized base. The padding between virtual bases is 4
if (&SpecificPath == &OtherPath)
continue;
if (llvm::all_of(SpecificPath, [&](const BaseSubobject &BSO) {
- return OtherPath.count(BSO) != 0;
+ return OtherPath.contains(BSO);
})) {
return true;
}
return llvm::any_of(
CGM.getOpenMPRuntime().NontemporalDeclsStack,
- [VD](const NontemporalDeclsSet &Set) { return Set.count(VD) > 0; });
+ [VD](const NontemporalDeclsSet &Set) { return Set.contains(VD); });
}
void CGOpenMPRuntime::LastprivateConditionalRAII::tryToDisableInnerAnalysis(
ProtocolsExplictImpl.reset(new ProtocolNameSet);
findProtocolsWithExplicitImpls(Super, *ProtocolsExplictImpl);
}
- if (ProtocolsExplictImpl->find(PDecl->getIdentifier()) !=
- ProtocolsExplictImpl->end())
+ if (ProtocolsExplictImpl->contains(PDecl->getIdentifier()))
return;
// If no super class conforms to the protocol, we should not search
/// Checks if the specified declaration was used in the inner scan directive.
bool isUsedInScanDirective(ValueDecl *D) const {
if (const SharingMapTy *Stack = getTopOfStackOrNull())
- return Stack->UsedInScanDirective.count(D) > 0;
+ return Stack->UsedInScanDirective.contains(D);
return false;
}
// Return set of mapped classes types
bool isClassPreviouslyMapped(QualType QT) const {
const SharingMapTy &StackElem = getTopOfStack();
- return StackElem.MappedClassesQualTypes.count(QT) != 0;
+ return StackElem.MappedClassesQualTypes.contains(QT);
}
/// Adds global declare target to the parent target region.
}
/// Checks if the decl is implicitly firstprivate in the task-based region.
bool isImplicitTaskFirstprivate(Decl *D) const {
- return getTopOfStack().ImplicitTaskFirstprivates.count(D) > 0;
+ return getTopOfStack().ImplicitTaskFirstprivates.contains(D);
}
/// Marks decl as used in uses_allocators clause as the allocator.
const IdentifierInfo *Identifier = Call.getCalleeIdentifier();
SVal sv = Call.getReturnValue();
- if (isAnnotatedAsReturningLocalized(D) || LSF.count(Identifier) != 0) {
+ if (isAnnotatedAsReturningLocalized(D) || LSF.contains(Identifier)) {
setLocalizedState(sv, C);
} else if (isNSStringType(RT, C.getASTContext()) &&
!hasLocalizedState(sv, C)) {
// section,
// remove those as well as nothing will include them (and we can't
// leave them dangling).
- if (RemovedSections.count(Sym.AssociativeComdatTargetSectionId) == 1)
+ if (RemovedSections.contains(Sym.AssociativeComdatTargetSectionId))
AssociatedSections.insert(Sym.TargetSectionId);
return RemovedSections.contains(Sym.TargetSectionId);
});