[libc-commits] [clang] [libc] [llvm] [mlir] [TableGen] Change `getValueAsListOfDefs` return const pointer vector (PR #110713)
via libc-commits
libc-commits at lists.llvm.org
Tue Oct 1 14:10:25 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-globalisel
@llvm/pr-subscribers-backend-directx
Author: Rahul Joshi (jurahul)
<details>
<summary>Changes</summary>
Change `getValueAsListOfDefs` to return a vector of const Record pointer, and remove `getValueAsListOfConstDefs` that was added as a transition aid.
---
Patch is 63.47 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/110713.diff
30 Files Affected:
- (modified) clang/utils/TableGen/ASTTableGen.h (+1-1)
- (modified) clang/utils/TableGen/ClangAttrEmitter.cpp (+25-30)
- (modified) clang/utils/TableGen/ClangDiagnosticsEmitter.cpp (+1-1)
- (modified) clang/utils/TableGen/ClangOpcodesEmitter.cpp (+8-8)
- (modified) clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp (+9-11)
- (modified) clang/utils/TableGen/SveEmitter.cpp (+2-2)
- (modified) libc/utils/HdrGen/PublicAPICommand.cpp (+2-2)
- (modified) libc/utils/LibcTableGenUtil/APIIndexer.cpp (+7-7)
- (modified) llvm/include/llvm/TableGen/DirectiveEmitter.h (+6-6)
- (modified) llvm/include/llvm/TableGen/Record.h (+1-4)
- (modified) llvm/lib/TableGen/Record.cpp (+1-15)
- (modified) llvm/utils/TableGen/AsmWriterEmitter.cpp (+2-2)
- (modified) llvm/utils/TableGen/Common/CodeGenHwModes.cpp (+2-2)
- (modified) llvm/utils/TableGen/Common/CodeGenInstruction.cpp (+2-2)
- (modified) llvm/utils/TableGen/Common/CodeGenRegisters.cpp (+6-8)
- (modified) llvm/utils/TableGen/Common/CodeGenSchedule.cpp (+21-29)
- (modified) llvm/utils/TableGen/Common/CodeGenTarget.cpp (+4-4)
- (modified) llvm/utils/TableGen/Common/PredicateExpander.cpp (+1-1)
- (modified) llvm/utils/TableGen/CompressInstEmitter.cpp (+2-2)
- (modified) llvm/utils/TableGen/DFAPacketizerEmitter.cpp (+3-3)
- (modified) llvm/utils/TableGen/DXILEmitter.cpp (+3-3)
- (modified) llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp (+2-2)
- (modified) llvm/utils/TableGen/InstrDocsEmitter.cpp (+1-1)
- (modified) llvm/utils/TableGen/MacroFusionPredicatorEmitter.cpp (+1-1)
- (modified) llvm/utils/TableGen/RISCVTargetDefEmitter.cpp (+1-1)
- (modified) llvm/utils/TableGen/SubtargetEmitter.cpp (+16-19)
- (modified) llvm/utils/TableGen/X86RecognizableInstr.cpp (+1-1)
- (modified) mlir/lib/TableGen/Predicate.cpp (+1-1)
- (modified) mlir/tools/mlir-tblgen/BytecodeDialectGen.cpp (+2-2)
- (modified) mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp (+2-2)
``````````diff
diff --git a/clang/utils/TableGen/ASTTableGen.h b/clang/utils/TableGen/ASTTableGen.h
index 827fce9e213cba..02b97636cf5f26 100644
--- a/clang/utils/TableGen/ASTTableGen.h
+++ b/clang/utils/TableGen/ASTTableGen.h
@@ -320,7 +320,7 @@ class PropertyType : public WrappedRecord {
}
std::vector<const llvm::Record *> getBufferElementTypes() const {
- return get()->getValueAsListOfConstDefs(BufferElementTypesFieldName);
+ return get()->getValueAsListOfDefs(BufferElementTypesFieldName);
}
static llvm::StringRef getTableGenNodeClassName() {
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp
index e5d92b343b3dde..893a242099454e 100644
--- a/clang/utils/TableGen/ClangAttrEmitter.cpp
+++ b/clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -1746,8 +1746,7 @@ getSpellingListIndex(const std::vector<FlattenedSpelling> &SpellingList,
}
static void writeAttrAccessorDefinition(const Record &R, raw_ostream &OS) {
- std::vector<const Record *> Accessors =
- R.getValueAsListOfConstDefs("Accessors");
+ std::vector<const Record *> Accessors = R.getValueAsListOfDefs("Accessors");
if (Accessors.empty())
return;
@@ -1964,7 +1963,7 @@ struct AttributeSubjectMatchRule {
std::vector<const Record *> getSubjects() const {
return (Constraint ? Constraint : MetaSubject)
- ->getValueAsListOfConstDefs("Subjects");
+ ->getValueAsListOfDefs("Subjects");
}
std::vector<const Record *> getLangOpts() const {
@@ -1972,11 +1971,11 @@ struct AttributeSubjectMatchRule {
// Lookup the options in the sub-rule first, in case the sub-rule
// overrides the rules options.
std::vector<const Record *> Opts =
- Constraint->getValueAsListOfConstDefs("LangOpts");
+ Constraint->getValueAsListOfDefs("LangOpts");
if (!Opts.empty())
return Opts;
}
- return MetaSubject->getValueAsListOfConstDefs("LangOpts");
+ return MetaSubject->getValueAsListOfDefs("LangOpts");
}
// Abstract rules are used only for sub-rules
@@ -2105,7 +2104,7 @@ PragmaClangAttributeSupport::PragmaClangAttributeSupport(
const Record *Constraint) {
Rules.emplace_back(MetaSubject, Constraint);
for (const Record *Subject :
- SubjectContainer->getValueAsListOfConstDefs("Subjects")) {
+ SubjectContainer->getValueAsListOfDefs("Subjects")) {
bool Inserted =
SubjectsToRules
.try_emplace(Subject, RuleOrAggregateRuleSet::getRule(
@@ -2503,7 +2502,7 @@ static void emitClangAttrTypeArgList(const RecordKeeper &Records,
std::map<std::string, FSIVecTy> FSIMap;
for (const auto *Attr : Records.getAllDerivedDefinitions("Attr")) {
// Determine whether the first argument is a type.
- std::vector<const Record *> Args = Attr->getValueAsListOfConstDefs("Args");
+ std::vector<const Record *> Args = Attr->getValueAsListOfDefs("Args");
if (Args.empty())
continue;
@@ -2581,7 +2580,7 @@ static void emitClangAttrVariadicIdentifierArgList(const RecordKeeper &Records,
std::map<std::string, FSIVecTy> FSIMap;
for (const auto *A : Records.getAllDerivedDefinitions("Attr")) {
// Determine whether the first argument is a variadic identifier.
- std::vector<const Record *> Args = A->getValueAsListOfConstDefs("Args");
+ std::vector<const Record *> Args = A->getValueAsListOfDefs("Args");
if (Args.empty() || !isVariadicIdentifierArgument(Args[0]))
continue;
generateFlattenedSpellingInfo(*A, FSIMap);
@@ -2614,7 +2613,7 @@ emitClangAttrUnevaluatedStringLiteralList(const RecordKeeper &Records,
std::map<std::string, FSIVecTy> FSIMap;
for (const auto *Attr : Records.getAllDerivedDefinitions("Attr")) {
// Determine whether there are any string arguments.
- uint32_t ArgMask = MakeMask(Attr->getValueAsListOfConstDefs("Args"));
+ uint32_t ArgMask = MakeMask(Attr->getValueAsListOfDefs("Args"));
if (!ArgMask)
continue;
generateFlattenedSpellingInfo(*Attr, FSIMap, ArgMask);
@@ -2630,7 +2629,7 @@ static void emitClangAttrIdentifierArgList(const RecordKeeper &Records,
std::map<std::string, FSIVecTy> FSIMap;
for (const auto *Attr : Records.getAllDerivedDefinitions("Attr")) {
// Determine whether the first argument is an identifier.
- std::vector<const Record *> Args = Attr->getValueAsListOfConstDefs("Args");
+ std::vector<const Record *> Args = Attr->getValueAsListOfDefs("Args");
if (Args.empty() || !isIdentifierArgument(Args[0]))
continue;
generateFlattenedSpellingInfo(*Attr, FSIMap);
@@ -2648,7 +2647,7 @@ static void emitClangAttrStrictIdentifierArgList(const RecordKeeper &Records,
if (!Attr->getValueAsBit("StrictEnumParameters"))
continue;
// Check that there is really an identifier argument.
- std::vector<const Record *> Args = Attr->getValueAsListOfConstDefs("Args");
+ std::vector<const Record *> Args = Attr->getValueAsListOfDefs("Args");
if (none_of(Args, [&](const Record *R) { return isIdentifierArgument(R); }))
continue;
generateFlattenedSpellingInfo(*Attr, FSIMap);
@@ -2670,7 +2669,7 @@ static void emitClangAttrThisIsaIdentifierArgList(const RecordKeeper &Records,
std::map<std::string, FSIVecTy> FSIMap;
for (const auto *A : Records.getAllDerivedDefinitions("Attr")) {
// Determine whether the first argument is a variadic identifier.
- std::vector<const Record *> Args = A->getValueAsListOfConstDefs("Args");
+ std::vector<const Record *> Args = A->getValueAsListOfDefs("Args");
if (Args.empty() || !keywordThisIsaIdentifierInArgument(Args[0]))
continue;
generateFlattenedSpellingInfo(*A, FSIMap);
@@ -2763,8 +2762,7 @@ static void emitAttributes(const RecordKeeper &Records, raw_ostream &OS,
else
OS << "\n// " << R.getName() << "Attr implementation\n\n";
- std::vector<const Record *> ArgRecords =
- R.getValueAsListOfConstDefs("Args");
+ std::vector<const Record *> ArgRecords = R.getValueAsListOfDefs("Args");
std::vector<std::unique_ptr<Argument>> Args;
Args.reserve(ArgRecords.size());
@@ -3539,7 +3537,7 @@ void EmitClangAttrPCHRead(const RecordKeeper &Records, raw_ostream &OS) {
std::make_unique<VariadicExprArgument>("DelayedArgs", R.getName());
DelayedArgs->writePCHReadDecls(OS);
}
- ArgRecords = R.getValueAsListOfConstDefs("Args");
+ ArgRecords = R.getValueAsListOfDefs("Args");
Args.clear();
for (const auto *Arg : ArgRecords) {
Args.emplace_back(createArgument(*Arg, R.getName()));
@@ -3578,7 +3576,7 @@ void EmitClangAttrPCHWrite(const RecordKeeper &Records, raw_ostream &OS) {
if (!R.getValueAsBit("ASTNode"))
continue;
OS << " case attr::" << R.getName() << ": {\n";
- std::vector<const Record *> Args = R.getValueAsListOfConstDefs("Args");
+ std::vector<const Record *> Args = R.getValueAsListOfDefs("Args");
if (R.isSubClassOf(InhClass) || !Args.empty())
OS << " const auto *SA = cast<" << R.getName()
<< "Attr>(A);\n";
@@ -3769,7 +3767,7 @@ void EmitClangRegularKeywordAttributeInfo(const RecordKeeper &Records,
for (const auto &S : GetFlattenedSpellings(*R)) {
if (!isRegularKeywordAttribute(S))
continue;
- std::vector<const Record *> Args = R->getValueAsListOfConstDefs("Args");
+ std::vector<const Record *> Args = R->getValueAsListOfDefs("Args");
bool HasArgs = any_of(
Args, [](const Record *Arg) { return !Arg->getValueAsBit("Fake"); });
@@ -3999,8 +3997,7 @@ void EmitClangAttrTemplateInstantiateHelper(ArrayRef<const Record *> Attrs,
continue;
}
- std::vector<const Record *> ArgRecords =
- R.getValueAsListOfConstDefs("Args");
+ std::vector<const Record *> ArgRecords = R.getValueAsListOfDefs("Args");
std::vector<std::unique_ptr<Argument>> Args;
Args.reserve(ArgRecords.size());
@@ -4205,7 +4202,7 @@ static void GenerateAppertainsTo(const Record &Attr, raw_ostream &OS) {
const Record *SubjectObj = Attr.getValueAsDef("Subjects");
std::vector<const Record *> Subjects =
- SubjectObj->getValueAsListOfConstDefs("Subjects");
+ SubjectObj->getValueAsListOfDefs("Subjects");
// If the list of subjects is empty, it is assumed that the attribute
// appertains to everything.
@@ -4337,7 +4334,7 @@ static void GenerateMutualExclusionsChecks(const Record &Attr,
for (const Record *Exclusion :
Records.getAllDerivedDefinitions("MutualExclusions")) {
std::vector<const Record *> MutuallyExclusiveAttrs =
- Exclusion->getValueAsListOfConstDefs("Exclusions");
+ Exclusion->getValueAsListOfDefs("Exclusions");
auto IsCurAttr = [Attr](const Record *R) {
return R->getName() == Attr.getName();
};
@@ -4483,8 +4480,7 @@ static void GenerateLangOptRequirements(const Record &R,
raw_ostream &OS) {
// If the attribute has an empty or unset list of language requirements,
// use the default handler.
- std::vector<const Record *> LangOpts =
- R.getValueAsListOfConstDefs("LangOpts");
+ std::vector<const Record *> LangOpts = R.getValueAsListOfDefs("LangOpts");
if (LangOpts.empty())
return;
@@ -4629,7 +4625,7 @@ static bool isParamExpr(const Record *Arg) {
void GenerateIsParamExpr(const Record &Attr, raw_ostream &OS) {
OS << "bool isParamExpr(size_t N) const override {\n";
OS << " return ";
- auto Args = Attr.getValueAsListOfConstDefs("Args");
+ auto Args = Attr.getValueAsListOfDefs("Args");
for (size_t I = 0; I < Args.size(); ++I)
if (isParamExpr(Args[I]))
OS << "(N == " << I << ") || ";
@@ -4792,7 +4788,7 @@ void EmitClangAttrParsedAttrImpl(const RecordKeeper &Records, raw_ostream &OS) {
GenerateLangOptRequirements(Attr, OS);
GenerateTargetRequirements(Attr, Dupes, OS);
GenerateSpellingTargetRequirements(
- Attr, Attr.getValueAsListOfConstDefs("TargetSpecificSpellings"), OS);
+ Attr, Attr.getValueAsListOfDefs("TargetSpecificSpellings"), OS);
GenerateSpellingIndexToSemanticSpelling(Attr, OS);
PragmaAttributeSupport.generateStrictConformsTo(*I->second, OS);
GenerateHandleDeclAttribute(Attr, OS);
@@ -4959,7 +4955,7 @@ void EmitClangAttrTextNodeDump(const RecordKeeper &Records, raw_ostream &OS) {
if (Spellings.size() > 1 && !SpellingNamesAreCommon(Spellings))
SS << " OS << \" \" << A->getSpelling();\n";
- std::vector<const Record *> Args = R.getValueAsListOfConstDefs("Args");
+ std::vector<const Record *> Args = R.getValueAsListOfDefs("Args");
for (const auto *Arg : Args)
createArgument(*Arg, R.getName())->writeDump(SS);
@@ -4989,7 +4985,7 @@ void EmitClangAttrNodeTraverse(const RecordKeeper &Records, raw_ostream &OS) {
std::string FunctionContent;
raw_string_ostream SS(FunctionContent);
- std::vector<const Record *> Args = R.getValueAsListOfConstDefs("Args");
+ std::vector<const Record *> Args = R.getValueAsListOfDefs("Args");
for (const auto *Arg : Args)
createArgument(*Arg, R.getName())->writeDumpChildren(SS);
if (Attr->getValueAsBit("AcceptsExprPack"))
@@ -5033,8 +5029,7 @@ void EmitClangAttrDocTable(const RecordKeeper &Records, raw_ostream &OS) {
for (const auto *A : Records.getAllDerivedDefinitions("Attr")) {
if (!A->getValueAsBit("ASTNode"))
continue;
- std::vector<const Record *> Docs =
- A->getValueAsListOfConstDefs("Documentation");
+ std::vector<const Record *> Docs = A->getValueAsListOfDefs("Documentation");
assert(!Docs.empty());
// Only look at the first documentation if there are several.
// (Currently there's only one such attr, revisit if this becomes common).
@@ -5254,7 +5249,7 @@ void EmitClangAttrDocs(const RecordKeeper &Records, raw_ostream &OS) {
for (const auto *A : Records.getAllDerivedDefinitions("Attr")) {
const Record &Attr = *A;
std::vector<const Record *> Docs =
- Attr.getValueAsListOfConstDefs("Documentation");
+ Attr.getValueAsListOfDefs("Documentation");
for (const auto *D : Docs) {
const Record &Doc = *D;
const Record *Category = Doc.getValueAsDef("Category");
diff --git a/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp b/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp
index d9bb0630aff5f3..325d63de1563de 100644
--- a/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp
+++ b/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp
@@ -48,7 +48,7 @@ class DiagGroupParentMap {
Records.getAllDerivedDefinitions("DiagGroup");
for (unsigned i = 0, e = DiagGroups.size(); i != e; ++i) {
std::vector<const Record *> SubGroups =
- DiagGroups[i]->getValueAsListOfConstDefs("SubGroups");
+ DiagGroups[i]->getValueAsListOfDefs("SubGroups");
for (unsigned j = 0, e = SubGroups.size(); j != e; ++j)
Mapping[SubGroups[j]].push_back(DiagGroups[i]);
}
diff --git a/clang/utils/TableGen/ClangOpcodesEmitter.cpp b/clang/utils/TableGen/ClangOpcodesEmitter.cpp
index 94c361c7d544f5..a18220fe23c417 100644
--- a/clang/utils/TableGen/ClangOpcodesEmitter.cpp
+++ b/clang/utils/TableGen/ClangOpcodesEmitter.cpp
@@ -69,7 +69,7 @@ void Enumerate(const Record *R, StringRef N,
if (const auto *TypeClass = dyn_cast<DefInit>(Types->getElement(I))) {
for (const auto *Type :
- TypeClass->getDef()->getValueAsListOfConstDefs("Types")) {
+ TypeClass->getDef()->getValueAsListOfDefs("Types")) {
TypePath.push_back(Type);
Rec(I + 1, ID + Type->getName());
TypePath.pop_back();
@@ -117,7 +117,7 @@ void ClangOpcodesEmitter::EmitInterp(raw_ostream &OS, StringRef N,
[this, R, &OS, &N](ArrayRef<const Record *> TS, const Twine &ID) {
bool CanReturn = R->getValueAsBit("CanReturn");
bool ChangesPC = R->getValueAsBit("ChangesPC");
- const auto &Args = R->getValueAsListOfConstDefs("Args");
+ const auto &Args = R->getValueAsListOfDefs("Args");
OS << "case OP_" << ID << ": {\n";
@@ -176,7 +176,7 @@ void ClangOpcodesEmitter::EmitDisasm(raw_ostream &OS, StringRef N,
OS << " PrintName(\"" << ID << "\");\n";
OS << " OS << \"\\t\"";
- for (const auto *Arg : R->getValueAsListOfConstDefs("Args")) {
+ for (const auto *Arg : R->getValueAsListOfDefs("Args")) {
OS << " << ReadArg<" << Arg->getValueAsString("Name") << ">(P, PC)";
OS << " << \" \"";
}
@@ -194,7 +194,7 @@ void ClangOpcodesEmitter::EmitEmitter(raw_ostream &OS, StringRef N,
OS << "#ifdef GET_LINK_IMPL\n";
Enumerate(R, N, [R, &OS](ArrayRef<const Record *>, const Twine &ID) {
- const auto &Args = R->getValueAsListOfConstDefs("Args");
+ const auto &Args = R->getValueAsListOfDefs("Args");
// Emit the list of arguments.
OS << "bool ByteCodeEmitter::emit" << ID << "(";
@@ -227,7 +227,7 @@ void ClangOpcodesEmitter::EmitEmitter(raw_ostream &OS, StringRef N,
void ClangOpcodesEmitter::EmitProto(raw_ostream &OS, StringRef N,
const Record *R) {
OS << "#if defined(GET_EVAL_PROTO) || defined(GET_LINK_PROTO)\n";
- auto Args = R->getValueAsListOfConstDefs("Args");
+ auto Args = R->getValueAsListOfDefs("Args");
Enumerate(R, N, [&OS, &Args](ArrayRef<const Record *> TS, const Twine &ID) {
OS << "bool emit" << ID << "(";
for (size_t I = 0, N = Args.size(); I < N; ++I) {
@@ -268,7 +268,7 @@ void ClangOpcodesEmitter::EmitGroup(raw_ostream &OS, StringRef N,
return;
const auto *Types = R->getValueAsListInit("Types");
- const auto &Args = R->getValueAsListOfConstDefs("Args");
+ const auto &Args = R->getValueAsListOfDefs("Args");
Twine EmitFuncName = "emit" + N;
@@ -333,7 +333,7 @@ void ClangOpcodesEmitter::EmitGroup(raw_ostream &OS, StringRef N,
// Print a switch statement selecting T.
if (auto *TypeClass = dyn_cast<DefInit>(Types->getElement(I))) {
OS << " switch (T" << I << ") {\n";
- auto Cases = TypeClass->getDef()->getValueAsListOfConstDefs("Types");
+ auto Cases = TypeClass->getDef()->getValueAsListOfDefs("Types");
for (auto *Case : Cases) {
OS << " case PT_" << Case->getName() << ":\n";
TS.push_back(Case);
@@ -364,7 +364,7 @@ void ClangOpcodesEmitter::EmitEval(raw_ostream &OS, StringRef N,
OS << "#ifdef GET_EVAL_IMPL\n";
Enumerate(R, N,
[this, R, &N, &OS](ArrayRef<const Record *> TS, const Twine &ID) {
- auto Args = R->getValueAsListOfConstDefs("Args");
+ auto Args = R->getValueAsListOfDefs("Args");
OS << "bool EvalEmitter::emit" << ID << "(";
for (size_t I = 0, N = Args.size(); I < N; ++I) {
diff --git a/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp b/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
index 6607086f0b1179..386a965445ce86 100644
--- a/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
+++ b/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
@@ -480,9 +480,8 @@ static void VerifySignature(ArrayRef<const Record *> Signature,
}
// Check number of data types.
- unsigned NTypes = T->getValueAsDef("TypeList")
- ->getValueAsListOfConstDefs("List")
- .size();
+ unsigned NTypes =
+ T->getValueAsDef("TypeList")->getValueAsListOfDefs("List").size();
if (NTypes != GenTypeTypes && NTypes != 1) {
if (GenTypeTypes > 1) {
// We already saw a gentype with a different number of types.
@@ -512,7 +511,7 @@ void BuiltinNameEmitter::GetOverloads() {
StringRef BName = B->getValueAsString("Name");
FctOverloadMap.try_emplace(BName);
- auto Signature = B->getValueAsListOfConstDefs("Signature");
+ auto Signature = B->getValueAsListOfDefs("Signature");
// Reuse signatures to avoid unnecessary duplicates.
auto it =
find_if(SignaturesList,
@@ -636,8 +635,8 @@ void BuiltinNameEmitter::EmitBuiltinTable() {
Overload.first->getValueAsDef("MaxVersion")->getValueAsInt("ID");
OS << " { " << Overload.second << ", "
- << Overload.first->getValueAsListOfConstDefs("Signature").size()
- << ", " << (Overload.first->getValueAsBit("IsPure")) << ", "
+ << Overload.first->getValueAsListOfDefs("Signature").size() << ", "
+ << (Overload.first->getValueAsBit("IsPure")) << ", "
<< (Overload.first->getValueAsBit("IsConst")) << ", "
<< (Overload.first->getValueAsBit("IsConv")) << ", "
<< FunctionExtensionIndex[ExtName] << ", "
@@ -852,7 +851,7 @@ static void OCL2Qual(Sema &S, const OpenCLTypeStruct &Ty,
// the plain scalar types for now; other type information such as vector
// size and type qualifiers will be added after the switch statement.
std::vector<const Record *> BaseTypes =
- GenType->getValueAsDef("TypeList")->getValueAsListOfConstDefs("List");
+ GenType->getValueAsDef("TypeList")->getValueAsListOfDefs("List");
// Collect all QualTypes for a single vector size into TypeList.
OS << " SmallVector<QualType, " << BaseTypes.size() << "> TypeList;\n";
@@ -1028,8 +1027,7 @@ void OpenCLBuiltinFileEmitterBase::getTypeLists(
std::vector<int64_t> &VectorList) const {
bool isGenType = Type->isSubClassOf("GenericType");
if (isGenType) {
- TypeList =
- Type->getValueAsDef("TypeList")->getValueAsListOfConstDefs("List");
+ TypeList = Type->getValueAsDef("TypeList")->getValueAsListOfDefs("List");
VectorList =
Type->getValueAsDef("VectorList")->getValueAsListOfInts("List");
return;
@@ -1215,7 +1213,7 @@ void OpenCLBuiltinTestEmitter::emit() {
StringRef Name = B->getValueAsString("Name");
SmallVector<SmallVector<std::string, 2>, 4> FTypes;
- expandTypesInSignature(B->getValueAsListOfConstDefs("Signature"), FTypes);
+ expandTypesInSignature(B->getValueAsListOfDefs("Signature"), FTypes);
OS << "// Test " << Name << "\n";
@@ -1284,7 +1282,7 @@ void OpenCLBuiltinHeaderEmitter::emit() {
std::string OptionalVersionEndif = emitVersionGuard(B);
SmallVector<SmallVector<std::string, 2>, 4> FTypes;
- expandTypesInSignature(B->getValueAsListOfConstDefs("Signature"), FTypes);
+ expandTypesInSignature(B->getValueAsListOfDefs("Signature"), F...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/110713
More information about the libc-commits
mailing list