Skip to content

Commit f5d41c1

Browse files
authored
[clang][Sema] Rename ActOnIVar parameter (llvm#66181)
I don't now squat about Objective C, but the extra variable (and cast) seemed unnecessary and this is a good opportunity to re-format that ugly parameter list.
1 parent 4b14148 commit f5d41c1

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

clang/include/clang/Sema/Sema.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3499,9 +3499,8 @@ class Sema final {
34993499

35003500
void ActOnLastBitfield(SourceLocation DeclStart,
35013501
SmallVectorImpl<Decl *> &AllIvarDecls);
3502-
Decl *ActOnIvar(Scope *S, SourceLocation DeclStart,
3503-
Declarator &D, Expr *BitfieldWidth,
3504-
tok::ObjCKeywordKind visibility);
3502+
Decl *ActOnIvar(Scope *S, SourceLocation DeclStart, Declarator &D,
3503+
Expr *BitWidth, tok::ObjCKeywordKind visibility);
35053504

35063505
// This is used for both record definitions and ObjC interface declarations.
35073506
void ActOnFields(Scope *S, SourceLocation RecLoc, Decl *TagDecl,

clang/lib/Sema/SemaDecl.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18556,13 +18556,10 @@ TranslateIvarVisibility(tok::ObjCKeywordKind ivarVisibility) {
1855618556

1855718557
/// ActOnIvar - Each ivar field of an objective-c class is passed into this
1855818558
/// in order to create an IvarDecl object for it.
18559-
Decl *Sema::ActOnIvar(Scope *S,
18560-
SourceLocation DeclStart,
18561-
Declarator &D, Expr *BitfieldWidth,
18562-
tok::ObjCKeywordKind Visibility) {
18559+
Decl *Sema::ActOnIvar(Scope *S, SourceLocation DeclStart, Declarator &D,
18560+
Expr *BitWidth, tok::ObjCKeywordKind Visibility) {
1856318561

1856418562
IdentifierInfo *II = D.getIdentifier();
18565-
Expr *BitWidth = (Expr*)BitfieldWidth;
1856618563
SourceLocation Loc = DeclStart;
1856718564
if (II) Loc = D.getIdentifierLoc();
1856818565

@@ -18625,9 +18622,8 @@ Decl *Sema::ActOnIvar(Scope *S,
1862518622
}
1862618623

1862718624
// Construct the decl.
18628-
ObjCIvarDecl *NewID = ObjCIvarDecl::Create(Context, EnclosingContext,
18629-
DeclStart, Loc, II, T,
18630-
TInfo, ac, (Expr *)BitfieldWidth);
18625+
ObjCIvarDecl *NewID = ObjCIvarDecl::Create(
18626+
Context, EnclosingContext, DeclStart, Loc, II, T, TInfo, ac, BitWidth);
1863118627

1863218628
if (II) {
1863318629
NamedDecl *PrevDecl = LookupSingleName(S, II, Loc, LookupMemberName,

0 commit comments

Comments
 (0)