Skip to content

Commit 809fec2

Browse files
committedMar 19, 2024
[FOLD] format
1 parent 84e1635 commit 809fec2

11 files changed

+47
-51
lines changed
 

‎clang/include/clang/Sema/Lookup.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,9 @@ class LookupResult {
496496
/// Note that while no result was found in the current instantiation,
497497
/// there were dependent base classes that could not be searched.
498498
void setNotFoundInCurrentInstantiation() {
499-
assert((ResultKind == NotFound || ResultKind == NotFoundInCurrentInstantiation) && Decls.empty());
499+
assert((ResultKind == NotFound ||
500+
ResultKind == NotFoundInCurrentInstantiation) &&
501+
Decls.empty());
500502
ResultKind = NotFoundInCurrentInstantiation;
501503
}
502504

‎clang/include/clang/Sema/Sema.h

+9-11
Original file line numberDiff line numberDiff line change
@@ -7725,11 +7725,8 @@ class Sema final {
77257725
bool InUnqualifiedLookup = false);
77267726
bool LookupQualifiedName(LookupResult &R, DeclContext *LookupCtx,
77277727
CXXScopeSpec &SS);
7728-
bool LookupParsedName(LookupResult &R,
7729-
Scope *S,
7730-
CXXScopeSpec *SS,
7731-
QualType ObjectType,
7732-
bool AllowBuiltinCreation = false,
7728+
bool LookupParsedName(LookupResult &R, Scope *S, CXXScopeSpec *SS,
7729+
QualType ObjectType, bool AllowBuiltinCreation = false,
77337730
bool EnteringContext = false);
77347731
ObjCProtocolDecl *
77357732
LookupProtocol(IdentifierInfo *II, SourceLocation IdLoc,
@@ -9138,12 +9135,13 @@ class Sema final {
91389135
bool EnteringContext, bool &MemberOfUnknownSpecialization,
91399136
RequiredTemplateKind RequiredTemplate = SourceLocation(),
91409137
AssumedTemplateKind *ATK = nullptr, bool AllowTypoCorrection = true);
9141-
9142-
bool LookupTemplateName(
9143-
LookupResult &R, Scope *S, CXXScopeSpec &SS, QualType ObjectType,
9144-
bool EnteringContext,
9145-
RequiredTemplateKind RequiredTemplate = SourceLocation(),
9146-
AssumedTemplateKind *ATK = nullptr, bool AllowTypoCorrection = true);
9138+
9139+
bool
9140+
LookupTemplateName(LookupResult &R, Scope *S, CXXScopeSpec &SS,
9141+
QualType ObjectType, bool EnteringContext,
9142+
RequiredTemplateKind RequiredTemplate = SourceLocation(),
9143+
AssumedTemplateKind *ATK = nullptr,
9144+
bool AllowTypoCorrection = true);
91479145

91489146
TemplateNameKind isTemplateName(Scope *S, CXXScopeSpec &SS,
91499147
bool hasTemplateKeyword,

‎clang/lib/Parse/ParseDecl.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -2994,7 +2994,8 @@ bool Parser::ParseImplicitInt(DeclSpec &DS, CXXScopeSpec *SS,
29942994
<< TokenName << TagName << getLangOpts().CPlusPlus
29952995
<< FixItHint::CreateInsertion(Tok.getLocation(), FixitTagName);
29962996

2997-
if (Actions.LookupParsedName(R, getCurScope(), SS, /*ObjectType=*/QualType())) {
2997+
if (Actions.LookupParsedName(R, getCurScope(), SS,
2998+
/*ObjectType=*/QualType())) {
29982999
for (LookupResult::iterator I = R.begin(), IEnd = R.end();
29993000
I != IEnd; ++I)
30003001
Diag((*I)->getLocation(), diag::note_decl_hiding_tag_type)

‎clang/lib/Sema/HLSLExternalSemaSource.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ struct BuiltinTypeDeclBuilder {
133133
LookupResult R(S, NameInfo, Sema::LookupOrdinaryName);
134134
S.LookupParsedName(R, S.getCurScope(), &SS,
135135
/*ObjectType=*/QualType(),
136-
/*AllowBuiltinCreation*/false);
136+
/*AllowBuiltinCreation*/ false);
137137
assert(R.isSingleResult() &&
138138
"Since this is a builtin it should always resolve!");
139139
auto *VD = cast<ValueDecl>(R.getFoundDecl());

‎clang/lib/Sema/SemaAttr.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ void Sema::ActOnPragmaUnused(const Token &IdTok, Scope *curScope,
828828
LookupParsedName(Lookup, curScope,
829829
/*SS=*/nullptr,
830830
/*ObjectType=*/QualType(),
831-
/*AllowBuiltinCreation*/true);
831+
/*AllowBuiltinCreation*/ true);
832832

833833
if (Lookup.empty()) {
834834
Diag(PragmaLoc, diag::warn_pragma_unused_undeclared_var)

‎clang/lib/Sema/SemaDecl.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,8 @@ Sema::NameClassification Sema::ClassifyName(Scope *S, CXXScopeSpec &SS,
892892
}
893893

894894
LookupResult Result(*this, Name, NameLoc, LookupOrdinaryName);
895-
LookupParsedName(Result, S, &SS, /*ObjectType=*/QualType(), /*AllowBuiltinCreation*/!CurMethod);
895+
LookupParsedName(Result, S, &SS, /*ObjectType=*/QualType(),
896+
/*AllowBuiltinCreation*/ !CurMethod);
896897

897898
if (SS.isInvalid())
898899
return NameClassification::Error();

‎clang/lib/Sema/SemaExpr.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -2762,7 +2762,8 @@ Sema::ActOnIdExpression(Scope *S, CXXScopeSpec &SS,
27622762
IsAddressOfOperand, TemplateArgs);
27632763
} else {
27642764
bool IvarLookupFollowUp = II && !SS.isSet() && getCurMethodDecl();
2765-
LookupParsedName(R, S, &SS, /*ObjectType=*/QualType(), /*AllowBuiltinCreation=*/!IvarLookupFollowUp);
2765+
LookupParsedName(R, S, &SS, /*ObjectType=*/QualType(),
2766+
/*AllowBuiltinCreation=*/!IvarLookupFollowUp);
27662767

27672768
// If the result might be in a dependent base class, this is a dependent
27682769
// id-expression.

‎clang/lib/Sema/SemaExprMember.cpp

+10-13
Original file line numberDiff line numberDiff line change
@@ -690,16 +690,14 @@ static bool LookupMemberExprInRecord(Sema &SemaRef, LookupResult &R,
690690
OpLoc, RTy, diag::err_typecheck_incomplete_tag, BaseRange))
691691
return true;
692692

693-
// LookupTemplateName/LookupParsedName don't expect these both to exist simultaneously.
693+
// LookupTemplateName/LookupParsedName don't expect these both to exist
694+
// simultaneously.
694695
QualType ObjectType = SS.isSet() ? QualType() : RTy;
695696
if (HasTemplateArgs || TemplateKWLoc.isValid()) {
696697
bool MOUS;
697698
return SemaRef.LookupTemplateName(R,
698-
/*S=*/nullptr,
699-
SS,
700-
ObjectType,
701-
/*EnteringContext=*/false,
702-
MOUS,
699+
/*S=*/nullptr, SS, ObjectType,
700+
/*EnteringContext=*/false, MOUS,
703701
TemplateKWLoc);
704702
}
705703

@@ -711,9 +709,8 @@ static bool LookupMemberExprInRecord(Sema &SemaRef, LookupResult &R,
711709
DeclarationName Typo = R.getLookupName();
712710
SourceLocation TypoLoc = R.getNameLoc();
713711
// Recompute the lookup context.
714-
DeclContext *DC = SS.isSet()
715-
? SemaRef.computeDeclContext(SS)
716-
: SemaRef.computeDeclContext(RTy);
712+
DeclContext *DC = SS.isSet() ? SemaRef.computeDeclContext(SS)
713+
: SemaRef.computeDeclContext(RTy);
717714

718715
struct QueryState {
719716
Sema &SemaRef;
@@ -975,11 +972,11 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType,
975972
ActOnMemberAccessExtraArgs *ExtraArgs) {
976973
assert(!SS.isInvalid() && "nested-name-specifier cannot be invalid");
977974
if (R.wasNotFoundInCurrentInstantiation() ||
978-
#if 0
975+
#if 0
979976
(SS.isValid() && !computeDeclContext(SS, false))) {
980-
#else
977+
#else
981978
false) {
982-
#endif
979+
#endif
983980
return ActOnDependentMemberExpr(BaseExpr, BaseExprType, IsArrow, OpLoc, SS,
984981
TemplateKWLoc, FirstQualifierInScope,
985982
R.getLookupNameInfo(), TemplateArgs);
@@ -1050,7 +1047,7 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType,
10501047

10511048
if (SS.isNotEmpty() && !DC) {
10521049
Diag(R.getNameLoc(), diag::err_undeclared_use)
1053-
<< MemberName << SS.getRange();
1050+
<< MemberName << SS.getRange();
10541051
} else if (DC) {
10551052
Diag(R.getNameLoc(), diag::err_no_member)
10561053
<< MemberName << DC

‎clang/lib/Sema/SemaLookup.cpp

+6-10
Original file line numberDiff line numberDiff line change
@@ -2716,11 +2716,8 @@ bool Sema::LookupQualifiedName(LookupResult &R, DeclContext *LookupCtx,
27162716
/// context of the scope-specifier SS (if present).
27172717
///
27182718
/// @returns True if any decls were found (but possibly ambiguous)
2719-
bool Sema::LookupParsedName(LookupResult &R,
2720-
Scope *S,
2721-
CXXScopeSpec *SS,
2722-
QualType ObjectType,
2723-
bool AllowBuiltinCreation,
2719+
bool Sema::LookupParsedName(LookupResult &R, Scope *S, CXXScopeSpec *SS,
2720+
QualType ObjectType, bool AllowBuiltinCreation,
27242721
bool EnteringContext) {
27252722
// When the scope specifier is invalid, don't even look for anything.
27262723
if (SS && SS->isInvalid())
@@ -2732,12 +2729,12 @@ bool Sema::LookupParsedName(LookupResult &R,
27322729
if (!ObjectType.isNull()) {
27332730
// This nested-name-specifier occurs in a member access expression, e.g.,
27342731
// x->B::f, and we are looking into the type of the object.
2735-
assert((!SS || SS->isEmpty()) && "ObjectType and scope specifier cannot coexist");
2732+
assert((!SS || SS->isEmpty()) &&
2733+
"ObjectType and scope specifier cannot coexist");
27362734
DC = computeDeclContext(ObjectType);
27372735
IsDependent = !DC && ObjectType->isDependentType();
27382736
assert(((!DC && ObjectType->isDependentType()) ||
2739-
!ObjectType->isIncompleteType() ||
2740-
!ObjectType->getAs<TagType>() ||
2737+
!ObjectType->isIncompleteType() || !ObjectType->getAs<TagType>() ||
27412738
ObjectType->castAs<TagType>()->isBeingDefined()) &&
27422739
"Caller should have completed object type");
27432740
} else if (SS && SS->isNotEmpty()) {
@@ -5032,8 +5029,7 @@ static void LookupPotentialTypoResult(Sema &SemaRef,
50325029

50335030
SemaRef.LookupParsedName(Res, S, SS,
50345031
/*ObjectType=*/QualType(),
5035-
/*AllowBuiltinCreation=*/false,
5036-
EnteringContext);
5032+
/*AllowBuiltinCreation=*/false, EnteringContext);
50375033

50385034
// Fake ivar lookup; this should really be part of
50395035
// LookupParsedName.

‎clang/lib/Sema/SemaOpenMP.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -19159,7 +19159,8 @@ buildDeclareReductionRef(Sema &SemaRef, SourceLocation Loc, SourceRange Range,
1915919159
if (S) {
1916019160
LookupResult Lookup(SemaRef, ReductionId, Sema::LookupOMPReductionName);
1916119161
Lookup.suppressDiagnostics();
19162-
while (S && SemaRef.LookupParsedName(Lookup, S, &ReductionIdScopeSpec, /*ObjectType=*/QualType())) {
19162+
while (S && SemaRef.LookupParsedName(Lookup, S, &ReductionIdScopeSpec,
19163+
/*ObjectType=*/QualType())) {
1916319164
NamedDecl *D = Lookup.getRepresentativeDecl();
1916419165
do {
1916519166
S = S->getParent();
@@ -22012,7 +22013,8 @@ static ExprResult buildUserDefinedMapperRef(Sema &SemaRef, Scope *S,
2201222013
LookupResult Lookup(SemaRef, MapperId, Sema::LookupOMPMapperName);
2201322014
Lookup.suppressDiagnostics();
2201422015
if (S) {
22015-
while (S && SemaRef.LookupParsedName(Lookup, S, &MapperIdScopeSpec, /*ObjectType=*/QualType())) {
22016+
while (S && SemaRef.LookupParsedName(Lookup, S, &MapperIdScopeSpec,
22017+
/*ObjectType=*/QualType())) {
2201622018
NamedDecl *D = Lookup.getRepresentativeDecl();
2201722019
while (S && !S->isDeclScope(D))
2201822020
S = S->getParent();

‎clang/lib/Sema/SemaTemplate.cpp

+7-9
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,8 @@ bool Sema::DiagnoseUnknownTemplateName(const IdentifierInfo &II,
371371
return true;
372372
}
373373

374-
bool Sema::LookupTemplateName(LookupResult &Found,
375-
Scope *S, CXXScopeSpec &SS,
376-
QualType ObjectType,
377-
bool EnteringContext,
374+
bool Sema::LookupTemplateName(LookupResult &Found, Scope *S, CXXScopeSpec &SS,
375+
QualType ObjectType, bool EnteringContext,
378376
RequiredTemplateKind RequiredTemplate,
379377
AssumedTemplateKind *ATK,
380378
bool AllowTypoCorrection) {
@@ -5461,8 +5459,7 @@ Sema::BuildQualifiedTemplateIdExpr(CXXScopeSpec &SS,
54615459

54625460
LookupResult R(*this, NameInfo, LookupOrdinaryName);
54635461
if (LookupTemplateName(R, (Scope *)nullptr, SS, QualType(),
5464-
/*Entering*/false,
5465-
TemplateKWLoc))
5462+
/*Entering*/ false, TemplateKWLoc))
54665463
return ExprError();
54675464

54685465
if (R.isAmbiguous())
@@ -5588,8 +5585,8 @@ TemplateNameKind Sema::ActOnTemplateName(Scope *S,
55885585
RequiredTemplateKind RTK = TemplateKWLoc.isValid()
55895586
? RequiredTemplateKind(TemplateKWLoc)
55905587
: TemplateNameIsRequired;
5591-
if (!LookupTemplateName(R, S, SS, ObjectType.get(), EnteringContext,
5592-
RTK, /*ATK=*/nullptr, /*AllowTypoCorrection=*/false) &&
5588+
if (!LookupTemplateName(R, S, SS, ObjectType.get(), EnteringContext, RTK,
5589+
/*ATK=*/nullptr, /*AllowTypoCorrection=*/false) &&
55935590
!R.isAmbiguous()) {
55945591
if (LookupCtx)
55955592
Diag(Name.getBeginLoc(), diag::err_no_member)
@@ -11035,7 +11032,8 @@ DeclResult Sema::ActOnExplicitInstantiation(Scope *S,
1103511032
: TSK_ExplicitInstantiationDeclaration;
1103611033

1103711034
LookupResult Previous(*this, NameInfo, LookupOrdinaryName);
11038-
LookupParsedName(Previous, S, &D.getCXXScopeSpec(), /*ObjectType=*/QualType());
11035+
LookupParsedName(Previous, S, &D.getCXXScopeSpec(),
11036+
/*ObjectType=*/QualType());
1103911037

1104011038
if (!R->isFunctionType()) {
1104111039
// C++ [temp.explicit]p1:

0 commit comments

Comments
 (0)