@@ -128,8 +128,8 @@ static void emitPassDecls(const Pass &pass, raw_ostream &os) {
128128
129129 // Declaration of the constructor with options.
130130 if (ArrayRef<PassOption> options = pass.getOptions (); !options.empty ())
131- os << llvm::formatv (" std::unique_ptr<::mlir::Pass> create{0}(const "
132- " {0}Options & options);\n " ,
131+ os << llvm::formatv (" std::unique_ptr<::mlir::Pass> create{0}("
132+ " {0}Options options);\n " ,
133133 passName);
134134 }
135135
@@ -236,7 +236,7 @@ namespace impl {{
236236
237237const char *const friendDefaultConstructorWithOptionsDeclTemplate = R"(
238238namespace impl {{
239- std::unique_ptr<::mlir::Pass> create{0}(const {0}Options & options);
239+ std::unique_ptr<::mlir::Pass> create{0}({0}Options options);
240240} // namespace impl
241241)" ;
242242
@@ -247,8 +247,8 @@ const char *const friendDefaultConstructorDefTemplate = R"(
247247)" ;
248248
249249const char *const friendDefaultConstructorWithOptionsDefTemplate = R"(
250- friend std::unique_ptr<::mlir::Pass> create{0}(const {0}Options & options) {{
251- return std::make_unique<DerivedT>(options);
250+ friend std::unique_ptr<::mlir::Pass> create{0}({0}Options options) {{
251+ return std::make_unique<DerivedT>(std::move( options) );
252252 }
253253)" ;
254254
@@ -259,8 +259,8 @@ std::unique_ptr<::mlir::Pass> create{0}() {{
259259)" ;
260260
261261const char *const defaultConstructorWithOptionsDefTemplate = R"(
262- std::unique_ptr<::mlir::Pass> create{0}(const {0}Options & options) {{
263- return impl::create{0}(options);
262+ std::unique_ptr<::mlir::Pass> create{0}({0}Options options) {{
263+ return impl::create{0}(std::move( options) );
264264}
265265)" ;
266266
@@ -326,10 +326,10 @@ static void emitPassDefs(const Pass &pass, raw_ostream &os) {
326326
327327 if (ArrayRef<PassOption> options = pass.getOptions (); !options.empty ()) {
328328 os.indent (2 ) << llvm::formatv (
329- " {0}Base(const {0}Options & options) : {0}Base() {{\n " , passName);
329+ " {0}Base({0}Options options) : {0}Base() {{\n " , passName);
330330
331331 for (const PassOption &opt : pass.getOptions ())
332- os.indent (4 ) << llvm::formatv (" {0} = options.{0};\n " ,
332+ os.indent (4 ) << llvm::formatv (" {0} = std::move( options.{0}) ;\n " ,
333333 opt.getCppVariableName ());
334334
335335 os.indent (2 ) << " }\n " ;
0 commit comments