@@ -225,9 +225,9 @@ int emit_asr(const std::string &infile,
225
225
std::cout << LCompilers::pickle_tree (*asr,
226
226
compiler_options.use_colors , with_intrinsic_modules) << std::endl;
227
227
} else if (compiler_options.po .json ) {
228
- std::cout << LCompilers::pickle_json (*asr, lm, false , with_intrinsic_modules) << std::endl;
228
+ std::cout << LCompilers::pickle_json (*asr, lm, compiler_options. po . no_loc , with_intrinsic_modules) << std::endl;
229
229
} else if (compiler_options.po .visualize ) {
230
- std::string astr_data_json = LCompilers::pickle_json (*asr, lm, false , with_intrinsic_modules);
230
+ std::string astr_data_json = LCompilers::pickle_json (*asr, lm, compiler_options. po . no_loc , with_intrinsic_modules);
231
231
return visualize_json (astr_data_json, compiler_options.platform );
232
232
} else {
233
233
std::cout << LCompilers::pickle (*asr, compiler_options.use_colors ,
@@ -365,18 +365,11 @@ int emit_c_to_file(const std::string &infile, const std::string &outfile,
365
365
}
366
366
LCompilers::ASR::TranslationUnit_t* asr = r1.result ;
367
367
368
- // Apply ASR passes
369
- LCompilers::PassOptions pass_options;
370
- 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 ;
368
+ compiler_options.po .run_fun = " f" ;
369
+ compiler_options.po .always_run = true ;
378
370
379
- pass_manager.apply_passes (al, asr, pass_options, diagnostics);
371
+ pass_manager.use_default_passes (true );
372
+ pass_manager.apply_passes (al, asr, compiler_options.po , diagnostics);
380
373
381
374
diagnostics.diagnostics .clear ();
382
375
auto res = LCompilers::asr_to_c (al, *asr, diagnostics, compiler_options, 0 );
@@ -1571,6 +1564,7 @@ int main(int argc, char *argv[])
1571
1564
app.add_flag (" --no-indent" , arg_no_indent, " Turn off Indented print ASR/AST" );
1572
1565
app.add_flag (" --tree" , compiler_options.po .tree , " Tree structure print ASR/AST" );
1573
1566
app.add_flag (" --json" , compiler_options.po .json , " Print ASR/AST Json format" );
1567
+ app.add_flag (" --no-loc" , compiler_options.po .no_loc , " Skip location information in ASR/AST Json format" );
1574
1568
app.add_flag (" --visualize" , compiler_options.po .visualize , " Print ASR/AST Visualization" );
1575
1569
app.add_option (" --pass" , arg_pass, " Apply the ASR pass and show ASR (implies --show-asr)" );
1576
1570
app.add_option (" --skip-pass" , skip_pass, " Skip an ASR pass in default pipeline" );
0 commit comments