Skip to content

Commit 285412a

Browse files
committed
Rename functions (NFC)
takeAttributesAppend -> takeAttributesAppending prependAll -> prepend appendAll -> append
1 parent ecf29ba commit 285412a

File tree

9 files changed

+27
-27
lines changed

9 files changed

+27
-27
lines changed

clang/include/clang/Parse/Parser.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2173,7 +2173,7 @@ class Parser : public CodeCompletionHandler {
21732173
if (Tok.is(tok::kw___attribute)) {
21742174
ParsedAttributes Attrs(AttrFactory);
21752175
ParseGNUAttributes(Attrs, LateAttrs, &D);
2176-
D.takeAttributesAppend(Attrs);
2176+
D.takeAttributesAppending(Attrs);
21772177
}
21782178
}
21792179

@@ -2272,7 +2272,7 @@ class Parser : public CodeCompletionHandler {
22722272
if (isAllowedCXX11AttributeSpecifier()) {
22732273
ParsedAttributes Attrs(AttrFactory);
22742274
ParseCXX11Attributes(Attrs);
2275-
D.takeAttributesAppend(Attrs);
2275+
D.takeAttributesAppending(Attrs);
22762276
}
22772277
}
22782278

@@ -5175,7 +5175,7 @@ class Parser : public CodeCompletionHandler {
51755175
if (Tok.is(tok::colon)) {
51765176
ParsedAttributes Attrs(AttrFactory);
51775177
ParseHLSLAnnotations(Attrs, EndLoc, CouldBeBitField);
5178-
D.takeAttributesAppend(Attrs);
5178+
D.takeAttributesAppending(Attrs);
51795179
return true;
51805180
}
51815181
return false;

clang/include/clang/Sema/DeclSpec.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -835,15 +835,15 @@ class DeclSpec {
835835
/// \endcode
836836
///
837837
void addAttributes(const ParsedAttributesView &AL) {
838-
Attrs.prependAll(AL.begin(), AL.end());
838+
Attrs.prepend(AL.begin(), AL.end());
839839
}
840840

841841
bool hasAttributes() const { return !Attrs.empty(); }
842842

843843
ParsedAttributes &getAttributes() { return Attrs; }
844844
const ParsedAttributes &getAttributes() const { return Attrs; }
845845

846-
void takeAttributesAppendingFrom(ParsedAttributes &attrs) {
846+
void takeAttributesAppendingingFrom(ParsedAttributes &attrs) {
847847
Attrs.takeAllAppendingFrom(attrs);
848848
}
849849

@@ -2327,7 +2327,7 @@ class Declarator {
23272327
void AddTypeInfo(const DeclaratorChunk &TI, ParsedAttributes &&attrs,
23282328
SourceLocation EndLoc) {
23292329
DeclTypeInfo.push_back(TI);
2330-
DeclTypeInfo.back().getAttrs().prependAll(attrs.begin(), attrs.end());
2330+
DeclTypeInfo.back().getAttrs().prepend(attrs.begin(), attrs.end());
23312331
getAttributePool().takeAllFrom(attrs.getPool());
23322332

23332333
if (!EndLoc.isInvalid())
@@ -2638,16 +2638,16 @@ class Declarator {
26382638
return InventedTemplateParameterList;
26392639
}
26402640

2641-
/// takeAttributesAppend - Takes attributes from the given parsed-attributes
2642-
/// set and add them to this declarator.
2641+
/// takeAttributesAppending - Takes attributes from the given
2642+
/// parsed-attributes set and add them to this declarator.
26432643
///
26442644
/// These examples both add 3 attributes to "var":
26452645
/// short int var __attribute__((aligned(16),common,deprecated));
26462646
/// short int x, __attribute__((aligned(16)) var
26472647
/// __attribute__((common,deprecated));
26482648
///
26492649
/// Also extends the range of the declarator.
2650-
void takeAttributesAppend(ParsedAttributes &attrs) {
2650+
void takeAttributesAppending(ParsedAttributes &attrs) {
26512651
Attrs.takeAllAppendingFrom(attrs);
26522652

26532653
if (attrs.Range.getEnd().isValid())

clang/include/clang/Sema/ParsedAttr.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -856,19 +856,19 @@ class ParsedAttributesView {
856856
friend class ParsedAttributesView;
857857
};
858858

859-
void prependAll(iterator B, iterator E) {
859+
void prepend(iterator B, iterator E) {
860860
AttrList.insert(AttrList.begin(), B.I, E.I);
861861
}
862862

863-
void prependAll(const_iterator B, const_iterator E) {
863+
void prepend(const_iterator B, const_iterator E) {
864864
AttrList.insert(AttrList.begin(), B.I, E.I);
865865
}
866866

867-
void appendAll(iterator B, iterator E) {
867+
void append(iterator B, iterator E) {
868868
AttrList.insert(AttrList.end(), B.I, E.I);
869869
}
870870

871-
void appendAll(const_iterator B, const_iterator E) {
871+
void append(const_iterator B, const_iterator E) {
872872
AttrList.insert(AttrList.end(), B.I, E.I);
873873
}
874874

@@ -946,15 +946,15 @@ class ParsedAttributes : public ParsedAttributesView {
946946
void takeAllPrependingFrom(ParsedAttributes &Other) {
947947
assert(&Other != this &&
948948
"ParsedAttributes can't take attributes from itself");
949-
prependAll(Other.begin(), Other.end());
949+
prepend(Other.begin(), Other.end());
950950
Other.clearListOnly();
951951
pool.takeAllFrom(Other.pool);
952952
}
953953

954954
void takeAllAppendingFrom(ParsedAttributes &Other) {
955955
assert(&Other != this &&
956956
"ParsedAttributes can't take attributes from itself");
957-
appendAll(Other.begin(), Other.end());
957+
append(Other.begin(), Other.end());
958958
Other.clearListOnly();
959959
pool.takeAllFrom(Other.pool);
960960
}

clang/lib/Parse/ParseDecl.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,12 +1934,12 @@ Parser::DeclGroupPtrTy Parser::ParseSimpleDeclaration(
19341934
bool RequireSemi, ForRangeInit *FRI, SourceLocation *DeclSpecStart) {
19351935
// Need to retain these for diagnostics before we add them to the DeclSepc.
19361936
ParsedAttributesView OriginalDeclSpecAttrs;
1937-
OriginalDeclSpecAttrs.prependAll(DeclSpecAttrs.begin(), DeclSpecAttrs.end());
1937+
OriginalDeclSpecAttrs.prepend(DeclSpecAttrs.begin(), DeclSpecAttrs.end());
19381938
OriginalDeclSpecAttrs.Range = DeclSpecAttrs.Range;
19391939

19401940
// Parse the common declaration-specifiers piece.
19411941
ParsingDeclSpec DS(*this);
1942-
DS.takeAttributesAppendingFrom(DeclSpecAttrs);
1942+
DS.takeAttributesAppendingingFrom(DeclSpecAttrs);
19431943

19441944
ParsedTemplateInfo TemplateInfo;
19451945
DeclSpecContext DSContext = getDeclSpecContextFromDeclaratorContext(Context);
@@ -3462,7 +3462,7 @@ void Parser::ParseDeclarationSpecifiers(
34623462
PA.setInvalid();
34633463
}
34643464

3465-
DS.takeAttributesAppendingFrom(attrs);
3465+
DS.takeAttributesAppendingingFrom(attrs);
34663466
}
34673467

34683468
// If this is not a declaration specifier token, we're done reading decl
@@ -6122,7 +6122,7 @@ void Parser::ParseTypeQualifierListOpt(
61226122
isAllowedCXX11AttributeSpecifier()) {
61236123
ParsedAttributes Attrs(AttrFactory);
61246124
ParseCXX11Attributes(Attrs);
6125-
DS.takeAttributesAppendingFrom(Attrs);
6125+
DS.takeAttributesAppendingingFrom(Attrs);
61266126
}
61276127

61286128
SourceLocation EndLoc;
@@ -7505,7 +7505,7 @@ void Parser::ParseParameterDeclarationClause(
75057505
DeclSpecContext::DSC_normal,
75067506
/*LateAttrs=*/nullptr, AllowImplicitTypename);
75077507

7508-
DS.takeAttributesAppendingFrom(ArgDeclSpecAttrs);
7508+
DS.takeAttributesAppendingingFrom(ArgDeclSpecAttrs);
75097509

75107510
// Parse the declarator. This is "PrototypeContext" or
75117511
// "LambdaExprParameterContext", because we must accept either

clang/lib/Parse/ParseDeclCXX.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ Parser::DeclGroupPtrTy Parser::ParseUsingDeclaration(
787787
// Parse (optional) attributes.
788788
MaybeParseAttributes(PAKM_GNU | PAKM_CXX11, Attrs);
789789
DiagnoseCXX11AttributeExtension(Attrs);
790-
Attrs.prependAll(PrefixAttrs.begin(), PrefixAttrs.end());
790+
Attrs.prepend(PrefixAttrs.begin(), PrefixAttrs.end());
791791

792792
if (InvalidDeclarator)
793793
SkipUntil(tok::comma, tok::semi, StopBeforeMatch);
@@ -2842,7 +2842,7 @@ Parser::DeclGroupPtrTy Parser::ParseCXXClassMemberDeclaration(
28422842
// decl-specifier-seq:
28432843
// Parse the common declaration-specifiers piece.
28442844
ParsingDeclSpec DS(*this, TemplateDiags);
2845-
DS.takeAttributesAppendingFrom(DeclSpecAttrs);
2845+
DS.takeAttributesAppendingingFrom(DeclSpecAttrs);
28462846

28472847
if (MalformedTypeSpec)
28482848
DS.SetTypeSpecError();

clang/lib/Parse/ParseExprCXX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ ExprResult Parser::ParseLambdaExpressionAfterIntroducer(
12441244
break;
12451245
}
12461246

1247-
D.takeAttributesAppend(Attributes);
1247+
D.takeAttributesAppending(Attributes);
12481248
}
12491249

12501250
MultiParseScope TemplateParamScope(*this);

clang/lib/Parse/ParseTemplate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ Parser::DeclGroupPtrTy Parser::ParseDeclarationAfterTemplate(
196196
ParsingDeclSpec DS(*this, &DiagsFromTParams);
197197
DS.SetRangeStart(DeclSpecAttrs.Range.getBegin());
198198
DS.SetRangeEnd(DeclSpecAttrs.Range.getEnd());
199-
DS.takeAttributesAppendingFrom(DeclSpecAttrs);
199+
DS.takeAttributesAppendingingFrom(DeclSpecAttrs);
200200

201201
ParseDeclarationSpecifiers(DS, TemplateInfo, AS,
202202
getDeclSpecContextFromDeclaratorContext(Context));

clang/lib/Parse/Parser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ Parser::DeclGroupPtrTy Parser::ParseDeclOrFunctionDefInternal(
10831083
"expected uninitialised source range");
10841084
DS.SetRangeStart(DeclSpecAttrs.Range.getBegin());
10851085
DS.SetRangeEnd(DeclSpecAttrs.Range.getEnd());
1086-
DS.takeAttributesAppendingFrom(DeclSpecAttrs);
1086+
DS.takeAttributesAppendingingFrom(DeclSpecAttrs);
10871087

10881088
ParsedTemplateInfo TemplateInfo;
10891089
MaybeParseMicrosoftAttributes(DS.getAttributes());
@@ -1155,7 +1155,7 @@ Parser::DeclGroupPtrTy Parser::ParseDeclOrFunctionDefInternal(
11551155
}
11561156

11571157
DS.abort();
1158-
DS.takeAttributesAppendingFrom(Attrs);
1158+
DS.takeAttributesAppendingingFrom(Attrs);
11591159

11601160
const char *PrevSpec = nullptr;
11611161
unsigned DiagID;

clang/lib/Sema/SemaDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14637,7 +14637,7 @@ StmtResult Sema::ActOnCXXForRangeIdentifier(Scope *S, SourceLocation IdentLoc,
1463714637

1463814638
Declarator D(DS, ParsedAttributesView::none(), DeclaratorContext::ForInit);
1463914639
D.SetIdentifier(Ident, IdentLoc);
14640-
D.takeAttributesAppend(Attrs);
14640+
D.takeAttributesAppending(Attrs);
1464114641

1464214642
D.AddTypeInfo(DeclaratorChunk::getReference(0, IdentLoc, /*lvalue*/ false),
1464314643
IdentLoc);

0 commit comments

Comments
 (0)