Skip to content

Commit 2fd564c

Browse files
committed
Reuse compiler_options.po for pass_options
1 parent 90352ad commit 2fd564c

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/bin/lpython.cpp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -365,18 +365,11 @@ int emit_c_to_file(const std::string &infile, const std::string &outfile,
365365
}
366366
LCompilers::ASR::TranslationUnit_t* asr = r1.result;
367367

368-
// Apply ASR passes
369-
LCompilers::PassOptions pass_options;
368+
compiler_options.po.run_fun = "f";
369+
compiler_options.po.always_run = true;
370+
370371
pass_manager.use_default_passes(true);
371-
pass_options.run_fun = "f";
372-
pass_options.always_run = true;
373-
pass_options.verbose = compiler_options.po.verbose;
374-
pass_options.all_symbols_mangling = compiler_options.po.all_symbols_mangling;
375-
pass_options.module_name_mangling = compiler_options.po.module_name_mangling;
376-
pass_options.global_symbols_mangling = compiler_options.po.global_symbols_mangling;
377-
pass_options.intrinsic_symbols_mangling = compiler_options.po.intrinsic_symbols_mangling;
378-
379-
pass_manager.apply_passes(al, asr, pass_options, diagnostics);
372+
pass_manager.apply_passes(al, asr, compiler_options.po, diagnostics);
380373

381374
diagnostics.diagnostics.clear();
382375
auto res = LCompilers::asr_to_c(al, *asr, diagnostics, compiler_options, 0);

0 commit comments

Comments
 (0)