Per @rriddle, we do not want to require `skipDefaultBuilders=0` per se; that is, even though the `assemblyFormat`-generated parser requires a builder with the same prototype as the default-builder, that prototype could instead be implemented via custom `builders`. This differential reduces the FatalError introduced in
D128555 to a non-fatal Warning instead, so that users can still be informed of the error condition (rather than waiting for the C++ compiler to fail).
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/
D129234
"'assemblyFormat' or 'hasCustomAssemblyFormat' can only be "
"used when 'mnemonic' is set");
}
- // Assembly format parser requires default builders to be generated.
+ // Assembly format parser requires builders with the same prototype
+ // as the default-builders.
+ // TODO: attempt to detect when a custom builder matches the prototype.
if (hasDeclarativeFormat && skipDefaultBuilders()) {
- PrintFatalError(
- getLoc(),
- "'assemblyFormat' requires 'skipDefaultBuilders' to be false");
+ PrintWarning(getLoc(),
+ "using 'assemblyFormat' with 'skipDefaultBuilders=1' may "
+ "result in C++ compilation errors");
}
// Assembly format printer requires accessors to be generated.
if (hasDeclarativeFormat && !genAccessors()) {