4949 #include < rapidjson/writer.h>
5050#endif
5151
52- extern std::string lcompilers_unique_ID ;
52+ extern std::string lcompilers_unique_ID_separate_compilation ;
5353
5454namespace {
5555
@@ -659,7 +659,7 @@ int get_errors (const std::string &infile,
659659 std::vector<LCompilers::error_highlight> diag_lists;
660660 LCompilers::error_highlight h;
661661 for (auto &d : diagnostics.diagnostics ) {
662- if (compiler_options.no_warnings && d.level != LCompilers::diag::Level::Error) {
662+ if (! compiler_options.show_warnings && d.level != LCompilers::diag::Level::Error) {
663663 continue ;
664664 }
665665 h.message = d.message ;
@@ -1843,6 +1843,7 @@ int main(int argc, char *argv[])
18431843 bool print_rtl_dir = false ;
18441844 bool separate_compilation = false ;
18451845 bool to_jit = false ;
1846+ bool disable_warnings = false ;
18461847
18471848 std::string arg_fmt_file;
18481849 // int arg_fmt_indent = 4;
@@ -1909,10 +1910,10 @@ int main(int argc, char *argv[])
19091910 app.add_flag (" --symtab-only" , compiler_options.symtab_only , " Only create symbol tables in ASR (skip executable stmt)" );
19101911 app.add_flag (" --time-report" , time_report, " Show compilation time report" );
19111912 app.add_flag (" --static" , static_link, " Create a static executable" );
1912- app.add_flag (" --no-warnings" , compiler_options. no_warnings , " Turn off all warnings" );
1913+ app.add_flag (" --no-warnings" , disable_warnings , " Turn off all warnings" );
19131914 app.add_flag (" --no-error-banner" , compiler_options.no_error_banner , " Turn off error banner" );
19141915 app.add_option (" --backend" , arg_backend, " Select a backend (llvm, cpp, x86, wasm, wasm_x86, wasm_x64)" )->capture_default_str ();
1915- app.add_flag (" --enable-bounds-checking" , compiler_options.enable_bounds_checking , " Turn on index bounds checking" );
1916+ app.add_flag (" --enable-bounds-checking" , compiler_options.bounds_checking , " Turn on index bounds checking" );
19161917 app.add_flag (" --openmp" , compiler_options.openmp , " Enable openmp" );
19171918 app.add_flag (" --fast" , compiler_options.po .fast , " Best performance (disable strict standard compliance)" );
19181919 app.add_option (" --target" , compiler_options.target , " Generate code for the given target" )->capture_default_str ();
@@ -1968,10 +1969,10 @@ int main(int argc, char *argv[])
19681969 app.require_subcommand (0 , 1 );
19691970 CLI11_PARSE (app, argc, argv);
19701971
1971- lcompilers_unique_ID = separate_compilation ? LCompilers::get_unique_ID (): " " ;
1972+ lcompilers_unique_ID_separate_compilation = separate_compilation ? LCompilers::get_unique_ID (): " " ;
19721973
19731974
1974- if ( compiler_options.po .fast && compiler_options.enable_bounds_checking ) {
1975+ if ( compiler_options.po .fast && compiler_options.bounds_checking ) {
19751976 // ReleaseSafe Mode
19761977 } else if ( compiler_options.po .fast ) {
19771978 // Release Mode
@@ -1981,13 +1982,17 @@ int main(int argc, char *argv[])
19811982 // which is now removed
19821983 } else {
19831984 // Debug Mode
1984- compiler_options.enable_bounds_checking = true ;
1985+ compiler_options.bounds_checking = true ;
19851986 }
19861987
19871988 if (compiler_options.link_numpy ) {
19881989 compiler_options.po .enable_cpython = true ;
19891990 }
19901991
1992+ if (disable_warnings) {
1993+ compiler_options.show_warnings = false ;
1994+ }
1995+
19911996 if (arg_version) {
19921997 std::string version = LFORTRAN_VERSION;
19931998 std::cout << " LPython version: " << version << std::endl;
0 commit comments