@@ -1746,8 +1746,7 @@ getSpellingListIndex(const std::vector<FlattenedSpelling> &SpellingList,
1746
1746
}
1747
1747
1748
1748
static void writeAttrAccessorDefinition (const Record &R, raw_ostream &OS) {
1749
- std::vector<const Record *> Accessors =
1750
- R.getValueAsListOfConstDefs (" Accessors" );
1749
+ std::vector<const Record *> Accessors = R.getValueAsListOfDefs (" Accessors" );
1751
1750
if (Accessors.empty ())
1752
1751
return ;
1753
1752
@@ -1964,19 +1963,19 @@ struct AttributeSubjectMatchRule {
1964
1963
1965
1964
std::vector<const Record *> getSubjects () const {
1966
1965
return (Constraint ? Constraint : MetaSubject)
1967
- ->getValueAsListOfConstDefs (" Subjects" );
1966
+ ->getValueAsListOfDefs (" Subjects" );
1968
1967
}
1969
1968
1970
1969
std::vector<const Record *> getLangOpts () const {
1971
1970
if (Constraint) {
1972
1971
// Lookup the options in the sub-rule first, in case the sub-rule
1973
1972
// overrides the rules options.
1974
1973
std::vector<const Record *> Opts =
1975
- Constraint->getValueAsListOfConstDefs (" LangOpts" );
1974
+ Constraint->getValueAsListOfDefs (" LangOpts" );
1976
1975
if (!Opts.empty ())
1977
1976
return Opts;
1978
1977
}
1979
- return MetaSubject->getValueAsListOfConstDefs (" LangOpts" );
1978
+ return MetaSubject->getValueAsListOfDefs (" LangOpts" );
1980
1979
}
1981
1980
1982
1981
// Abstract rules are used only for sub-rules
@@ -2105,7 +2104,7 @@ PragmaClangAttributeSupport::PragmaClangAttributeSupport(
2105
2104
const Record *Constraint) {
2106
2105
Rules.emplace_back (MetaSubject, Constraint);
2107
2106
for (const Record *Subject :
2108
- SubjectContainer->getValueAsListOfConstDefs (" Subjects" )) {
2107
+ SubjectContainer->getValueAsListOfDefs (" Subjects" )) {
2109
2108
bool Inserted =
2110
2109
SubjectsToRules
2111
2110
.try_emplace (Subject, RuleOrAggregateRuleSet::getRule (
@@ -2503,7 +2502,7 @@ static void emitClangAttrTypeArgList(const RecordKeeper &Records,
2503
2502
std::map<std::string, FSIVecTy> FSIMap;
2504
2503
for (const auto *Attr : Records.getAllDerivedDefinitions (" Attr" )) {
2505
2504
// Determine whether the first argument is a type.
2506
- std::vector<const Record *> Args = Attr->getValueAsListOfConstDefs (" Args" );
2505
+ std::vector<const Record *> Args = Attr->getValueAsListOfDefs (" Args" );
2507
2506
if (Args.empty ())
2508
2507
continue ;
2509
2508
@@ -2581,7 +2580,7 @@ static void emitClangAttrVariadicIdentifierArgList(const RecordKeeper &Records,
2581
2580
std::map<std::string, FSIVecTy> FSIMap;
2582
2581
for (const auto *A : Records.getAllDerivedDefinitions (" Attr" )) {
2583
2582
// Determine whether the first argument is a variadic identifier.
2584
- std::vector<const Record *> Args = A->getValueAsListOfConstDefs (" Args" );
2583
+ std::vector<const Record *> Args = A->getValueAsListOfDefs (" Args" );
2585
2584
if (Args.empty () || !isVariadicIdentifierArgument (Args[0 ]))
2586
2585
continue ;
2587
2586
generateFlattenedSpellingInfo (*A, FSIMap);
@@ -2614,7 +2613,7 @@ emitClangAttrUnevaluatedStringLiteralList(const RecordKeeper &Records,
2614
2613
std::map<std::string, FSIVecTy> FSIMap;
2615
2614
for (const auto *Attr : Records.getAllDerivedDefinitions (" Attr" )) {
2616
2615
// Determine whether there are any string arguments.
2617
- uint32_t ArgMask = MakeMask (Attr->getValueAsListOfConstDefs (" Args" ));
2616
+ uint32_t ArgMask = MakeMask (Attr->getValueAsListOfDefs (" Args" ));
2618
2617
if (!ArgMask)
2619
2618
continue ;
2620
2619
generateFlattenedSpellingInfo (*Attr, FSIMap, ArgMask);
@@ -2630,7 +2629,7 @@ static void emitClangAttrIdentifierArgList(const RecordKeeper &Records,
2630
2629
std::map<std::string, FSIVecTy> FSIMap;
2631
2630
for (const auto *Attr : Records.getAllDerivedDefinitions (" Attr" )) {
2632
2631
// Determine whether the first argument is an identifier.
2633
- std::vector<const Record *> Args = Attr->getValueAsListOfConstDefs (" Args" );
2632
+ std::vector<const Record *> Args = Attr->getValueAsListOfDefs (" Args" );
2634
2633
if (Args.empty () || !isIdentifierArgument (Args[0 ]))
2635
2634
continue ;
2636
2635
generateFlattenedSpellingInfo (*Attr, FSIMap);
@@ -2648,7 +2647,7 @@ static void emitClangAttrStrictIdentifierArgList(const RecordKeeper &Records,
2648
2647
if (!Attr->getValueAsBit (" StrictEnumParameters" ))
2649
2648
continue ;
2650
2649
// Check that there is really an identifier argument.
2651
- std::vector<const Record *> Args = Attr->getValueAsListOfConstDefs (" Args" );
2650
+ std::vector<const Record *> Args = Attr->getValueAsListOfDefs (" Args" );
2652
2651
if (none_of (Args, [&](const Record *R) { return isIdentifierArgument (R); }))
2653
2652
continue ;
2654
2653
generateFlattenedSpellingInfo (*Attr, FSIMap);
@@ -2670,7 +2669,7 @@ static void emitClangAttrThisIsaIdentifierArgList(const RecordKeeper &Records,
2670
2669
std::map<std::string, FSIVecTy> FSIMap;
2671
2670
for (const auto *A : Records.getAllDerivedDefinitions (" Attr" )) {
2672
2671
// Determine whether the first argument is a variadic identifier.
2673
- std::vector<const Record *> Args = A->getValueAsListOfConstDefs (" Args" );
2672
+ std::vector<const Record *> Args = A->getValueAsListOfDefs (" Args" );
2674
2673
if (Args.empty () || !keywordThisIsaIdentifierInArgument (Args[0 ]))
2675
2674
continue ;
2676
2675
generateFlattenedSpellingInfo (*A, FSIMap);
@@ -2763,8 +2762,7 @@ static void emitAttributes(const RecordKeeper &Records, raw_ostream &OS,
2763
2762
else
2764
2763
OS << " \n // " << R.getName () << " Attr implementation\n\n " ;
2765
2764
2766
- std::vector<const Record *> ArgRecords =
2767
- R.getValueAsListOfConstDefs (" Args" );
2765
+ std::vector<const Record *> ArgRecords = R.getValueAsListOfDefs (" Args" );
2768
2766
std::vector<std::unique_ptr<Argument>> Args;
2769
2767
Args.reserve (ArgRecords.size ());
2770
2768
@@ -3539,7 +3537,7 @@ void EmitClangAttrPCHRead(const RecordKeeper &Records, raw_ostream &OS) {
3539
3537
std::make_unique<VariadicExprArgument>(" DelayedArgs" , R.getName ());
3540
3538
DelayedArgs->writePCHReadDecls (OS);
3541
3539
}
3542
- ArgRecords = R.getValueAsListOfConstDefs (" Args" );
3540
+ ArgRecords = R.getValueAsListOfDefs (" Args" );
3543
3541
Args.clear ();
3544
3542
for (const auto *Arg : ArgRecords) {
3545
3543
Args.emplace_back (createArgument (*Arg, R.getName ()));
@@ -3578,7 +3576,7 @@ void EmitClangAttrPCHWrite(const RecordKeeper &Records, raw_ostream &OS) {
3578
3576
if (!R.getValueAsBit (" ASTNode" ))
3579
3577
continue ;
3580
3578
OS << " case attr::" << R.getName () << " : {\n " ;
3581
- std::vector<const Record *> Args = R.getValueAsListOfConstDefs (" Args" );
3579
+ std::vector<const Record *> Args = R.getValueAsListOfDefs (" Args" );
3582
3580
if (R.isSubClassOf (InhClass) || !Args.empty ())
3583
3581
OS << " const auto *SA = cast<" << R.getName ()
3584
3582
<< " Attr>(A);\n " ;
@@ -3769,7 +3767,7 @@ void EmitClangRegularKeywordAttributeInfo(const RecordKeeper &Records,
3769
3767
for (const auto &S : GetFlattenedSpellings (*R)) {
3770
3768
if (!isRegularKeywordAttribute (S))
3771
3769
continue ;
3772
- std::vector<const Record *> Args = R->getValueAsListOfConstDefs (" Args" );
3770
+ std::vector<const Record *> Args = R->getValueAsListOfDefs (" Args" );
3773
3771
bool HasArgs = any_of (
3774
3772
Args, [](const Record *Arg) { return !Arg->getValueAsBit (" Fake" ); });
3775
3773
@@ -3999,8 +3997,7 @@ void EmitClangAttrTemplateInstantiateHelper(ArrayRef<const Record *> Attrs,
3999
3997
continue ;
4000
3998
}
4001
3999
4002
- std::vector<const Record *> ArgRecords =
4003
- R.getValueAsListOfConstDefs (" Args" );
4000
+ std::vector<const Record *> ArgRecords = R.getValueAsListOfDefs (" Args" );
4004
4001
std::vector<std::unique_ptr<Argument>> Args;
4005
4002
Args.reserve (ArgRecords.size ());
4006
4003
@@ -4205,7 +4202,7 @@ static void GenerateAppertainsTo(const Record &Attr, raw_ostream &OS) {
4205
4202
4206
4203
const Record *SubjectObj = Attr.getValueAsDef (" Subjects" );
4207
4204
std::vector<const Record *> Subjects =
4208
- SubjectObj->getValueAsListOfConstDefs (" Subjects" );
4205
+ SubjectObj->getValueAsListOfDefs (" Subjects" );
4209
4206
4210
4207
// If the list of subjects is empty, it is assumed that the attribute
4211
4208
// appertains to everything.
@@ -4337,7 +4334,7 @@ static void GenerateMutualExclusionsChecks(const Record &Attr,
4337
4334
for (const Record *Exclusion :
4338
4335
Records.getAllDerivedDefinitions (" MutualExclusions" )) {
4339
4336
std::vector<const Record *> MutuallyExclusiveAttrs =
4340
- Exclusion->getValueAsListOfConstDefs (" Exclusions" );
4337
+ Exclusion->getValueAsListOfDefs (" Exclusions" );
4341
4338
auto IsCurAttr = [Attr](const Record *R) {
4342
4339
return R->getName () == Attr.getName ();
4343
4340
};
@@ -4483,8 +4480,7 @@ static void GenerateLangOptRequirements(const Record &R,
4483
4480
raw_ostream &OS) {
4484
4481
// If the attribute has an empty or unset list of language requirements,
4485
4482
// use the default handler.
4486
- std::vector<const Record *> LangOpts =
4487
- R.getValueAsListOfConstDefs (" LangOpts" );
4483
+ std::vector<const Record *> LangOpts = R.getValueAsListOfDefs (" LangOpts" );
4488
4484
if (LangOpts.empty ())
4489
4485
return ;
4490
4486
@@ -4629,7 +4625,7 @@ static bool isParamExpr(const Record *Arg) {
4629
4625
void GenerateIsParamExpr (const Record &Attr, raw_ostream &OS) {
4630
4626
OS << " bool isParamExpr(size_t N) const override {\n " ;
4631
4627
OS << " return " ;
4632
- auto Args = Attr.getValueAsListOfConstDefs (" Args" );
4628
+ auto Args = Attr.getValueAsListOfDefs (" Args" );
4633
4629
for (size_t I = 0 ; I < Args.size (); ++I)
4634
4630
if (isParamExpr (Args[I]))
4635
4631
OS << " (N == " << I << " ) || " ;
@@ -4792,7 +4788,7 @@ void EmitClangAttrParsedAttrImpl(const RecordKeeper &Records, raw_ostream &OS) {
4792
4788
GenerateLangOptRequirements (Attr, OS);
4793
4789
GenerateTargetRequirements (Attr, Dupes, OS);
4794
4790
GenerateSpellingTargetRequirements (
4795
- Attr, Attr.getValueAsListOfConstDefs (" TargetSpecificSpellings" ), OS);
4791
+ Attr, Attr.getValueAsListOfDefs (" TargetSpecificSpellings" ), OS);
4796
4792
GenerateSpellingIndexToSemanticSpelling (Attr, OS);
4797
4793
PragmaAttributeSupport.generateStrictConformsTo (*I->second , OS);
4798
4794
GenerateHandleDeclAttribute (Attr, OS);
@@ -4959,7 +4955,7 @@ void EmitClangAttrTextNodeDump(const RecordKeeper &Records, raw_ostream &OS) {
4959
4955
if (Spellings.size () > 1 && !SpellingNamesAreCommon (Spellings))
4960
4956
SS << " OS << \" \" << A->getSpelling();\n " ;
4961
4957
4962
- std::vector<const Record *> Args = R.getValueAsListOfConstDefs (" Args" );
4958
+ std::vector<const Record *> Args = R.getValueAsListOfDefs (" Args" );
4963
4959
for (const auto *Arg : Args)
4964
4960
createArgument (*Arg, R.getName ())->writeDump (SS);
4965
4961
@@ -4989,7 +4985,7 @@ void EmitClangAttrNodeTraverse(const RecordKeeper &Records, raw_ostream &OS) {
4989
4985
std::string FunctionContent;
4990
4986
raw_string_ostream SS (FunctionContent);
4991
4987
4992
- std::vector<const Record *> Args = R.getValueAsListOfConstDefs (" Args" );
4988
+ std::vector<const Record *> Args = R.getValueAsListOfDefs (" Args" );
4993
4989
for (const auto *Arg : Args)
4994
4990
createArgument (*Arg, R.getName ())->writeDumpChildren (SS);
4995
4991
if (Attr->getValueAsBit (" AcceptsExprPack" ))
@@ -5033,8 +5029,7 @@ void EmitClangAttrDocTable(const RecordKeeper &Records, raw_ostream &OS) {
5033
5029
for (const auto *A : Records.getAllDerivedDefinitions (" Attr" )) {
5034
5030
if (!A->getValueAsBit (" ASTNode" ))
5035
5031
continue ;
5036
- std::vector<const Record *> Docs =
5037
- A->getValueAsListOfConstDefs (" Documentation" );
5032
+ std::vector<const Record *> Docs = A->getValueAsListOfDefs (" Documentation" );
5038
5033
assert (!Docs.empty ());
5039
5034
// Only look at the first documentation if there are several.
5040
5035
// (Currently there's only one such attr, revisit if this becomes common).
@@ -5254,7 +5249,7 @@ void EmitClangAttrDocs(const RecordKeeper &Records, raw_ostream &OS) {
5254
5249
for (const auto *A : Records.getAllDerivedDefinitions (" Attr" )) {
5255
5250
const Record &Attr = *A;
5256
5251
std::vector<const Record *> Docs =
5257
- Attr.getValueAsListOfConstDefs (" Documentation" );
5252
+ Attr.getValueAsListOfDefs (" Documentation" );
5258
5253
for (const auto *D : Docs) {
5259
5254
const Record &Doc = *D;
5260
5255
const Record *Category = Doc.getValueAsDef (" Category" );
0 commit comments