diff --git a/mlir/examples/toy/Ch2/toyc.cpp b/mlir/examples/toy/Ch2/toyc.cpp --- a/mlir/examples/toy/Ch2/toyc.cpp +++ b/mlir/examples/toy/Ch2/toyc.cpp @@ -98,7 +98,7 @@ llvm::SourceMgr sourceMgr; sourceMgr.AddNewSourceBuffer(std::move(*fileOrErr), llvm::SMLoc()); mlir::OwningOpRef module = - mlir::parseSourceFile(sourceMgr, &context); + mlir::parseSourceFile(sourceMgr, &context); if (!module) { llvm::errs() << "Error can't load file " << inputFilename << "\n"; return 3; diff --git a/mlir/examples/toy/Ch3/toyc.cpp b/mlir/examples/toy/Ch3/toyc.cpp --- a/mlir/examples/toy/Ch3/toyc.cpp +++ b/mlir/examples/toy/Ch3/toyc.cpp @@ -93,7 +93,7 @@ // Parse the input mlir. sourceMgr.AddNewSourceBuffer(std::move(*fileOrErr), llvm::SMLoc()); - module = mlir::parseSourceFile(sourceMgr, &context); + module = mlir::parseSourceFile(sourceMgr, &context); if (!module) { llvm::errs() << "Error can't load file " << inputFilename << "\n"; return 3; diff --git a/mlir/examples/toy/Ch4/toyc.cpp b/mlir/examples/toy/Ch4/toyc.cpp --- a/mlir/examples/toy/Ch4/toyc.cpp +++ b/mlir/examples/toy/Ch4/toyc.cpp @@ -94,7 +94,7 @@ // Parse the input mlir. sourceMgr.AddNewSourceBuffer(std::move(*fileOrErr), llvm::SMLoc()); - module = mlir::parseSourceFile(sourceMgr, &context); + module = mlir::parseSourceFile(sourceMgr, &context); if (!module) { llvm::errs() << "Error can't load file " << inputFilename << "\n"; return 3; diff --git a/mlir/examples/toy/Ch5/toyc.cpp b/mlir/examples/toy/Ch5/toyc.cpp --- a/mlir/examples/toy/Ch5/toyc.cpp +++ b/mlir/examples/toy/Ch5/toyc.cpp @@ -98,7 +98,7 @@ // Parse the input mlir. sourceMgr.AddNewSourceBuffer(std::move(*fileOrErr), llvm::SMLoc()); - module = mlir::parseSourceFile(sourceMgr, &context); + module = mlir::parseSourceFile(sourceMgr, &context); if (!module) { llvm::errs() << "Error can't load file " << inputFilename << "\n"; return 3; diff --git a/mlir/examples/toy/Ch6/toyc.cpp b/mlir/examples/toy/Ch6/toyc.cpp --- a/mlir/examples/toy/Ch6/toyc.cpp +++ b/mlir/examples/toy/Ch6/toyc.cpp @@ -119,7 +119,7 @@ // Parse the input mlir. llvm::SourceMgr sourceMgr; sourceMgr.AddNewSourceBuffer(std::move(*fileOrErr), llvm::SMLoc()); - module = mlir::parseSourceFile(sourceMgr, &context); + module = mlir::parseSourceFile(sourceMgr, &context); if (!module) { llvm::errs() << "Error can't load file " << inputFilename << "\n"; return 3; diff --git a/mlir/examples/toy/Ch7/toyc.cpp b/mlir/examples/toy/Ch7/toyc.cpp --- a/mlir/examples/toy/Ch7/toyc.cpp +++ b/mlir/examples/toy/Ch7/toyc.cpp @@ -119,7 +119,7 @@ // Parse the input mlir. llvm::SourceMgr sourceMgr; sourceMgr.AddNewSourceBuffer(std::move(*fileOrErr), llvm::SMLoc()); - module = mlir::parseSourceFile(sourceMgr, &context); + module = mlir::parseSourceFile(sourceMgr, &context); if (!module) { llvm::errs() << "Error can't load file " << inputFilename << "\n"; return 3; diff --git a/mlir/include/mlir/Parser.h b/mlir/include/mlir/Parser.h --- a/mlir/include/mlir/Parser.h +++ b/mlir/include/mlir/Parser.h @@ -206,21 +206,21 @@ /// TODO: These methods are deprecated in favor of the above template versions. /// They should be removed when usages have been updated. -inline OwningOpRef parseSourceFile(const llvm::SourceMgr &sourceMgr, - MLIRContext *context) { +[[deprecated("use parseSourceFile")]] inline OwningOpRef +parseSourceFile(const llvm::SourceMgr &sourceMgr, MLIRContext *context) { return parseSourceFile(sourceMgr, context); } -inline OwningOpRef parseSourceFile(llvm::StringRef filename, - MLIRContext *context) { +[[deprecated("use parseSourceFile")]] inline OwningOpRef +parseSourceFile(llvm::StringRef filename, MLIRContext *context) { return parseSourceFile(filename, context); } -inline OwningOpRef parseSourceFile(llvm::StringRef filename, - llvm::SourceMgr &sourceMgr, - MLIRContext *context) { +[[deprecated("use parseSourceFile")]] inline OwningOpRef +parseSourceFile(llvm::StringRef filename, llvm::SourceMgr &sourceMgr, + MLIRContext *context) { return parseSourceFile(filename, sourceMgr, context); } -inline OwningOpRef parseSourceString(llvm::StringRef moduleStr, - MLIRContext *context) { +[[deprecated("use parseSourceFile")]] inline OwningOpRef +parseSourceString(llvm::StringRef moduleStr, MLIRContext *context) { return parseSourceString(moduleStr, context); } diff --git a/mlir/lib/ExecutionEngine/JitRunner.cpp b/mlir/lib/ExecutionEngine/JitRunner.cpp --- a/mlir/lib/ExecutionEngine/JitRunner.cpp +++ b/mlir/lib/ExecutionEngine/JitRunner.cpp @@ -122,7 +122,7 @@ llvm::SourceMgr sourceMgr; sourceMgr.AddNewSourceBuffer(std::move(file), SMLoc()); - return OwningOpRef(parseSourceFile(sourceMgr, context)); + return parseSourceFile(sourceMgr, context); } static inline Error makeStringError(const Twine &message) { diff --git a/mlir/lib/Support/MlirOptMain.cpp b/mlir/lib/Support/MlirOptMain.cpp --- a/mlir/lib/Support/MlirOptMain.cpp +++ b/mlir/lib/Support/MlirOptMain.cpp @@ -59,7 +59,7 @@ // Parse the input file and reset the context threading state. TimingScope parserTiming = timing.nest("Parser"); - OwningOpRef module(parseSourceFile(sourceMgr, context)); + OwningOpRef module(parseSourceFile(sourceMgr, context)); context->enableMultithreading(wasThreadingEnabled); if (!module) return failure(); diff --git a/mlir/lib/Tools/mlir-reduce/MlirReduceMain.cpp b/mlir/lib/Tools/mlir-reduce/MlirReduceMain.cpp --- a/mlir/lib/Tools/mlir-reduce/MlirReduceMain.cpp +++ b/mlir/lib/Tools/mlir-reduce/MlirReduceMain.cpp @@ -31,7 +31,7 @@ static LogicalResult loadModule(MLIRContext &context, OwningOpRef &module, StringRef inputFilename) { - module = parseSourceFile(inputFilename, &context); + module = parseSourceFile(inputFilename, &context); if (!module) return failure(); diff --git a/mlir/lib/Translation/Translation.cpp b/mlir/lib/Translation/Translation.cpp --- a/mlir/lib/Translation/Translation.cpp +++ b/mlir/lib/Translation/Translation.cpp @@ -101,7 +101,7 @@ DialectRegistry registry; dialectRegistration(registry); context->appendDialectRegistry(registry); - auto module = OwningOpRef(parseSourceFile(sourceMgr, context)); + auto module = parseSourceFile(sourceMgr, context); if (!module || failed(verify(*module))) return failure(); return function(module.get(), output);