Skip to content

Commit a140931

Browse files
authored
[TableGen] Change getValueAsListOfDefs to return const pointer vector (llvm#110713)
Change `getValueAsListOfDefs` to return a vector of const Record pointer, and remove `getValueAsListOfConstDefs` that was added as a transition aid. This is a part of effort to have better const correctness in TableGen backends: https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
1 parent 760ffa4 commit a140931

30 files changed

+136
-173
lines changed

clang/utils/TableGen/ASTTableGen.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ class PropertyType : public WrappedRecord {
320320
}
321321

322322
std::vector<const llvm::Record *> getBufferElementTypes() const {
323-
return get()->getValueAsListOfConstDefs(BufferElementTypesFieldName);
323+
return get()->getValueAsListOfDefs(BufferElementTypesFieldName);
324324
}
325325

326326
static llvm::StringRef getTableGenNodeClassName() {

clang/utils/TableGen/ClangAttrEmitter.cpp

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,8 +1746,7 @@ getSpellingListIndex(const std::vector<FlattenedSpelling> &SpellingList,
17461746
}
17471747

17481748
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");
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) {
46294625
void 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");

clang/utils/TableGen/ClangDiagnosticsEmitter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class DiagGroupParentMap {
4848
Records.getAllDerivedDefinitions("DiagGroup");
4949
for (unsigned i = 0, e = DiagGroups.size(); i != e; ++i) {
5050
std::vector<const Record *> SubGroups =
51-
DiagGroups[i]->getValueAsListOfConstDefs("SubGroups");
51+
DiagGroups[i]->getValueAsListOfDefs("SubGroups");
5252
for (unsigned j = 0, e = SubGroups.size(); j != e; ++j)
5353
Mapping[SubGroups[j]].push_back(DiagGroups[i]);
5454
}

clang/utils/TableGen/ClangOpcodesEmitter.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void Enumerate(const Record *R, StringRef N,
6969

7070
if (const auto *TypeClass = dyn_cast<DefInit>(Types->getElement(I))) {
7171
for (const auto *Type :
72-
TypeClass->getDef()->getValueAsListOfConstDefs("Types")) {
72+
TypeClass->getDef()->getValueAsListOfDefs("Types")) {
7373
TypePath.push_back(Type);
7474
Rec(I + 1, ID + Type->getName());
7575
TypePath.pop_back();
@@ -117,7 +117,7 @@ void ClangOpcodesEmitter::EmitInterp(raw_ostream &OS, StringRef N,
117117
[this, R, &OS, &N](ArrayRef<const Record *> TS, const Twine &ID) {
118118
bool CanReturn = R->getValueAsBit("CanReturn");
119119
bool ChangesPC = R->getValueAsBit("ChangesPC");
120-
const auto &Args = R->getValueAsListOfConstDefs("Args");
120+
const auto &Args = R->getValueAsListOfDefs("Args");
121121

122122
OS << "case OP_" << ID << ": {\n";
123123

@@ -176,7 +176,7 @@ void ClangOpcodesEmitter::EmitDisasm(raw_ostream &OS, StringRef N,
176176
OS << " PrintName(\"" << ID << "\");\n";
177177
OS << " OS << \"\\t\"";
178178

179-
for (const auto *Arg : R->getValueAsListOfConstDefs("Args")) {
179+
for (const auto *Arg : R->getValueAsListOfDefs("Args")) {
180180
OS << " << ReadArg<" << Arg->getValueAsString("Name") << ">(P, PC)";
181181
OS << " << \" \"";
182182
}
@@ -194,7 +194,7 @@ void ClangOpcodesEmitter::EmitEmitter(raw_ostream &OS, StringRef N,
194194

195195
OS << "#ifdef GET_LINK_IMPL\n";
196196
Enumerate(R, N, [R, &OS](ArrayRef<const Record *>, const Twine &ID) {
197-
const auto &Args = R->getValueAsListOfConstDefs("Args");
197+
const auto &Args = R->getValueAsListOfDefs("Args");
198198

199199
// Emit the list of arguments.
200200
OS << "bool ByteCodeEmitter::emit" << ID << "(";
@@ -227,7 +227,7 @@ void ClangOpcodesEmitter::EmitEmitter(raw_ostream &OS, StringRef N,
227227
void ClangOpcodesEmitter::EmitProto(raw_ostream &OS, StringRef N,
228228
const Record *R) {
229229
OS << "#if defined(GET_EVAL_PROTO) || defined(GET_LINK_PROTO)\n";
230-
auto Args = R->getValueAsListOfConstDefs("Args");
230+
auto Args = R->getValueAsListOfDefs("Args");
231231
Enumerate(R, N, [&OS, &Args](ArrayRef<const Record *> TS, const Twine &ID) {
232232
OS << "bool emit" << ID << "(";
233233
for (size_t I = 0, N = Args.size(); I < N; ++I) {
@@ -268,7 +268,7 @@ void ClangOpcodesEmitter::EmitGroup(raw_ostream &OS, StringRef N,
268268
return;
269269

270270
const auto *Types = R->getValueAsListInit("Types");
271-
const auto &Args = R->getValueAsListOfConstDefs("Args");
271+
const auto &Args = R->getValueAsListOfDefs("Args");
272272

273273
Twine EmitFuncName = "emit" + N;
274274

@@ -333,7 +333,7 @@ void ClangOpcodesEmitter::EmitGroup(raw_ostream &OS, StringRef N,
333333
// Print a switch statement selecting T.
334334
if (auto *TypeClass = dyn_cast<DefInit>(Types->getElement(I))) {
335335
OS << " switch (T" << I << ") {\n";
336-
auto Cases = TypeClass->getDef()->getValueAsListOfConstDefs("Types");
336+
auto Cases = TypeClass->getDef()->getValueAsListOfDefs("Types");
337337
for (auto *Case : Cases) {
338338
OS << " case PT_" << Case->getName() << ":\n";
339339
TS.push_back(Case);
@@ -364,7 +364,7 @@ void ClangOpcodesEmitter::EmitEval(raw_ostream &OS, StringRef N,
364364
OS << "#ifdef GET_EVAL_IMPL\n";
365365
Enumerate(R, N,
366366
[this, R, &N, &OS](ArrayRef<const Record *> TS, const Twine &ID) {
367-
auto Args = R->getValueAsListOfConstDefs("Args");
367+
auto Args = R->getValueAsListOfDefs("Args");
368368

369369
OS << "bool EvalEmitter::emit" << ID << "(";
370370
for (size_t I = 0, N = Args.size(); I < N; ++I) {

clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -480,9 +480,8 @@ static void VerifySignature(ArrayRef<const Record *> Signature,
480480
}
481481

482482
// Check number of data types.
483-
unsigned NTypes = T->getValueAsDef("TypeList")
484-
->getValueAsListOfConstDefs("List")
485-
.size();
483+
unsigned NTypes =
484+
T->getValueAsDef("TypeList")->getValueAsListOfDefs("List").size();
486485
if (NTypes != GenTypeTypes && NTypes != 1) {
487486
if (GenTypeTypes > 1) {
488487
// We already saw a gentype with a different number of types.
@@ -512,7 +511,7 @@ void BuiltinNameEmitter::GetOverloads() {
512511
StringRef BName = B->getValueAsString("Name");
513512
FctOverloadMap.try_emplace(BName);
514513

515-
auto Signature = B->getValueAsListOfConstDefs("Signature");
514+
auto Signature = B->getValueAsListOfDefs("Signature");
516515
// Reuse signatures to avoid unnecessary duplicates.
517516
auto it =
518517
find_if(SignaturesList,
@@ -636,8 +635,8 @@ void BuiltinNameEmitter::EmitBuiltinTable() {
636635
Overload.first->getValueAsDef("MaxVersion")->getValueAsInt("ID");
637636

638637
OS << " { " << Overload.second << ", "
639-
<< Overload.first->getValueAsListOfConstDefs("Signature").size()
640-
<< ", " << (Overload.first->getValueAsBit("IsPure")) << ", "
638+
<< Overload.first->getValueAsListOfDefs("Signature").size() << ", "
639+
<< (Overload.first->getValueAsBit("IsPure")) << ", "
641640
<< (Overload.first->getValueAsBit("IsConst")) << ", "
642641
<< (Overload.first->getValueAsBit("IsConv")) << ", "
643642
<< FunctionExtensionIndex[ExtName] << ", "
@@ -852,7 +851,7 @@ static void OCL2Qual(Sema &S, const OpenCLTypeStruct &Ty,
852851
// the plain scalar types for now; other type information such as vector
853852
// size and type qualifiers will be added after the switch statement.
854853
std::vector<const Record *> BaseTypes =
855-
GenType->getValueAsDef("TypeList")->getValueAsListOfConstDefs("List");
854+
GenType->getValueAsDef("TypeList")->getValueAsListOfDefs("List");
856855

857856
// Collect all QualTypes for a single vector size into TypeList.
858857
OS << " SmallVector<QualType, " << BaseTypes.size() << "> TypeList;\n";
@@ -1028,8 +1027,7 @@ void OpenCLBuiltinFileEmitterBase::getTypeLists(
10281027
std::vector<int64_t> &VectorList) const {
10291028
bool isGenType = Type->isSubClassOf("GenericType");
10301029
if (isGenType) {
1031-
TypeList =
1032-
Type->getValueAsDef("TypeList")->getValueAsListOfConstDefs("List");
1030+
TypeList = Type->getValueAsDef("TypeList")->getValueAsListOfDefs("List");
10331031
VectorList =
10341032
Type->getValueAsDef("VectorList")->getValueAsListOfInts("List");
10351033
return;
@@ -1215,7 +1213,7 @@ void OpenCLBuiltinTestEmitter::emit() {
12151213
StringRef Name = B->getValueAsString("Name");
12161214

12171215
SmallVector<SmallVector<std::string, 2>, 4> FTypes;
1218-
expandTypesInSignature(B->getValueAsListOfConstDefs("Signature"), FTypes);
1216+
expandTypesInSignature(B->getValueAsListOfDefs("Signature"), FTypes);
12191217

12201218
OS << "// Test " << Name << "\n";
12211219

@@ -1284,7 +1282,7 @@ void OpenCLBuiltinHeaderEmitter::emit() {
12841282
std::string OptionalVersionEndif = emitVersionGuard(B);
12851283

12861284
SmallVector<SmallVector<std::string, 2>, 4> FTypes;
1287-
expandTypesInSignature(B->getValueAsListOfConstDefs("Signature"), FTypes);
1285+
expandTypesInSignature(B->getValueAsListOfDefs("Signature"), FTypes);
12881286

12891287
for (const auto &Signature : FTypes) {
12901288
StringRef OptionalTypeExtEndif = emitTypeExtensionGuards(Signature);

0 commit comments

Comments
 (0)