Skip to content

Commit 5e510b8

Browse files
committed
[FOLD] factor out some NFC changes
1 parent be3a1f3 commit 5e510b8

File tree

5 files changed

+20
-18
lines changed

5 files changed

+20
-18
lines changed

clang/include/clang/Sema/Sema.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6943,7 +6943,7 @@ class Sema final : public SemaBase {
69436943
const TemplateArgumentListInfo *TemplateArgs);
69446944

69456945
ExprResult ActOnMemberAccessExpr(Scope *S, Expr *Base, SourceLocation OpLoc,
6946-
bool IsArrow, CXXScopeSpec &SS,
6946+
tok::TokenKind OpKind, CXXScopeSpec &SS,
69476947
SourceLocation TemplateKWLoc,
69486948
UnqualifiedId &Member, Decl *ObjCImpDecl);
69496949

clang/lib/Parse/ParseDeclCXX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ Parser::DeclGroupPtrTy Parser::ParseUsingDeclaration(
720720
return nullptr;
721721
}
722722
CXXScopeSpec SS;
723-
if (ParseOptionalCXXScopeSpecifier(SS, /*ObjectType=*/nullptr,
723+
if (ParseOptionalCXXScopeSpecifier(SS, /*ParsedType=*/nullptr,
724724
/*ObectHasErrors=*/false,
725725
/*EnteringConttext=*/false,
726726
/*MayBePseudoDestructor=*/nullptr,

clang/lib/Parse/ParseExpr.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2254,7 +2254,6 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
22542254
}
22552255
break;
22562256
}
2257-
22582257
ParseOptionalCXXScopeSpecifier(
22592258
SS, ObjectType, LHS.get() && LHS.get()->containsErrors(),
22602259
/*EnteringContext=*/false, &MayBePseudoDestructor);
@@ -2329,10 +2328,10 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
23292328
}
23302329

23312330
if (!LHS.isInvalid())
2332-
LHS = Actions.ActOnMemberAccessExpr(
2333-
getCurScope(), LHS.get(), OpLoc, OpKind == tok::arrow, SS,
2334-
TemplateKWLoc, Name,
2335-
CurParsedObjCImpl ? CurParsedObjCImpl->Dcl : nullptr);
2331+
LHS = Actions.ActOnMemberAccessExpr(getCurScope(), LHS.get(), OpLoc,
2332+
OpKind, SS, TemplateKWLoc, Name,
2333+
CurParsedObjCImpl ? CurParsedObjCImpl->Dcl
2334+
: nullptr);
23362335
if (!LHS.isInvalid()) {
23372336
if (Tok.is(tok::less))
23382337
checkPotentialAngleBracket(LHS);

clang/lib/Sema/SemaExprMember.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ ExprResult Sema::BuildMemberReferenceExpr(
10461046
if (RetryExpr.isUsable() && !Trap.hasErrorOccurred()) {
10471047
CXXScopeSpec TempSS(SS);
10481048
RetryExpr = ActOnMemberAccessExpr(
1049-
ExtraArgs->S, RetryExpr.get(), OpLoc, /*IsArrow=*/true, TempSS,
1049+
ExtraArgs->S, RetryExpr.get(), OpLoc, tok::arrow, TempSS,
10501050
TemplateKWLoc, ExtraArgs->Id, ExtraArgs->ObjCImpDecl);
10511051
}
10521052
if (Trap.hasErrorOccurred())
@@ -1760,10 +1760,12 @@ static ExprResult LookupMemberExpr(Sema &S, LookupResult &R,
17601760
/// decl; this is an ugly hack around the fact that Objective-C
17611761
/// \@implementations aren't properly put in the context chain
17621762
ExprResult Sema::ActOnMemberAccessExpr(Scope *S, Expr *Base,
1763-
SourceLocation OpLoc, bool IsArrow,
1763+
SourceLocation OpLoc,
1764+
tok::TokenKind OpKind,
17641765
CXXScopeSpec &SS,
17651766
SourceLocation TemplateKWLoc,
1766-
UnqualifiedId &Id, Decl *ObjCImpDecl) {
1767+
UnqualifiedId &Id,
1768+
Decl *ObjCImpDecl) {
17671769
if (SS.isSet() && SS.isInvalid())
17681770
return ExprError();
17691771

@@ -1780,6 +1782,7 @@ ExprResult Sema::ActOnMemberAccessExpr(Scope *S, Expr *Base,
17801782
const TemplateArgumentListInfo *TemplateArgs;
17811783
DecomposeUnqualifiedId(Id, TemplateArgsBuffer,
17821784
NameInfo, TemplateArgs);
1785+
bool IsArrow = OpKind == tok::arrow;
17831786

17841787
if (getLangOpts().HLSL && IsArrow)
17851788
return ExprError(Diag(OpLoc, diag::err_hlsl_operator_unsupported) << 2);

clang/lib/Sema/SemaPseudoObject.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,10 +1395,10 @@ ExprResult MSPropertyOpBuilder::buildGet() {
13951395
GetterName.setIdentifier(II, RefExpr->getMemberLoc());
13961396
CXXScopeSpec SS;
13971397
SS.Adopt(RefExpr->getQualifierLoc());
1398-
ExprResult GetterExpr = S.ActOnMemberAccessExpr(
1399-
S.getCurScope(), InstanceBase, /*OpLoc=*/SourceLocation(),
1400-
RefExpr->isArrow(), SS, /*TemplateKWLoc=*/SourceLocation(), GetterName,
1401-
/*ObjCImpDecl=*/nullptr);
1398+
ExprResult GetterExpr =
1399+
S.ActOnMemberAccessExpr(S.getCurScope(), InstanceBase, SourceLocation(),
1400+
RefExpr->isArrow() ? tok::arrow : tok::period, SS,
1401+
SourceLocation(), GetterName, nullptr);
14021402
if (GetterExpr.isInvalid()) {
14031403
S.Diag(RefExpr->getMemberLoc(),
14041404
diag::err_cannot_find_suitable_accessor) << 0 /* getter */
@@ -1424,10 +1424,10 @@ ExprResult MSPropertyOpBuilder::buildSet(Expr *op, SourceLocation sl,
14241424
SetterName.setIdentifier(II, RefExpr->getMemberLoc());
14251425
CXXScopeSpec SS;
14261426
SS.Adopt(RefExpr->getQualifierLoc());
1427-
ExprResult SetterExpr = S.ActOnMemberAccessExpr(
1428-
S.getCurScope(), InstanceBase, /*OpLoc=*/SourceLocation(),
1429-
RefExpr->isArrow(), SS, /*TemplateKWLoc=*/SourceLocation(), SetterName,
1430-
/*ObjCImpDecl=*/nullptr);
1427+
ExprResult SetterExpr =
1428+
S.ActOnMemberAccessExpr(S.getCurScope(), InstanceBase, SourceLocation(),
1429+
RefExpr->isArrow() ? tok::arrow : tok::period, SS,
1430+
SourceLocation(), SetterName, nullptr);
14311431
if (SetterExpr.isInvalid()) {
14321432
S.Diag(RefExpr->getMemberLoc(),
14331433
diag::err_cannot_find_suitable_accessor) << 1 /* setter */

0 commit comments

Comments
 (0)