Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/TableGen/Operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,13 @@ void OperationBase::parseValueTraits(raw_ostream &errs, RecordTy *record,
}

const ListInit *List = record->getValueAsListInit("value_traits");
for (const Init *I : List->getValues()) {
for (const Init *I : List->
#if LLVM_MAIN_REVISION && LLVM_MAIN_REVISION < 538013
getValues()
#else
getElements()
#endif
) {
if (const DagInit *DI = dyn_cast<DagInit>(I)) {
if (DI->getNumArgs() != 1) {
errs << "value_traits " << *DI << " is missing argument name";
Expand Down Expand Up @@ -840,7 +846,7 @@ void BuilderMethod::emitDefinition(raw_ostream &out, FmtContext &fmt,
)",
&fmt);
} else {
out << tgfmt("return ::llvm::cast<$_op>($_builder.CreateCall($fn, std::nullopt, $_instname));\n",
out << tgfmt("return ::llvm::cast<$_op>($_builder.CreateCall($fn, {}, $_instname));\n",
&fmt);
}

Expand Down
10 changes: 5 additions & 5 deletions test/example/generated/ExampleDialect.cpp.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ source
assert(fn.getFunctionType() == fnType);
assert(::llvm::cast<::llvm::Function>(fn.getCallee())->getFunctionType() == fn.getFunctionType());

return ::llvm::cast<HandleGetOp>(b.CreateCall(fn, std::nullopt, instName));
return ::llvm::cast<HandleGetOp>(b.CreateCall(fn, {}, instName));
}


Expand Down Expand Up @@ -1692,7 +1692,7 @@ instName
assert(fn.getFunctionType() == fnType);
assert(::llvm::cast<::llvm::Function>(fn.getCallee())->getFunctionType() == fn.getFunctionType());

return ::llvm::cast<NoDescriptionOp>(b.CreateCall(fn, std::nullopt, instName));
return ::llvm::cast<NoDescriptionOp>(b.CreateCall(fn, {}, instName));
}


Expand Down Expand Up @@ -1743,7 +1743,7 @@ instName
assert(fn.getFunctionType() == fnType);
assert(::llvm::cast<::llvm::Function>(fn.getCallee())->getFunctionType() == fn.getFunctionType());

return ::llvm::cast<NoSummaryOp>(b.CreateCall(fn, std::nullopt, instName));
return ::llvm::cast<NoSummaryOp>(b.CreateCall(fn, {}, instName));
}


Expand Down Expand Up @@ -1797,7 +1797,7 @@ instName
assert(fn.getFunctionType() == fnType);
assert(::llvm::cast<::llvm::Function>(fn.getCallee())->getFunctionType() == fn.getFunctionType());

return ::llvm::cast<ReadOp>(b.CreateCall(fn, std::nullopt, instName));
return ::llvm::cast<ReadOp>(b.CreateCall(fn, {}, instName));
}


Expand Down Expand Up @@ -1854,7 +1854,7 @@ instName
assert(fn.getFunctionType() == fnType);
assert(::llvm::cast<::llvm::Function>(fn.getCallee())->getFunctionType() == fn.getFunctionType());

return ::llvm::cast<SetReadOp>(b.CreateCall(fn, std::nullopt, instName));
return ::llvm::cast<SetReadOp>(b.CreateCall(fn, {}, instName));
}


Expand Down