Skip to content

Commit 77103a5

Browse files
committed
[FOLD] format
1 parent c980982 commit 77103a5

File tree

11 files changed

+47
-51
lines changed

11 files changed

+47
-51
lines changed

clang/include/clang/Sema/Lookup.h

Lines changed: 3 additions & 1 deletion
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

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7550,11 +7550,8 @@ class Sema final : public SemaBase {
75507550
bool InUnqualifiedLookup = false);
75517551
bool LookupQualifiedName(LookupResult &R, DeclContext *LookupCtx,
75527552
CXXScopeSpec &SS);
7553-
bool LookupParsedName(LookupResult &R,
7554-
Scope *S,
7555-
CXXScopeSpec *SS,
7556-
QualType ObjectType,
7557-
bool AllowBuiltinCreation = false,
7553+
bool LookupParsedName(LookupResult &R, Scope *S, CXXScopeSpec *SS,
7554+
QualType ObjectType, bool AllowBuiltinCreation = false,
75587555
bool EnteringContext = false);
75597556
ObjCProtocolDecl *
75607557
LookupProtocol(IdentifierInfo *II, SourceLocation IdLoc,
@@ -8963,12 +8960,13 @@ class Sema final : public SemaBase {
89638960
bool EnteringContext, bool &MemberOfUnknownSpecialization,
89648961
RequiredTemplateKind RequiredTemplate = SourceLocation(),
89658962
AssumedTemplateKind *ATK = nullptr, bool AllowTypoCorrection = true);
8966-
8967-
bool LookupTemplateName(
8968-
LookupResult &R, Scope *S, CXXScopeSpec &SS, QualType ObjectType,
8969-
bool EnteringContext,
8970-
RequiredTemplateKind RequiredTemplate = SourceLocation(),
8971-
AssumedTemplateKind *ATK = nullptr, bool AllowTypoCorrection = true);
8963+
8964+
bool
8965+
LookupTemplateName(LookupResult &R, Scope *S, CXXScopeSpec &SS,
8966+
QualType ObjectType, bool EnteringContext,
8967+
RequiredTemplateKind RequiredTemplate = SourceLocation(),
8968+
AssumedTemplateKind *ATK = nullptr,
8969+
bool AllowTypoCorrection = true);
89728970

89738971
TemplateNameKind isTemplateName(Scope *S, CXXScopeSpec &SS,
89748972
bool hasTemplateKeyword,

clang/lib/Parse/ParseDecl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2998,7 +2998,8 @@ bool Parser::ParseImplicitInt(DeclSpec &DS, CXXScopeSpec *SS,
29982998
<< TokenName << TagName << getLangOpts().CPlusPlus
29992999
<< FixItHint::CreateInsertion(Tok.getLocation(), FixitTagName);
30003000

3001-
if (Actions.LookupParsedName(R, getCurScope(), SS, /*ObjectType=*/QualType())) {
3001+
if (Actions.LookupParsedName(R, getCurScope(), SS,
3002+
/*ObjectType=*/QualType())) {
30023003
for (LookupResult::iterator I = R.begin(), IEnd = R.end();
30033004
I != IEnd; ++I)
30043005
Diag((*I)->getLocation(), diag::note_decl_hiding_tag_type)

clang/lib/Sema/HLSLExternalSemaSource.cpp

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ void Sema::ActOnPragmaUnused(const Token &IdTok, Scope *curScope,
840840
LookupParsedName(Lookup, curScope,
841841
/*SS=*/nullptr,
842842
/*ObjectType=*/QualType(),
843-
/*AllowBuiltinCreation*/true);
843+
/*AllowBuiltinCreation*/ true);
844844

845845
if (Lookup.empty()) {
846846
Diag(PragmaLoc, diag::warn_pragma_unused_undeclared_var)

clang/lib/Sema/SemaDecl.cpp

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2781,7 +2781,8 @@ Sema::ActOnIdExpression(Scope *S, CXXScopeSpec &SS,
27812781
IsAddressOfOperand, TemplateArgs);
27822782
} else {
27832783
bool IvarLookupFollowUp = II && !SS.isSet() && getCurMethodDecl();
2784-
LookupParsedName(R, S, &SS, /*ObjectType=*/QualType(), /*AllowBuiltinCreation=*/!IvarLookupFollowUp);
2784+
LookupParsedName(R, S, &SS, /*ObjectType=*/QualType(),
2785+
/*AllowBuiltinCreation=*/!IvarLookupFollowUp);
27852786

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

clang/lib/Sema/SemaExprMember.cpp

Lines changed: 10 additions & 13 deletions
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

Lines changed: 6 additions & 10 deletions
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()) {
@@ -5036,8 +5033,7 @@ static void LookupPotentialTypoResult(Sema &SemaRef,
50365033

50375034
SemaRef.LookupParsedName(Res, S, SS,
50385035
/*ObjectType=*/QualType(),
5039-
/*AllowBuiltinCreation=*/false,
5040-
EnteringContext);
5036+
/*AllowBuiltinCreation=*/false, EnteringContext);
50415037

50425038
// Fake ivar lookup; this should really be part of
50435039
// LookupParsedName.

clang/lib/Sema/SemaOpenMP.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19239,7 +19239,8 @@ buildDeclareReductionRef(Sema &SemaRef, SourceLocation Loc, SourceRange Range,
1923919239
if (S) {
1924019240
LookupResult Lookup(SemaRef, ReductionId, Sema::LookupOMPReductionName);
1924119241
Lookup.suppressDiagnostics();
19242-
while (S && SemaRef.LookupParsedName(Lookup, S, &ReductionIdScopeSpec, /*ObjectType=*/QualType())) {
19242+
while (S && SemaRef.LookupParsedName(Lookup, S, &ReductionIdScopeSpec,
19243+
/*ObjectType=*/QualType())) {
1924319244
NamedDecl *D = Lookup.getRepresentativeDecl();
1924419245
do {
1924519246
S = S->getParent();
@@ -22092,7 +22093,8 @@ static ExprResult buildUserDefinedMapperRef(Sema &SemaRef, Scope *S,
2209222093
LookupResult Lookup(SemaRef, MapperId, Sema::LookupOMPMapperName);
2209322094
Lookup.suppressDiagnostics();
2209422095
if (S) {
22095-
while (S && SemaRef.LookupParsedName(Lookup, S, &MapperIdScopeSpec, /*ObjectType=*/QualType())) {
22096+
while (S && SemaRef.LookupParsedName(Lookup, S, &MapperIdScopeSpec,
22097+
/*ObjectType=*/QualType())) {
2209622098
NamedDecl *D = Lookup.getRepresentativeDecl();
2209722099
while (S && !S->isDeclScope(D))
2209822100
S = S->getParent();

clang/lib/Sema/SemaTemplate.cpp

Lines changed: 7 additions & 9 deletions
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) {
@@ -5607,8 +5605,7 @@ Sema::BuildQualifiedTemplateIdExpr(CXXScopeSpec &SS,
56075605

56085606
LookupResult R(*this, NameInfo, LookupOrdinaryName);
56095607
if (LookupTemplateName(R, (Scope *)nullptr, SS, QualType(),
5610-
/*Entering*/false,
5611-
TemplateKWLoc))
5608+
/*Entering*/ false, TemplateKWLoc))
56125609
return ExprError();
56135610

56145611
if (R.isAmbiguous())
@@ -5734,8 +5731,8 @@ TemplateNameKind Sema::ActOnTemplateName(Scope *S,
57345731
RequiredTemplateKind RTK = TemplateKWLoc.isValid()
57355732
? RequiredTemplateKind(TemplateKWLoc)
57365733
: TemplateNameIsRequired;
5737-
if (!LookupTemplateName(R, S, SS, ObjectType.get(), EnteringContext,
5738-
RTK, /*ATK=*/nullptr, /*AllowTypoCorrection=*/false) &&
5734+
if (!LookupTemplateName(R, S, SS, ObjectType.get(), EnteringContext, RTK,
5735+
/*ATK=*/nullptr, /*AllowTypoCorrection=*/false) &&
57395736
!R.isAmbiguous()) {
57405737
if (LookupCtx)
57415738
Diag(Name.getBeginLoc(), diag::err_no_member)
@@ -11185,7 +11182,8 @@ DeclResult Sema::ActOnExplicitInstantiation(Scope *S,
1118511182
: TSK_ExplicitInstantiationDeclaration;
1118611183

1118711184
LookupResult Previous(*this, NameInfo, LookupOrdinaryName);
11188-
LookupParsedName(Previous, S, &D.getCXXScopeSpec(), /*ObjectType=*/QualType());
11185+
LookupParsedName(Previous, S, &D.getCXXScopeSpec(),
11186+
/*ObjectType=*/QualType());
1118911187

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

0 commit comments

Comments
 (0)