bool shouldSplitInputFile() const { return splitInputFileFlag; }
/// Disable implicit addition of a top-level module op during parsing.
- MlirOptMainConfig &useImplicitModule(bool useImplicitModule) {
- useImplicitModuleFlag = useImplicitModule;
+ MlirOptMainConfig &useExplicitModule(bool useExplicitModule) {
+ useExplicitModuleFlag = useExplicitModule;
return *this;
}
- bool shouldUseImplicitModule() const { return useImplicitModuleFlag; }
+ bool shouldUseExplicitModule() const { return useExplicitModuleFlag; }
/// Set whether to check that emitted diagnostics match `expected-*` lines on
/// the corresponding line. This is meant for implementing diagnostic tests.
/// process each chunk independently.
bool splitInputFileFlag = false;
- /// Use an implicit top-level module op during parsing.
- bool useImplicitModuleFlag = true;
+ /// Use an explicit top-level module op during parsing.
+ bool useExplicitModuleFlag = false;
/// Set whether to check that emitted diagnostics match `expected-*` lines on
/// the corresponding line. This is meant for implementing diagnostic tests.
/// Perform the core processing behind `mlir-opt`.
/// This API is deprecated, use the MlirOptMainConfig version above instead.
-LogicalResult
-MlirOptMain(llvm::raw_ostream &outputStream,
- std::unique_ptr<llvm::MemoryBuffer> buffer,
- const PassPipelineCLParser &passPipeline, DialectRegistry ®istry,
- bool splitInputFile, bool verifyDiagnostics, bool verifyPasses,
- bool allowUnregisteredDialects,
- bool preloadDialectsInContext = false, bool emitBytecode = false,
- bool implicitModule = false, bool dumpPassPipeline = false);
+LogicalResult MlirOptMain(llvm::raw_ostream &outputStream,
+ std::unique_ptr<llvm::MemoryBuffer> buffer,
+ const PassPipelineCLParser &passPipeline,
+ DialectRegistry ®istry, bool splitInputFile,
+ bool verifyDiagnostics, bool verifyPasses,
+ bool allowUnregisteredDialects,
+ bool preloadDialectsInContext = false,
+ bool emitBytecode = false, bool explicitModule = true,
+ bool dumpPassPipeline = false);
/// Perform the core processing behind `mlir-opt`.
/// This API is deprecated, use the MlirOptMainConfig version above instead.
PassPipelineFn passManagerSetupFn, DialectRegistry ®istry,
bool splitInputFile, bool verifyDiagnostics, bool verifyPasses,
bool allowUnregisteredDialects, bool preloadDialectsInContext = false,
- bool emitBytecode = false, bool implicitModule = false);
+ bool emitBytecode = false, bool explicitModule = true);
/// Implementation for tools like `mlir-opt`.
/// - toolName is used for the header displayed by `--help`.
// Parse the input file and reset the context threading state.
TimingScope parserTiming = timing.nest("Parser");
OwningOpRef<Operation *> op = parseSourceFileForTool(
- sourceMgr, parseConfig, config.shouldUseImplicitModule());
+ sourceMgr, parseConfig, !config.shouldUseExplicitModule());
context->enableMultithreading(wasThreadingEnabled);
if (!op)
return failure();
bool verifyDiagnostics, bool verifyPasses,
bool allowUnregisteredDialects,
bool preloadDialectsInContext,
- bool emitBytecode, bool implicitModule) {
+ bool emitBytecode, bool explicitModule) {
return MlirOptMain(outputStream, std::move(buffer), registry,
MlirOptMainConfig{}
.splitInputFile(splitInputFile)
.allowUnregisteredDialects(allowUnregisteredDialects)
.preloadDialectsInContext(preloadDialectsInContext)
.emitBytecode(emitBytecode)
- .useImplicitModule(implicitModule)
+ .useExplicitModule(explicitModule)
.setPassPipelineSetupFn(passManagerSetupFn));
}
const PassPipelineCLParser &passPipeline, DialectRegistry ®istry,
bool splitInputFile, bool verifyDiagnostics, bool verifyPasses,
bool allowUnregisteredDialects, bool preloadDialectsInContext,
- bool emitBytecode, bool implicitModule, bool dumpPassPipeline) {
+ bool emitBytecode, bool explicitModule, bool dumpPassPipeline) {
return MlirOptMain(outputStream, std::move(buffer), registry,
MlirOptMainConfig{}
.splitInputFile(splitInputFile)
.allowUnregisteredDialects(allowUnregisteredDialects)
.preloadDialectsInContext(preloadDialectsInContext)
.emitBytecode(emitBytecode)
- .useImplicitModule(implicitModule)
+ .useExplicitModule(explicitModule)
.dumpPassPipeline(dumpPassPipeline)
.setPassPipelineParser(passPipeline));
}
"emit-bytecode", cl::desc("Emit bytecode when generating output"),
cl::init(false));
- static cl::opt<bool> noImplicitModule{
+ static cl::opt<bool> explicitModule{
"no-implicit-module",
cl::desc(
"Disable implicit addition of a top-level module op during parsing"),
.allowUnregisteredDialects(allowUnregisteredDialects)
.preloadDialectsInContext(preloadDialectsInContext)
.emitBytecode(emitBytecode)
- .useImplicitModule(!noImplicitModule)
+ .useExplicitModule(explicitModule)
.dumpPassPipeline(dumpPassPipeline);
if (failed(MlirOptMain(output->os(), std::move(file), registry, config)))