@@ -1746,8 +1746,7 @@ getSpellingListIndex(const std::vector<FlattenedSpelling> &SpellingList,
17461746}
17471747
17481748static 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" );
17511750 if (Accessors.empty ())
17521751 return ;
17531752
@@ -1964,19 +1963,19 @@ struct AttributeSubjectMatchRule {
19641963
19651964 std::vector<const Record *> getSubjects () const {
19661965 return (Constraint ? Constraint : MetaSubject)
1967- ->getValueAsListOfConstDefs (" Subjects" );
1966+ ->getValueAsListOfDefs (" Subjects" );
19681967 }
19691968
19701969 std::vector<const Record *> getLangOpts () const {
19711970 if (Constraint) {
19721971 // Lookup the options in the sub-rule first, in case the sub-rule
19731972 // overrides the rules options.
19741973 std::vector<const Record *> Opts =
1975- Constraint->getValueAsListOfConstDefs (" LangOpts" );
1974+ Constraint->getValueAsListOfDefs (" LangOpts" );
19761975 if (!Opts.empty ())
19771976 return Opts;
19781977 }
1979- return MetaSubject->getValueAsListOfConstDefs (" LangOpts" );
1978+ return MetaSubject->getValueAsListOfDefs (" LangOpts" );
19801979 }
19811980
19821981 // Abstract rules are used only for sub-rules
@@ -2105,7 +2104,7 @@ PragmaClangAttributeSupport::PragmaClangAttributeSupport(
21052104 const Record *Constraint) {
21062105 Rules.emplace_back (MetaSubject, Constraint);
21072106 for (const Record *Subject :
2108- SubjectContainer->getValueAsListOfConstDefs (" Subjects" )) {
2107+ SubjectContainer->getValueAsListOfDefs (" Subjects" )) {
21092108 bool Inserted =
21102109 SubjectsToRules
21112110 .try_emplace (Subject, RuleOrAggregateRuleSet::getRule (
@@ -2503,7 +2502,7 @@ static void emitClangAttrTypeArgList(const RecordKeeper &Records,
25032502 std::map<std::string, FSIVecTy> FSIMap;
25042503 for (const auto *Attr : Records.getAllDerivedDefinitions (" Attr" )) {
25052504 // 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" );
25072506 if (Args.empty ())
25082507 continue ;
25092508
@@ -2581,7 +2580,7 @@ static void emitClangAttrVariadicIdentifierArgList(const RecordKeeper &Records,
25812580 std::map<std::string, FSIVecTy> FSIMap;
25822581 for (const auto *A : Records.getAllDerivedDefinitions (" Attr" )) {
25832582 // 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" );
25852584 if (Args.empty () || !isVariadicIdentifierArgument (Args[0 ]))
25862585 continue ;
25872586 generateFlattenedSpellingInfo (*A, FSIMap);
@@ -2614,7 +2613,7 @@ emitClangAttrUnevaluatedStringLiteralList(const RecordKeeper &Records,
26142613 std::map<std::string, FSIVecTy> FSIMap;
26152614 for (const auto *Attr : Records.getAllDerivedDefinitions (" Attr" )) {
26162615 // Determine whether there are any string arguments.
2617- uint32_t ArgMask = MakeMask (Attr->getValueAsListOfConstDefs (" Args" ));
2616+ uint32_t ArgMask = MakeMask (Attr->getValueAsListOfDefs (" Args" ));
26182617 if (!ArgMask)
26192618 continue ;
26202619 generateFlattenedSpellingInfo (*Attr, FSIMap, ArgMask);
@@ -2630,7 +2629,7 @@ static void emitClangAttrIdentifierArgList(const RecordKeeper &Records,
26302629 std::map<std::string, FSIVecTy> FSIMap;
26312630 for (const auto *Attr : Records.getAllDerivedDefinitions (" Attr" )) {
26322631 // 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" );
26342633 if (Args.empty () || !isIdentifierArgument (Args[0 ]))
26352634 continue ;
26362635 generateFlattenedSpellingInfo (*Attr, FSIMap);
@@ -2648,7 +2647,7 @@ static void emitClangAttrStrictIdentifierArgList(const RecordKeeper &Records,
26482647 if (!Attr->getValueAsBit (" StrictEnumParameters" ))
26492648 continue ;
26502649 // 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" );
26522651 if (none_of (Args, [&](const Record *R) { return isIdentifierArgument (R); }))
26532652 continue ;
26542653 generateFlattenedSpellingInfo (*Attr, FSIMap);
@@ -2670,7 +2669,7 @@ static void emitClangAttrThisIsaIdentifierArgList(const RecordKeeper &Records,
26702669 std::map<std::string, FSIVecTy> FSIMap;
26712670 for (const auto *A : Records.getAllDerivedDefinitions (" Attr" )) {
26722671 // 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" );
26742673 if (Args.empty () || !keywordThisIsaIdentifierInArgument (Args[0 ]))
26752674 continue ;
26762675 generateFlattenedSpellingInfo (*A, FSIMap);
@@ -2763,8 +2762,7 @@ static void emitAttributes(const RecordKeeper &Records, raw_ostream &OS,
27632762 else
27642763 OS << " \n // " << R.getName () << " Attr implementation\n\n " ;
27652764
2766- std::vector<const Record *> ArgRecords =
2767- R.getValueAsListOfConstDefs (" Args" );
2765+ std::vector<const Record *> ArgRecords = R.getValueAsListOfDefs (" Args" );
27682766 std::vector<std::unique_ptr<Argument>> Args;
27692767 Args.reserve (ArgRecords.size ());
27702768
@@ -3539,7 +3537,7 @@ void EmitClangAttrPCHRead(const RecordKeeper &Records, raw_ostream &OS) {
35393537 std::make_unique<VariadicExprArgument>(" DelayedArgs" , R.getName ());
35403538 DelayedArgs->writePCHReadDecls (OS);
35413539 }
3542- ArgRecords = R.getValueAsListOfConstDefs (" Args" );
3540+ ArgRecords = R.getValueAsListOfDefs (" Args" );
35433541 Args.clear ();
35443542 for (const auto *Arg : ArgRecords) {
35453543 Args.emplace_back (createArgument (*Arg, R.getName ()));
@@ -3578,7 +3576,7 @@ void EmitClangAttrPCHWrite(const RecordKeeper &Records, raw_ostream &OS) {
35783576 if (!R.getValueAsBit (" ASTNode" ))
35793577 continue ;
35803578 OS << " case attr::" << R.getName () << " : {\n " ;
3581- std::vector<const Record *> Args = R.getValueAsListOfConstDefs (" Args" );
3579+ std::vector<const Record *> Args = R.getValueAsListOfDefs (" Args" );
35823580 if (R.isSubClassOf (InhClass) || !Args.empty ())
35833581 OS << " const auto *SA = cast<" << R.getName ()
35843582 << " Attr>(A);\n " ;
@@ -3769,7 +3767,7 @@ void EmitClangRegularKeywordAttributeInfo(const RecordKeeper &Records,
37693767 for (const auto &S : GetFlattenedSpellings (*R)) {
37703768 if (!isRegularKeywordAttribute (S))
37713769 continue ;
3772- std::vector<const Record *> Args = R->getValueAsListOfConstDefs (" Args" );
3770+ std::vector<const Record *> Args = R->getValueAsListOfDefs (" Args" );
37733771 bool HasArgs = any_of (
37743772 Args, [](const Record *Arg) { return !Arg->getValueAsBit (" Fake" ); });
37753773
@@ -3999,8 +3997,7 @@ void EmitClangAttrTemplateInstantiateHelper(ArrayRef<const Record *> Attrs,
39993997 continue ;
40003998 }
40013999
4002- std::vector<const Record *> ArgRecords =
4003- R.getValueAsListOfConstDefs (" Args" );
4000+ std::vector<const Record *> ArgRecords = R.getValueAsListOfDefs (" Args" );
40044001 std::vector<std::unique_ptr<Argument>> Args;
40054002 Args.reserve (ArgRecords.size ());
40064003
@@ -4205,7 +4202,7 @@ static void GenerateAppertainsTo(const Record &Attr, raw_ostream &OS) {
42054202
42064203 const Record *SubjectObj = Attr.getValueAsDef (" Subjects" );
42074204 std::vector<const Record *> Subjects =
4208- SubjectObj->getValueAsListOfConstDefs (" Subjects" );
4205+ SubjectObj->getValueAsListOfDefs (" Subjects" );
42094206
42104207 // If the list of subjects is empty, it is assumed that the attribute
42114208 // appertains to everything.
@@ -4337,7 +4334,7 @@ static void GenerateMutualExclusionsChecks(const Record &Attr,
43374334 for (const Record *Exclusion :
43384335 Records.getAllDerivedDefinitions (" MutualExclusions" )) {
43394336 std::vector<const Record *> MutuallyExclusiveAttrs =
4340- Exclusion->getValueAsListOfConstDefs (" Exclusions" );
4337+ Exclusion->getValueAsListOfDefs (" Exclusions" );
43414338 auto IsCurAttr = [Attr](const Record *R) {
43424339 return R->getName () == Attr.getName ();
43434340 };
@@ -4483,8 +4480,7 @@ static void GenerateLangOptRequirements(const Record &R,
44834480 raw_ostream &OS) {
44844481 // If the attribute has an empty or unset list of language requirements,
44854482 // use the default handler.
4486- std::vector<const Record *> LangOpts =
4487- R.getValueAsListOfConstDefs (" LangOpts" );
4483+ std::vector<const Record *> LangOpts = R.getValueAsListOfDefs (" LangOpts" );
44884484 if (LangOpts.empty ())
44894485 return ;
44904486
@@ -4629,7 +4625,7 @@ static bool isParamExpr(const Record *Arg) {
46294625void GenerateIsParamExpr (const Record &Attr, raw_ostream &OS) {
46304626 OS << " bool isParamExpr(size_t N) const override {\n " ;
46314627 OS << " return " ;
4632- auto Args = Attr.getValueAsListOfConstDefs (" Args" );
4628+ auto Args = Attr.getValueAsListOfDefs (" Args" );
46334629 for (size_t I = 0 ; I < Args.size (); ++I)
46344630 if (isParamExpr (Args[I]))
46354631 OS << " (N == " << I << " ) || " ;
@@ -4792,7 +4788,7 @@ void EmitClangAttrParsedAttrImpl(const RecordKeeper &Records, raw_ostream &OS) {
47924788 GenerateLangOptRequirements (Attr, OS);
47934789 GenerateTargetRequirements (Attr, Dupes, OS);
47944790 GenerateSpellingTargetRequirements (
4795- Attr, Attr.getValueAsListOfConstDefs (" TargetSpecificSpellings" ), OS);
4791+ Attr, Attr.getValueAsListOfDefs (" TargetSpecificSpellings" ), OS);
47964792 GenerateSpellingIndexToSemanticSpelling (Attr, OS);
47974793 PragmaAttributeSupport.generateStrictConformsTo (*I->second , OS);
47984794 GenerateHandleDeclAttribute (Attr, OS);
@@ -4959,7 +4955,7 @@ void EmitClangAttrTextNodeDump(const RecordKeeper &Records, raw_ostream &OS) {
49594955 if (Spellings.size () > 1 && !SpellingNamesAreCommon (Spellings))
49604956 SS << " OS << \" \" << A->getSpelling();\n " ;
49614957
4962- std::vector<const Record *> Args = R.getValueAsListOfConstDefs (" Args" );
4958+ std::vector<const Record *> Args = R.getValueAsListOfDefs (" Args" );
49634959 for (const auto *Arg : Args)
49644960 createArgument (*Arg, R.getName ())->writeDump (SS);
49654961
@@ -4989,7 +4985,7 @@ void EmitClangAttrNodeTraverse(const RecordKeeper &Records, raw_ostream &OS) {
49894985 std::string FunctionContent;
49904986 raw_string_ostream SS (FunctionContent);
49914987
4992- std::vector<const Record *> Args = R.getValueAsListOfConstDefs (" Args" );
4988+ std::vector<const Record *> Args = R.getValueAsListOfDefs (" Args" );
49934989 for (const auto *Arg : Args)
49944990 createArgument (*Arg, R.getName ())->writeDumpChildren (SS);
49954991 if (Attr->getValueAsBit (" AcceptsExprPack" ))
@@ -5033,8 +5029,7 @@ void EmitClangAttrDocTable(const RecordKeeper &Records, raw_ostream &OS) {
50335029 for (const auto *A : Records.getAllDerivedDefinitions (" Attr" )) {
50345030 if (!A->getValueAsBit (" ASTNode" ))
50355031 continue ;
5036- std::vector<const Record *> Docs =
5037- A->getValueAsListOfConstDefs (" Documentation" );
5032+ std::vector<const Record *> Docs = A->getValueAsListOfDefs (" Documentation" );
50385033 assert (!Docs.empty ());
50395034 // Only look at the first documentation if there are several.
50405035 // (Currently there's only one such attr, revisit if this becomes common).
@@ -5254,7 +5249,7 @@ void EmitClangAttrDocs(const RecordKeeper &Records, raw_ostream &OS) {
52545249 for (const auto *A : Records.getAllDerivedDefinitions (" Attr" )) {
52555250 const Record &Attr = *A;
52565251 std::vector<const Record *> Docs =
5257- Attr.getValueAsListOfConstDefs (" Documentation" );
5252+ Attr.getValueAsListOfDefs (" Documentation" );
52585253 for (const auto *D : Docs) {
52595254 const Record &Doc = *D;
52605255 const Record *Category = Doc.getValueAsDef (" Category" );
0 commit comments