@@ -220,12 +220,12 @@ int emit_asr(const std::string &infile,
220
220
221
221
pass_manager.apply_passes (al, asr, compiler_options.po , diagnostics);
222
222
223
- if (compiler_options.tree ) {
223
+ if (compiler_options.po . tree ) {
224
224
std::cout << LCompilers::LPython::pickle_tree (*asr,
225
225
compiler_options.use_colors , with_intrinsic_modules) << std::endl;
226
- } else if (compiler_options.json ) {
226
+ } else if (compiler_options.po . json ) {
227
227
std::cout << LCompilers::LPython::pickle_json (*asr, lm, with_intrinsic_modules) << std::endl;
228
- } else if (compiler_options.visualize ) {
228
+ } else if (compiler_options.po . visualize ) {
229
229
std::string astr_data_json = LCompilers::LPython::pickle_json (*asr, lm, with_intrinsic_modules);
230
230
return visualize_json (astr_data_json, compiler_options.platform );
231
231
} else {
@@ -790,7 +790,7 @@ int compile_python_to_object_file(
790
790
auto ast_to_asr_start = std::chrono::high_resolution_clock::now ();
791
791
LCompilers::Result<LCompilers::ASR::TranslationUnit_t*>
792
792
r1 = LCompilers::LPython::python_ast_to_asr (al, lm, nullptr , *ast, diagnostics, compiler_options,
793
- !(arg_c && compiler_options.disable_main ), " __main__" , infile);
793
+ !(arg_c && compiler_options.po . disable_main ), " __main__" , infile);
794
794
795
795
auto ast_to_asr_end = std::chrono::high_resolution_clock::now ();
796
796
times.push_back (std::make_pair (" AST to ASR" , std::chrono::duration<double , std::milli>(ast_to_asr_end - ast_to_asr_start).count ()));
@@ -801,7 +801,7 @@ int compile_python_to_object_file(
801
801
return 2 ;
802
802
}
803
803
LCompilers::ASR::TranslationUnit_t* asr = r1.result ;
804
- if ( compiler_options.disable_main ) {
804
+ if ( compiler_options.po . disable_main ) {
805
805
int err = LCompilers::LPython::save_pyc_files (*asr, infile);
806
806
if ( err ) {
807
807
return err;
@@ -909,7 +909,7 @@ int compile_to_binary_wasm(
909
909
return 2 ;
910
910
}
911
911
LCompilers::ASR::TranslationUnit_t* asr = r1.result ;
912
- if ( compiler_options.disable_main ) {
912
+ if ( compiler_options.po . disable_main ) {
913
913
int err = LCompilers::LPython::save_pyc_files (*asr, infile);
914
914
if ( err ) {
915
915
return err;
@@ -982,7 +982,7 @@ int compile_to_binary_x86(
982
982
return 2 ;
983
983
}
984
984
LCompilers::ASR::TranslationUnit_t* asr = r1.result ;
985
- if ( compiler_options.disable_main ) {
985
+ if ( compiler_options.po . disable_main ) {
986
986
int err = LCompilers::LPython::save_pyc_files (*asr, infile);
987
987
if ( err ) {
988
988
return err;
@@ -1056,7 +1056,7 @@ int compile_to_binary_wasm_to_x86(
1056
1056
return 2 ;
1057
1057
}
1058
1058
LCompilers::ASR::TranslationUnit_t* asr = r1.result ;
1059
- if ( compiler_options.disable_main ) {
1059
+ if ( compiler_options.po . disable_main ) {
1060
1060
int err = LCompilers::LPython::save_pyc_files (*asr, infile);
1061
1061
if ( err ) {
1062
1062
return err;
@@ -1568,12 +1568,12 @@ int main(int argc, char *argv[])
1568
1568
app.add_flag (" --with-intrinsic-mods" , with_intrinsic_modules, " Show intrinsic modules in ASR" );
1569
1569
app.add_flag (" --no-color" , arg_no_color, " Turn off colored AST/ASR" );
1570
1570
app.add_flag (" --no-indent" , arg_no_indent, " Turn off Indented print ASR/AST" );
1571
- app.add_flag (" --tree" , compiler_options.tree , " Tree structure print ASR/AST" );
1572
- app.add_flag (" --json" , compiler_options.json , " Print ASR/AST Json format" );
1573
- app.add_flag (" --visualize" , compiler_options.visualize , " Print ASR/AST Visualization" );
1571
+ app.add_flag (" --tree" , compiler_options.po . tree , " Tree structure print ASR/AST" );
1572
+ app.add_flag (" --json" , compiler_options.po . json , " Print ASR/AST Json format" );
1573
+ app.add_flag (" --visualize" , compiler_options.po . visualize , " Print ASR/AST Visualization" );
1574
1574
app.add_option (" --pass" , arg_pass, " Apply the ASR pass and show ASR (implies --show-asr)" );
1575
1575
app.add_option (" --skip-pass" , skip_pass, " Skip an ASR pass in default pipeline" );
1576
- app.add_flag (" --disable-main" , compiler_options.disable_main , " Do not generate any code for the `main` function" );
1576
+ app.add_flag (" --disable-main" , compiler_options.po . disable_main , " Do not generate any code for the `main` function" );
1577
1577
app.add_flag (" --symtab-only" , compiler_options.symtab_only , " Only create symbol tables in ASR (skip executable stmt)" );
1578
1578
app.add_flag (" --time-report" , time_report, " Show compilation time report" );
1579
1579
app.add_flag (" --static" , static_link, " Create a static executable" );
@@ -1582,7 +1582,7 @@ int main(int argc, char *argv[])
1582
1582
app.add_option (" --backend" , arg_backend, " Select a backend (llvm, cpp, x86, wasm, wasm_x86, wasm_x64)" )->capture_default_str ();
1583
1583
app.add_flag (" --enable-bounds-checking" , compiler_options.enable_bounds_checking , " Turn on index bounds checking" );
1584
1584
app.add_flag (" --openmp" , compiler_options.openmp , " Enable openmp" );
1585
- app.add_flag (" --fast" , compiler_options.fast , " Best performance (disable strict standard compliance)" );
1585
+ app.add_flag (" --fast" , compiler_options.po . fast , " Best performance (disable strict standard compliance)" );
1586
1586
app.add_option (" --target" , compiler_options.target , " Generate code for the given target" )->capture_default_str ();
1587
1587
app.add_flag (" --print-targets" , print_targets, " Print the registered targets" );
1588
1588
app.add_flag (" --get-rtl-header-dir" , print_rtl_header_dir, " Print the path to the runtime library header file" );
@@ -1639,9 +1639,9 @@ int main(int argc, char *argv[])
1639
1639
lcompilers_unique_ID = separate_compilation ? LCompilers::get_unique_ID (): " " ;
1640
1640
1641
1641
1642
- if ( compiler_options.fast && compiler_options.enable_bounds_checking ) {
1642
+ if ( compiler_options.po . fast && compiler_options.enable_bounds_checking ) {
1643
1643
// ReleaseSafe Mode
1644
- } else if ( compiler_options.fast ) {
1644
+ } else if ( compiler_options.po . fast ) {
1645
1645
// Release Mode
1646
1646
lpython_pass_manager.use_optimization_passes ();
1647
1647
} else {
@@ -1768,7 +1768,7 @@ int main(int argc, char *argv[])
1768
1768
}
1769
1769
1770
1770
if (compiler_options.po .dump_fortran || compiler_options.po .dump_all_passes ) {
1771
- dump_all_passes (arg_file, compiler_options);
1771
+ dump_all_passes (arg_file, runtime_library_dir, compiler_options);
1772
1772
}
1773
1773
1774
1774
// if (arg_E) {
0 commit comments