Skip to content

Commit 49df7fd

Browse files
committed
[FOLD] format
1 parent be7f3f0 commit 49df7fd

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
@@ -7739,11 +7739,8 @@ class Sema final {
77397739
bool InUnqualifiedLookup = false);
77407740
bool LookupQualifiedName(LookupResult &R, DeclContext *LookupCtx,
77417741
CXXScopeSpec &SS);
7742-
bool LookupParsedName(LookupResult &R,
7743-
Scope *S,
7744-
CXXScopeSpec *SS,
7745-
QualType ObjectType,
7746-
bool AllowBuiltinCreation = false,
7742+
bool LookupParsedName(LookupResult &R, Scope *S, CXXScopeSpec *SS,
7743+
QualType ObjectType, bool AllowBuiltinCreation = false,
77477744
bool EnteringContext = false);
77487745
ObjCProtocolDecl *
77497746
LookupProtocol(IdentifierInfo *II, SourceLocation IdLoc,
@@ -9152,12 +9149,13 @@ class Sema final {
91529149
bool EnteringContext, bool &MemberOfUnknownSpecialization,
91539150
RequiredTemplateKind RequiredTemplate = SourceLocation(),
91549151
AssumedTemplateKind *ATK = nullptr, bool AllowTypoCorrection = true);
9155-
9156-
bool LookupTemplateName(
9157-
LookupResult &R, Scope *S, CXXScopeSpec &SS, QualType ObjectType,
9158-
bool EnteringContext,
9159-
RequiredTemplateKind RequiredTemplate = SourceLocation(),
9160-
AssumedTemplateKind *ATK = nullptr, bool AllowTypoCorrection = true);
9152+
9153+
bool
9154+
LookupTemplateName(LookupResult &R, Scope *S, CXXScopeSpec &SS,
9155+
QualType ObjectType, bool EnteringContext,
9156+
RequiredTemplateKind RequiredTemplate = SourceLocation(),
9157+
AssumedTemplateKind *ATK = nullptr,
9158+
bool AllowTypoCorrection = true);
91619159

91629160
TemplateNameKind isTemplateName(Scope *S, CXXScopeSpec &SS,
91639161
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
@@ -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

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) {
@@ -5489,8 +5487,7 @@ Sema::BuildQualifiedTemplateIdExpr(CXXScopeSpec &SS,
54895487

54905488
LookupResult R(*this, NameInfo, LookupOrdinaryName);
54915489
if (LookupTemplateName(R, (Scope *)nullptr, SS, QualType(),
5492-
/*Entering*/false,
5493-
TemplateKWLoc))
5490+
/*Entering*/ false, TemplateKWLoc))
54945491
return ExprError();
54955492

54965493
if (R.isAmbiguous())
@@ -5616,8 +5613,8 @@ TemplateNameKind Sema::ActOnTemplateName(Scope *S,
56165613
RequiredTemplateKind RTK = TemplateKWLoc.isValid()
56175614
? RequiredTemplateKind(TemplateKWLoc)
56185615
: TemplateNameIsRequired;
5619-
if (!LookupTemplateName(R, S, SS, ObjectType.get(), EnteringContext,
5620-
RTK, /*ATK=*/nullptr, /*AllowTypoCorrection=*/false) &&
5616+
if (!LookupTemplateName(R, S, SS, ObjectType.get(), EnteringContext, RTK,
5617+
/*ATK=*/nullptr, /*AllowTypoCorrection=*/false) &&
56215618
!R.isAmbiguous()) {
56225619
if (LookupCtx)
56235620
Diag(Name.getBeginLoc(), diag::err_no_member)
@@ -11068,7 +11065,8 @@ DeclResult Sema::ActOnExplicitInstantiation(Scope *S,
1106811065
: TSK_ExplicitInstantiationDeclaration;
1106911066

1107011067
LookupResult Previous(*this, NameInfo, LookupOrdinaryName);
11071-
LookupParsedName(Previous, S, &D.getCXXScopeSpec(), /*ObjectType=*/QualType());
11068+
LookupParsedName(Previous, S, &D.getCXXScopeSpec(),
11069+
/*ObjectType=*/QualType());
1107211070

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

0 commit comments

Comments
 (0)