@@ -103,7 +103,7 @@ int emit_tokens(const std::string &infile, bool line_numbers, const CompilerOpti
103103 if (res.ok ) {
104104 toks = res.result ;
105105 } else {
106- LFORTRAN_ASSERT (diagnostics.has_error ())
106+ LCOMPILERS_ASSERT (diagnostics.has_error ())
107107 return 1 ;
108108 }
109109
@@ -139,7 +139,7 @@ int emit_ast(const std::string &infile,
139139 std::cerr << diagnostics.render (lm, compiler_options);
140140 }
141141 if (!r.ok ) {
142- LFORTRAN_ASSERT (diagnostics.has_error ())
142+ LCOMPILERS_ASSERT (diagnostics.has_error ())
143143 return 1 ;
144144 }
145145 LFortran::LPython::AST::ast_t * ast = r.result ;
@@ -184,7 +184,7 @@ int emit_asr(const std::string &infile,
184184 compiler_options, true , infile);
185185 std::cerr << diagnostics.render (lm, compiler_options);
186186 if (!r.ok ) {
187- LFORTRAN_ASSERT (diagnostics.has_error ())
187+ LCOMPILERS_ASSERT (diagnostics.has_error ())
188188 return 2 ;
189189 }
190190 LFortran::ASR::TranslationUnit_t* asr = r.result ;
@@ -231,7 +231,7 @@ int emit_cpp(const std::string &infile,
231231 r1 = LFortran::LPython::python_ast_to_asr (al, lm, *ast, diagnostics, compiler_options, true , infile);
232232 std::cerr << diagnostics.render (lm, compiler_options);
233233 if (!r1.ok ) {
234- LFORTRAN_ASSERT (diagnostics.has_error ())
234+ LCOMPILERS_ASSERT (diagnostics.has_error ())
235235 return 2 ;
236236 }
237237 LFortran::ASR::TranslationUnit_t* asr = r1.result ;
@@ -241,7 +241,7 @@ int emit_cpp(const std::string &infile,
241241 compiler_options.platform , 0 );
242242 std::cerr << diagnostics.render (lm, compiler_options);
243243 if (!res.ok ) {
244- LFORTRAN_ASSERT (diagnostics.has_error ())
244+ LCOMPILERS_ASSERT (diagnostics.has_error ())
245245 return 3 ;
246246 }
247247 std::cout << res.result ;
@@ -276,7 +276,7 @@ int emit_c(const std::string &infile,
276276 r1 = LFortran::LPython::python_ast_to_asr (al, lm, *ast, diagnostics, compiler_options, true , infile);
277277 std::cerr << diagnostics.render (lm, compiler_options);
278278 if (!r1.ok ) {
279- LFORTRAN_ASSERT (diagnostics.has_error ())
279+ LCOMPILERS_ASSERT (diagnostics.has_error ())
280280 return 2 ;
281281 }
282282 LFortran::ASR::TranslationUnit_t* asr = r1.result ;
@@ -286,7 +286,7 @@ int emit_c(const std::string &infile,
286286 compiler_options.platform , 0 );
287287 std::cerr << diagnostics.render (lm, compiler_options);
288288 if (!res.ok ) {
289- LFORTRAN_ASSERT (diagnostics.has_error ())
289+ LCOMPILERS_ASSERT (diagnostics.has_error ())
290290 return 3 ;
291291 }
292292 std::cout << res.result ;
@@ -321,7 +321,7 @@ int emit_wat(const std::string &infile,
321321 r1 = LFortran::LPython::python_ast_to_asr (al, lm, *ast, diagnostics, compiler_options, true , infile);
322322 std::cerr << diagnostics.render (lm, compiler_options);
323323 if (!r1.ok ) {
324- LFORTRAN_ASSERT (diagnostics.has_error ())
324+ LCOMPILERS_ASSERT (diagnostics.has_error ())
325325 return 2 ;
326326 }
327327 LFortran::ASR::TranslationUnit_t* asr = r1.result ;
@@ -330,15 +330,15 @@ int emit_wat(const std::string &infile,
330330 LFortran::Result<LFortran::Vec<uint8_t >> r2 = LFortran::asr_to_wasm_bytes_stream (*asr, al, diagnostics);
331331 std::cerr << diagnostics.render (lm, compiler_options);
332332 if (!r2.ok ) {
333- LFORTRAN_ASSERT (diagnostics.has_error ())
333+ LCOMPILERS_ASSERT (diagnostics.has_error ())
334334 return 3 ;
335335 }
336336
337337 diagnostics.diagnostics .clear ();
338338 LFortran::Result<std::string> res = LFortran::wasm_to_wat (r2.result , al, diagnostics);
339339 std::cerr << diagnostics.render (lm, compiler_options);
340340 if (!res.ok ) {
341- LFORTRAN_ASSERT (diagnostics.has_error ())
341+ LCOMPILERS_ASSERT (diagnostics.has_error ())
342342 return 4 ;
343343 }
344344 std::cout << res.result ;
@@ -590,7 +590,7 @@ int emit_llvm(const std::string &infile,
590590 r1 = LFortran::LPython::python_ast_to_asr (al, lm, *ast, diagnostics, compiler_options, true , infile);
591591 std::cerr << diagnostics.render (lm, compiler_options);
592592 if (!r1.ok ) {
593- LFORTRAN_ASSERT (diagnostics.has_error ())
593+ LCOMPILERS_ASSERT (diagnostics.has_error ())
594594 return 2 ;
595595 }
596596 LFortran::ASR::TranslationUnit_t* asr = r1.result ;
@@ -602,7 +602,7 @@ int emit_llvm(const std::string &infile,
602602 res = fe.get_llvm3 (*asr, pass_manager, diagnostics, infile);
603603 std::cerr << diagnostics.render (lm, compiler_options);
604604 if (!res.ok ) {
605- LFORTRAN_ASSERT (diagnostics.has_error ())
605+ LCOMPILERS_ASSERT (diagnostics.has_error ())
606606 return 3 ;
607607 }
608608 std::cout << (res.result )->str ();
@@ -658,7 +658,7 @@ int compile_python_to_object_file(
658658 times.push_back (std::make_pair (" AST to ASR" , std::chrono::duration<double , std::milli>(ast_to_asr_end - ast_to_asr_start).count ()));
659659 std::cerr << diagnostics.render (lm, compiler_options);
660660 if (!r1.ok ) {
661- LFORTRAN_ASSERT (diagnostics.has_error ())
661+ LCOMPILERS_ASSERT (diagnostics.has_error ())
662662 print_time_report (times, time_report);
663663 return 2 ;
664664 }
@@ -682,7 +682,7 @@ int compile_python_to_object_file(
682682 times.push_back (std::make_pair (" ASR to LLVM" , std::chrono::duration<double , std::milli>(asr_to_llvm_end - asr_to_llvm_start).count ()));
683683 std::cerr << diagnostics.render (lm, compiler_options);
684684 if (!res.ok ) {
685- LFORTRAN_ASSERT (diagnostics.has_error ())
685+ LCOMPILERS_ASSERT (diagnostics.has_error ())
686686 print_time_report (times, time_report);
687687 return 3 ;
688688 }
@@ -748,7 +748,7 @@ int compile_to_binary_wasm(
748748 times.push_back (std::make_pair (" AST to ASR" , std::chrono::duration<double , std::milli>(ast_to_asr_end - ast_to_asr_start).count ()));
749749 std::cerr << diagnostics.render (lm, compiler_options);
750750 if (!r1.ok ) {
751- LFORTRAN_ASSERT (diagnostics.has_error ())
751+ LCOMPILERS_ASSERT (diagnostics.has_error ())
752752 print_time_report (times, time_report);
753753 return 2 ;
754754 }
@@ -769,7 +769,7 @@ int compile_to_binary_wasm(
769769 std::cerr << diagnostics.render (lm, compiler_options);
770770 print_time_report (times, time_report);
771771 if (!res.ok ) {
772- LFORTRAN_ASSERT (diagnostics.has_error ())
772+ LCOMPILERS_ASSERT (diagnostics.has_error ())
773773 return 3 ;
774774 }
775775 return 0 ;
@@ -821,7 +821,7 @@ int compile_to_binary_x86(
821821 times.push_back (std::make_pair (" AST to ASR" , std::chrono::duration<double , std::milli>(ast_to_asr_end - ast_to_asr_start).count ()));
822822 std::cerr << diagnostics.render (lm, compiler_options);
823823 if (!r1.ok ) {
824- LFORTRAN_ASSERT (diagnostics.has_error ())
824+ LCOMPILERS_ASSERT (diagnostics.has_error ())
825825 print_time_report (times, time_report);
826826 return 2 ;
827827 }
@@ -842,7 +842,7 @@ int compile_to_binary_x86(
842842 std::cerr << diagnostics.render (lm, compiler_options);
843843 print_time_report (times, time_report);
844844 if (!r3.ok ) {
845- LFORTRAN_ASSERT (diagnostics.has_error ())
845+ LCOMPILERS_ASSERT (diagnostics.has_error ())
846846 return 3 ;
847847 }
848848 return 0 ;
@@ -895,7 +895,7 @@ int compile_to_binary_wasm_to_x86(
895895 times.push_back (std::make_pair (" AST to ASR" , std::chrono::duration<double , std::milli>(ast_to_asr_end - ast_to_asr_start).count ()));
896896 std::cerr << diagnostics.render (lm, compiler_options);
897897 if (!r1.ok ) {
898- LFORTRAN_ASSERT (diagnostics.has_error ())
898+ LCOMPILERS_ASSERT (diagnostics.has_error ())
899899 print_time_report (times, time_report);
900900 return 2 ;
901901 }
@@ -915,7 +915,7 @@ int compile_to_binary_wasm_to_x86(
915915 times.push_back (std::make_pair (" ASR to WASM" , std::chrono::duration<double , std::milli>(asr_to_wasm_end - asr_to_wasm_start).count ()));
916916 std::cerr << diagnostics.render (lm, compiler_options);
917917 if (!r3.ok ) {
918- LFORTRAN_ASSERT (diagnostics.has_error ())
918+ LCOMPILERS_ASSERT (diagnostics.has_error ())
919919 print_time_report (times, time_report);
920920 return 3 ;
921921 }
@@ -940,7 +940,7 @@ int compile_to_binary_wasm_to_x86(
940940 std::cerr << diagnostics.render (lm, compiler_options);
941941 print_time_report (times, time_report);
942942 if (!is_result_ok) {
943- LFORTRAN_ASSERT (diagnostics.has_error ())
943+ LCOMPILERS_ASSERT (diagnostics.has_error ())
944944 return 4 ;
945945 }
946946 return 0 ;
@@ -1089,7 +1089,7 @@ int link_executable(const std::vector<std::string> &infiles,
10891089 }
10901090 return 0 ;
10911091 } else {
1092- LFORTRAN_ASSERT (false );
1092+ LCOMPILERS_ASSERT (false );
10931093 return 1 ;
10941094 }
10951095}
@@ -1599,7 +1599,7 @@ int main(int argc, char *argv[])
15991599 std::cerr << " The C++ backend does not work with the -S option yet." << std::endl;
16001600 return 1 ;
16011601 } else {
1602- LFORTRAN_ASSERT (false );
1602+ LCOMPILERS_ASSERT (false );
16031603 }
16041604 }
16051605
0 commit comments