@@ -1381,19 +1381,22 @@ void llvm_dialects::genDialectDefs(raw_ostream& out, RecordKeeper& records) {
1381
1381
}
1382
1382
}
1383
1383
1384
- out << tgfmt (" ::llvm::Value* const $0[] = {\n " , &fmt, args);
1385
- for (const auto & [name, type, arg]
1386
- : llvm::zip_first (argNames, argTypes, fullArguments)) {
1387
- if (auto * attr = dyn_cast<Attr>(arg.type )) {
1388
- out << tgfmt (attr->getToLlvmValue (), &fmt, name, type);
1389
- } else {
1390
- out << name;
1384
+ if (!argNames.empty ()) {
1385
+ out << tgfmt (" ::llvm::Value* const $0[] = {\n " , &fmt, args);
1386
+ for (const auto & [name, type, arg]
1387
+ : llvm::zip_first (argNames, argTypes, fullArguments)) {
1388
+ if (auto * attr = dyn_cast<Attr>(arg.type )) {
1389
+ out << tgfmt (attr->getToLlvmValue (), &fmt, name, type);
1390
+ } else {
1391
+ out << name;
1392
+ }
1393
+ out << " ,\n " ;
1391
1394
}
1392
- out << " ,\n " ;
1393
- }
1394
- out << " };\n\n " ;
1395
+ out << " };\n\n " ;
1395
1396
1396
- out << tgfmt (" return $_builder.CreateCall($0, $1);\n " , &fmt, fn, args);
1397
+ out << tgfmt (" return $_builder.CreateCall($0, $1);\n " , &fmt, fn, args);
1398
+ } else
1399
+ out << tgfmt (" return $_builder.CreateCall($0);\n " , &fmt, fn);
1397
1400
out << " }\n\n " ;
1398
1401
1399
1402
// Emit argument getters.
0 commit comments