diff --git a/CMakeLists.txt b/CMakeLists.txt index 9545f67832..803c314838 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,21 +60,21 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) if (CMAKE_BUILD_TYPE STREQUAL "Debug") # In Debug mode we enable assertions - set(WITH_LFORTRAN_ASSERT_DEFAULT yes) + set(WITH_LCOMPILERS_ASSERT_DEFAULT yes) else() - set(WITH_LFORTRAN_ASSERT_DEFAULT no) + set(WITH_LCOMPILERS_ASSERT_DEFAULT no) endif() -# LFORTRAN_ASSERT -set(WITH_LFORTRAN_ASSERT ${WITH_LFORTRAN_ASSERT_DEFAULT} - CACHE BOOL "Enable LFORTRAN_ASSERT macro") +# LCOMPILERS_ASSERT +set(WITH_LCOMPILERS_ASSERT ${WITH_LCOMPILERS_ASSERT_DEFAULT} + CACHE BOOL "Enable LCOMPILERS_ASSERT macro") # LPYTHON_STATIC_BIN set(LPYTHON_STATIC_BIN no CACHE BOOL "Build LPython as a static binary") -# WITH_LFORTRAN_BINARY_MODFILES -set(WITH_LFORTRAN_BINARY_MODFILES YES +# WITH_LCOMPILERS_BINARY_MODFILES +set(WITH_LCOMPILERS_BINARY_MODFILES YES CACHE BOOL "Use binary modfiles") set(WITH_RUNTIME_LIBRARY YES @@ -188,14 +188,14 @@ if (WITH_LLVM) target_link_directories(p::llvm BEFORE INTERFACE ${mypath}) message(STATUS "ZLIB LIBRARY PATH: ${mypath}") endif() - set(HAVE_LFORTRAN_LLVM yes) + set(HAVE_LCOMPILERS_LLVM yes) endif() # XEUS (Fortran kernel) set(WITH_XEUS no CACHE BOOL "Build with XEUS support") if (WITH_XEUS) find_package(xeus 0.24.1 REQUIRED) - set(HAVE_LFORTRAN_XEUS yes) + set(HAVE_LCOMPILERS_XEUS yes) # Generate kernel.json with correct paths configure_file ( @@ -203,7 +203,7 @@ if (WITH_XEUS) "${CMAKE_CURRENT_BINARY_DIR}/share/jupyter/kernels/fortran/kernel.json" ) - # Configuration and data directories for Jupyter and LFortran + # Configuration and data directories for Jupyter and LPython set(XJUPYTER_DATA_DIR "share/jupyter" CACHE STRING "Jupyter data directory") # Install Jupyter kernelspecs @@ -218,15 +218,15 @@ set(WITH_JSON no CACHE BOOL "Build with JSON support") set(WITH_LSP no CACHE BOOL "Build with LSP support") if (WITH_JSON OR WITH_LSP) find_package(RapidJSON REQUIRED) - set(HAVE_LFORTRAN_RAPIDJSON yes) + set(HAVE_LCOMPILERS_RAPIDJSON yes) endif() -set(HAVE_LFORTRAN_DEMANGLE yes +set(HAVE_LCOMPILERS_DEMANGLE yes CACHE BOOL "Build with C++ name demangling support (cxxabi.h)") if (MSVC) # MSVC doesn't have cxxabi.h - set(HAVE_LFORTRAN_DEMANGLE no) + set(HAVE_LCOMPILERS_DEMANGLE no) endif() # fmt (`conda install fmt`) @@ -259,7 +259,7 @@ if (WITH_STACKTRACE) set(WITH_LINKH yes) set(WITH_BFD yes) endif() - set(HAVE_LFORTRAN_STACKTRACE yes) + set(HAVE_LCOMPILERS_STACKTRACE yes) endif() if (WITH_RUNTIME_STACKTRACE) set(WITH_UNWIND yes) @@ -272,21 +272,21 @@ if (WITH_RUNTIME_STACKTRACE) endif() if (WITH_BFD) find_package(BFD REQUIRED) - set(HAVE_LFORTRAN_BFD yes) + set(HAVE_LCOMPILERS_BFD yes) endif() if (WITH_DWARFDUMP) - set(HAVE_LFORTRAN_DWARFDUMP yes) + set(HAVE_LCOMPILERS_DWARFDUMP yes) endif() if (WITH_LINKH) find_package(LINKH REQUIRED) - set(HAVE_LFORTRAN_LINK yes) + set(HAVE_LCOMPILERS_LINK yes) endif() if (WITH_MACHO) find_package(MACHO REQUIRED) - set(HAVE_LFORTRAN_MACHO yes) + set(HAVE_LCOMPILERS_MACHO yes) endif() if (WITH_UNWIND) - set(HAVE_LFORTRAN_UNWIND yes) + set(HAVE_LCOMPILERS_UNWIND yes) endif() enable_testing() @@ -307,7 +307,7 @@ else () message("C++ compiler flags : ${CMAKE_CXX_FLAGS_RELEASE}") endif () message("Installation prefix: ${CMAKE_INSTALL_PREFIX}") -message("WITH_LFORTRAN_ASSERT: ${WITH_LFORTRAN_ASSERT}") +message("WITH_LCOMPILERS_ASSERT: ${WITH_LCOMPILERS_ASSERT}") message("LPYTHON_STATIC_BIN: ${LPYTHON_STATIC_BIN}") message("LPYTHON_BUILD_TO_WASM: ${LPYTHON_BUILD_TO_WASM}") message("WITH_STACKTRACE: ${WITH_STACKTRACE}") @@ -317,13 +317,13 @@ message("WITH_BFD: ${WITH_BFD}") message("WITH_DWARFDUMP: ${WITH_DWARFDUMP}") message("WITH_LINKH: ${WITH_LINKH}") message("WITH_MACHO: ${WITH_MACHO}") -message("HAVE_LFORTRAN_DEMANGLE: ${HAVE_LFORTRAN_DEMANGLE}") +message("HAVE_LCOMPILERS_DEMANGLE: ${HAVE_LCOMPILERS_DEMANGLE}") message("WITH_LLVM: ${WITH_LLVM}") message("WITH_XEUS: ${WITH_XEUS}") message("WITH_JSON: ${WITH_JSON}") message("WITH_LSP: ${WITH_LSP}") message("WITH_FMT: ${WITH_FMT}") -message("WITH_LFORTRAN_BINARY_MODFILES: ${WITH_LFORTRAN_BINARY_MODFILES}") +message("WITH_LCOMPILERS_BINARY_MODFILES: ${WITH_LCOMPILERS_BINARY_MODFILES}") message("WITH_RUNTIME_LIBRARY: ${WITH_RUNTIME_LIBRARY}") message("WITH_WHEREAMI: ${WITH_WHEREAMI}") message("WITH_ZLIB: ${WITH_ZLIB}") diff --git a/build1.sh b/build1.sh index 8bf7476431..05685daf0a 100755 --- a/build1.sh +++ b/build1.sh @@ -10,7 +10,7 @@ cmake \ -DWITH_STACKTRACE=yes \ -DWITH_RUNTIME_STACKTRACE=yes \ -DWITH_LSP=no \ - -DWITH_LFORTRAN_BINARY_MODFILES=no \ + -DWITH_LCOMPILERS_BINARY_MODFILES=no \ -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH_LPYTHON;$CONDA_PREFIX" \ -DCMAKE_INSTALL_PREFIX=`pwd`/inst \ . diff --git a/build_to_wasm.sh b/build_to_wasm.sh index dc8f1e1435..8b6bcbdf61 100755 --- a/build_to_wasm.sh +++ b/build_to_wasm.sh @@ -16,7 +16,7 @@ emcmake cmake \ -DLPYTHON_BUILD_TO_WASM=yes \ -DWITH_STACKTRACE=no \ -DWITH_LSP=no \ - -DWITH_LFORTRAN_BINARY_MODFILES=no \ + -DWITH_LCOMPILERS_BINARY_MODFILES=no \ -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX" \ -DCMAKE_INSTALL_PREFIX=`pwd`/inst \ . diff --git a/src/bin/lpython.cpp b/src/bin/lpython.cpp index bdc2b92aaf..a1897b3c75 100644 --- a/src/bin/lpython.cpp +++ b/src/bin/lpython.cpp @@ -39,7 +39,7 @@ #include #endif -#ifdef HAVE_LFORTRAN_RAPIDJSON +#ifdef HAVE_LCOMPILERS_RAPIDJSON #include #include #include @@ -103,7 +103,7 @@ int visualize_json(std::string &astr_data_json, LCompilers::Platform os) { return 0; } -#ifdef HAVE_LFORTRAN_LLVM +#ifdef HAVE_LCOMPILERS_LLVM #endif @@ -480,7 +480,7 @@ int emit_wat(const std::string &infile, return 0; } -#ifdef HAVE_LFORTRAN_RAPIDJSON +#ifdef HAVE_LCOMPILERS_RAPIDJSON int get_symbols (const std::string &infile, const std::string &runtime_library_dir, @@ -694,7 +694,7 @@ void print_time_report(std::vector> ×, bool } } -#ifdef HAVE_LFORTRAN_LLVM +#ifdef HAVE_LCOMPILERS_LLVM int emit_llvm(const std::string &infile, const std::string &runtime_library_dir, @@ -1789,7 +1789,7 @@ int main(int argc, char *argv[]) return emit_wat(arg_file, runtime_library_dir, compiler_options); } if (show_document_symbols) { -#ifdef HAVE_LFORTRAN_RAPIDJSON +#ifdef HAVE_LCOMPILERS_RAPIDJSON return get_symbols(arg_file, runtime_library_dir, compiler_options); #else std::cerr << "Compiler was not built with LSP support (-DWITH_LSP), please build it again." << std::endl; @@ -1798,7 +1798,7 @@ int main(int argc, char *argv[]) } if (show_errors) { -#ifdef HAVE_LFORTRAN_RAPIDJSON +#ifdef HAVE_LCOMPILERS_RAPIDJSON return get_errors(arg_file, runtime_library_dir, compiler_options); #else std::cerr << "Compiler was not configured with LSP support (-DWITH_LSP), please build it again." << std::endl; @@ -1807,7 +1807,7 @@ int main(int argc, char *argv[]) } lpython_pass_manager.use_default_passes(); if (show_llvm) { -#ifdef HAVE_LFORTRAN_LLVM +#ifdef HAVE_LCOMPILERS_LLVM return emit_llvm(arg_file, runtime_library_dir, lpython_pass_manager, compiler_options); #else std::cerr << "The --show-llvm option requires the LLVM backend to be enabled. Recompile with `WITH_LLVM=yes`." << std::endl; @@ -1832,7 +1832,7 @@ int main(int argc, char *argv[]) if (arg_c) { if (backend == Backend::llvm) { -#ifdef HAVE_LFORTRAN_LLVM +#ifdef HAVE_LCOMPILERS_LLVM return compile_python_to_object_file(arg_file, outfile, runtime_library_dir, lpython_pass_manager, compiler_options, time_report, arg_c); #else @@ -1864,7 +1864,7 @@ int main(int argc, char *argv[]) err = link_executable({emit_file_name}, outfile, runtime_library_dir, backend, static_link, true, compiler_options, rtlib_header_dir); } else if (backend == Backend::llvm) { -#ifdef HAVE_LFORTRAN_LLVM +#ifdef HAVE_LCOMPILERS_LLVM std::string tmp_o = outfile + ".tmp.o"; err = compile_python_to_object_file(arg_file, tmp_o, runtime_library_dir, lpython_pass_manager, compiler_options, time_report); diff --git a/src/libasr/CMakeLists.txt b/src/libasr/CMakeLists.txt index 2c9977c5e8..03647bf997 100644 --- a/src/libasr/CMakeLists.txt +++ b/src/libasr/CMakeLists.txt @@ -9,7 +9,7 @@ endif () if (NOT LFORTRAN_VERSION) set(LFORTRAN_VERSION "0.1-git" - CACHE STRING "LFortran version" FORCE) + CACHE STRING "LCompilers version" FORCE) endif () configure_file(config.h.in config.h) @@ -75,6 +75,11 @@ set(SRC serialization.cpp utils2.cpp ) + +if (WITH_WHEREAMI) + set(SRC ${SRC} ../bin/tpl/whereami/whereami.cpp) +endif() + if (WITH_LLVM) set(SRC ${SRC} codegen/evaluator.cpp diff --git a/src/libasr/alloc.h b/src/libasr/alloc.h index b618a84551..0c1a27f048 100644 --- a/src/libasr/alloc.h +++ b/src/libasr/alloc.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_PARSER_ALLOC_H -#define LFORTRAN_PARSER_ALLOC_H +#ifndef LIBASR_PARSER_ALLOC_H +#define LIBASR_PARSER_ALLOC_H #include #include diff --git a/src/libasr/asdl_cpp.py b/src/libasr/asdl_cpp.py index e9b66117b9..c6b637c288 100644 --- a/src/libasr/asdl_cpp.py +++ b/src/libasr/asdl_cpp.py @@ -2656,8 +2656,8 @@ def add_masks(fields, node): self.optional_masks = optional_masks -HEAD = r"""#ifndef LFORTRAN_%(MOD2)s_H -#define LFORTRAN_%(MOD2)s_H +HEAD = r"""#ifndef LIBASR_%(MOD2)s_H +#define LIBASR_%(MOD2)s_H // Generated by grammar/asdl_cpp.py @@ -2714,7 +2714,7 @@ def add_masks(fields, node): FOOT = r"""} // namespace LCompilers::%(MOD)s -#endif // LFORTRAN_%(MOD2)s_H +#endif // LIBASR_%(MOD2)s_H """ visitors = [ASTNodeVisitor0, ASTNodeVisitor1, ASTNodeVisitor, diff --git a/src/libasr/asr_scopes.h b/src/libasr/asr_scopes.h index 972982d5a3..89bc23b034 100644 --- a/src/libasr/asr_scopes.h +++ b/src/libasr/asr_scopes.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_SEMANTICS_ASR_SCOPES_H -#define LFORTRAN_SEMANTICS_ASR_SCOPES_H +#ifndef LIBASR_SEMANTICS_ASR_SCOPES_H +#define LIBASR_SEMANTICS_ASR_SCOPES_H #include @@ -100,4 +100,4 @@ struct SymbolTable { } // namespace LCompilers -#endif // LFORTRAN_SEMANTICS_ASR_SCOPES_H +#endif // LIBASR_SEMANTICS_ASR_SCOPES_H diff --git a/src/libasr/asr_utils.cpp b/src/libasr/asr_utils.cpp index cb02443863..ac5c46c14a 100644 --- a/src/libasr/asr_utils.cpp +++ b/src/libasr/asr_utils.cpp @@ -324,7 +324,7 @@ ASR::Module_t* load_module(Allocator &al, SymbolTable *symtab, PassUtils::UpdateDependenciesVisitor v(al); v.visit_TranslationUnit(*tu); if (run_verify) { -#if defined(WITH_LFORTRAN_ASSERT) +#if defined(WITH_LCOMPILERS_ASSERT) diag::Diagnostics diagnostics; if (!asr_verify(*tu, true, diagnostics)) { std::cerr << diagnostics.render2(); @@ -618,7 +618,7 @@ bool use_overloaded(ASR::expr_t* left, ASR::expr_t* right, } if (ASRUtils::symbol_parent_symtab(a_name)->get_counter() != curr_scope->get_counter()) { ADD_ASR_DEPENDENCIES_WITH_NAME(curr_scope, a_name, current_function_dependencies, s2c(al, matched_func_name)); - } + } ASRUtils::insert_module_dependency(a_name, al, current_module_dependencies); ASRUtils::set_absent_optional_arguments_to_null(a_args, func, al); asr = ASRUtils::make_FunctionCall_t_util(al, loc, a_name, sym, @@ -703,7 +703,7 @@ void process_overloaded_unary_minus_function(ASR::symbol_t* proc, ASR::expr_t* o } if (ASRUtils::symbol_parent_symtab(a_name)->get_counter() != curr_scope->get_counter()) { ADD_ASR_DEPENDENCIES_WITH_NAME(curr_scope, a_name, current_function_dependencies, s2c(al, matched_func_name)); - } + } ASRUtils::insert_module_dependency(a_name, al, current_module_dependencies); ASRUtils::set_absent_optional_arguments_to_null(a_args, func, al); asr = ASRUtils::make_FunctionCall_t_util(al, loc, a_name, proc, diff --git a/src/libasr/asr_utils.h b/src/libasr/asr_utils.h index 06e42e7fd9..66be64b91c 100644 --- a/src/libasr/asr_utils.h +++ b/src/libasr/asr_utils.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_ASR_UTILS_H -#define LFORTRAN_ASR_UTILS_H +#ifndef LIBASR_ASR_UTILS_H +#define LIBASR_ASR_UTILS_H #include #include @@ -4633,4 +4633,4 @@ inline ASR::ttype_t* make_Pointer_t_util(Allocator& al, const Location& loc, ASR } // namespace LCompilers -#endif // LFORTRAN_ASR_UTILS_H +#endif // LIBASR_ASR_UTILS_H diff --git a/src/libasr/asr_verify.cpp b/src/libasr/asr_verify.cpp index 785478765d..9ca068ad5f 100644 --- a/src/libasr/asr_verify.cpp +++ b/src/libasr/asr_verify.cpp @@ -890,7 +890,7 @@ class VerifyVisitor : public BaseWalkVisitor } SymbolTable* temp_scope = current_symtab; - + if (temp_scope->get_counter() != ASRUtils::symbol_parent_symtab(x.m_name)->get_counter() && !ASR::is_a(*asr_owner_sym) && !ASR::is_a(*x.m_name) && !ASR::is_a(*x.m_name)) { @@ -1035,7 +1035,7 @@ class VerifyVisitor : public BaseWalkVisitor } SymbolTable* temp_scope = current_symtab; - + if (asr_owner_sym && temp_scope->get_counter() != ASRUtils::symbol_parent_symtab(x.m_name)->get_counter() && !ASR::is_a(*asr_owner_sym) && !ASR::is_a(*x.m_name) && !ASR::is_a(*x.m_name)) { diff --git a/src/libasr/asr_verify.h b/src/libasr/asr_verify.h index e7003ac590..2b89233784 100644 --- a/src/libasr/asr_verify.h +++ b/src/libasr/asr_verify.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_ASR_VERIFY_H -#define LFORTRAN_ASR_VERIFY_H +#ifndef LIBASR_ASR_VERIFY_H +#define LIBASR_ASR_VERIFY_H #include @@ -40,4 +40,4 @@ namespace LCompilers { } // namespace LCompilers -#endif // LFORTRAN_ASR_VERIFY_H +#endif // LIBASR_ASR_VERIFY_H diff --git a/src/libasr/assert.h b/src/libasr/assert.h index dd628fbbbd..e64490419c 100644 --- a/src/libasr/assert.h +++ b/src/libasr/assert.h @@ -1,18 +1,18 @@ -#ifndef LFORTRAN_ASSERT_H -#define LFORTRAN_ASSERT_H +#ifndef LCOMPILERS_ASSERT_H +#define LCOMPILERS_ASSERT_H // LCOMPILERS_ASSERT uses internal functions to perform as assert // so that there is no effect with NDEBUG #include #include -#if defined(WITH_LFORTRAN_ASSERT) +#if defined(WITH_LCOMPILERS_ASSERT) #include #if !defined(LCOMPILERS_ASSERT) #define stringize(s) #s #define XSTR(s) stringize(s) -#if defined(HAVE_LFORTRAN_STACKTRACE) +#if defined(HAVE_LCOMPILERS_STACKTRACE) #define LCOMPILERS_ASSERT(cond) \ { \ if (!(cond)) { \ @@ -30,7 +30,7 @@ abort(); \ } \ } -#endif // defined(HAVE_LFORTRAN_STACKTRACE) +#endif // defined(HAVE_LCOMPILERS_STACKTRACE) #endif // !defined(LCOMPILERS_ASSERT) #if !defined(LCOMPILERS_ASSERT_MSG) @@ -48,16 +48,16 @@ } #endif // !defined(LCOMPILERS_ASSERT_MSG) -#else // defined(WITH_LFORTRAN_ASSERT) +#else // defined(WITH_LCOMPILERS_ASSERT) #define LCOMPILERS_ASSERT(cond) #define LCOMPILERS_ASSERT_MSG(cond, msg) -#endif // defined(WITH_LFORTRAN_ASSERT) +#endif // defined(WITH_LCOMPILERS_ASSERT) -#define LFORTRAN_ERROR(description) \ +#define LCOMPILERS_ERROR(description) \ std::cerr << description; \ std::cerr << "\n"; \ abort(); -#endif // LFORTRAN_ASSERT_H +#endif // LCOMPILERS_ASSERT_H diff --git a/src/libasr/bigint.h b/src/libasr/bigint.h index a299dffe9e..e6d059b509 100644 --- a/src/libasr/bigint.h +++ b/src/libasr/bigint.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_BIGINT_H -#define LFORTRAN_BIGINT_H +#ifndef LIBASR_BIGINT_H +#define LIBASR_BIGINT_H #include @@ -171,4 +171,4 @@ static_assert(sizeof(BigInt) == 8); } // namespace LCompilers -#endif // LFORTRAN_BIGINT_H +#endif // LIBASR_BIGINT_H diff --git a/src/libasr/bwriter.h b/src/libasr/bwriter.h index 0fc924af44..ee24a22eb1 100644 --- a/src/libasr/bwriter.h +++ b/src/libasr/bwriter.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_BWRITER_H -#define LFORTRAN_BWRITER_H +#ifndef LIBASR_BWRITER_H +#define LIBASR_BWRITER_H #include #include @@ -254,4 +254,4 @@ class TextReader } // namespace LCompilers -#endif // LFORTRAN_BWRITER_H +#endif // LIBASR_BWRITER_H diff --git a/src/libasr/codegen/asr_to_c.cpp b/src/libasr/codegen/asr_to_c.cpp index e855255559..af349ca410 100644 --- a/src/libasr/codegen/asr_to_c.cpp +++ b/src/libasr/codegen/asr_to_c.cpp @@ -257,7 +257,9 @@ class ASRToCVisitor : public BaseCCPPVisitor } std::string sub; bool use_ref = (v.m_intent == ASRUtils::intent_out || - v.m_intent == ASRUtils::intent_inout); + v.m_intent == ASRUtils::intent_inout || + v.m_intent == ASRUtils::intent_unspecified + ); bool is_array = ASRUtils::is_array(v.m_type); bool dummy = ASRUtils::is_arg_dummy(v.m_intent); ASR::dimension_t* m_dims = nullptr; diff --git a/src/libasr/codegen/asr_to_c.h b/src/libasr/codegen/asr_to_c.h index 5bf90948b5..c7e1e1fb92 100644 --- a/src/libasr/codegen/asr_to_c.h +++ b/src/libasr/codegen/asr_to_c.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_ASR_TO_C_H -#define LFORTRAN_ASR_TO_C_H +#ifndef LIBASR_ASR_TO_C_H +#define LIBASR_ASR_TO_C_H #include #include @@ -12,4 +12,4 @@ namespace LCompilers { } // namespace LCompilers -#endif // LFORTRAN_ASR_TO_C_H +#endif // LIBASR_ASR_TO_C_H diff --git a/src/libasr/codegen/asr_to_c_cpp.h b/src/libasr/codegen/asr_to_c_cpp.h index db43a98175..63f50867b9 100644 --- a/src/libasr/codegen/asr_to_c_cpp.h +++ b/src/libasr/codegen/asr_to_c_cpp.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_ASR_TO_C_CPP_H -#define LFORTRAN_ASR_TO_C_CPP_H +#ifndef LIBASR_ASR_TO_C_CPP_H +#define LIBASR_ASR_TO_C_CPP_H /* * Common code to be used in both of: @@ -34,7 +34,6 @@ return; \ } \ - namespace LCompilers { @@ -2825,4 +2824,4 @@ PyMODINIT_FUNC PyInit_lpython_module_)" + fn_name + R"((void) { } // namespace LCompilers -#endif // LFORTRAN_ASR_TO_C_CPP_H +#endif // LIBASR_ASR_TO_C_CPP_H diff --git a/src/libasr/codegen/asr_to_cpp.h b/src/libasr/codegen/asr_to_cpp.h index e54035a391..fa7ef4f7dd 100644 --- a/src/libasr/codegen/asr_to_cpp.h +++ b/src/libasr/codegen/asr_to_cpp.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_ASR_TO_CPP_H -#define LFORTRAN_ASR_TO_CPP_H +#ifndef LIBASR_ASR_TO_CPP_H +#define LIBASR_ASR_TO_CPP_H #include #include @@ -12,4 +12,4 @@ namespace LCompilers { } // namespace LCompilers -#endif // LFORTRAN_ASR_TO_CPP_H +#endif // LIBASR_ASR_TO_CPP_H diff --git a/src/libasr/codegen/asr_to_julia.h b/src/libasr/codegen/asr_to_julia.h index bc9e86289b..7f4ac00c51 100644 --- a/src/libasr/codegen/asr_to_julia.h +++ b/src/libasr/codegen/asr_to_julia.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_ASR_TO_JULIA_H -#define LFORTRAN_ASR_TO_JULIA_H +#ifndef LIBASR_ASR_TO_JULIA_H +#define LIBASR_ASR_TO_JULIA_H #include #include @@ -13,4 +13,4 @@ namespace LCompilers { } // namespace LCompilers -#endif // LFORTRAN_ASR_TO_JULIA_H +#endif // LIBASR_ASR_TO_JULIA_H diff --git a/src/libasr/codegen/asr_to_llvm.cpp b/src/libasr/codegen/asr_to_llvm.cpp index 48cccf4acf..9702319118 100644 --- a/src/libasr/codegen/asr_to_llvm.cpp +++ b/src/libasr/codegen/asr_to_llvm.cpp @@ -810,7 +810,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor } void visit_TranslationUnit(const ASR::TranslationUnit_t &x) { - module = std::make_unique("LFortran", context); + module = std::make_unique("LCompilers", context); module->setDataLayout(""); llvm_utils->set_module(module.get()); @@ -2257,7 +2257,6 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor ASR::is_a(*x.m_v)) ) { array = CreateLoad(array); } - Vec llvm_diminfo; llvm_diminfo.reserve(al, 2 * x.n_args + 1); if( array_t->m_physical_type == ASR::array_physical_typeType::PointerToDataArray || diff --git a/src/libasr/codegen/asr_to_llvm.h b/src/libasr/codegen/asr_to_llvm.h index a1e911e0c2..bea8159e1c 100644 --- a/src/libasr/codegen/asr_to_llvm.h +++ b/src/libasr/codegen/asr_to_llvm.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_ASR_TO_LLVM_H -#define LFORTRAN_ASR_TO_LLVM_H +#ifndef LIBASR_ASR_TO_LLVM_H +#define LIBASR_ASR_TO_LLVM_H #include #include @@ -17,4 +17,4 @@ namespace LCompilers { } // namespace LCompilers -#endif // LFORTRAN_ASR_TO_LLVM_H +#endif // LIBASR_ASR_TO_LLVM_H diff --git a/src/libasr/codegen/asr_to_py.h b/src/libasr/codegen/asr_to_py.h index 750057f7ff..f9d0dad986 100644 --- a/src/libasr/codegen/asr_to_py.h +++ b/src/libasr/codegen/asr_to_py.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_ASR_TO_PY_H -#define LFORTRAN_ASR_TO_PY_H +#ifndef LIBASR_ASR_TO_PY_H +#define LIBASR_ASR_TO_PY_H #include #include @@ -10,4 +10,4 @@ namespace LCompilers { } // namespace LCompilers -#endif // LFORTRAN_ASR_TO_PY_H +#endif // LIBASR_ASR_TO_PY_H diff --git a/src/libasr/codegen/asr_to_wasm.h b/src/libasr/codegen/asr_to_wasm.h index c0785417d1..4e5f119083 100644 --- a/src/libasr/codegen/asr_to_wasm.h +++ b/src/libasr/codegen/asr_to_wasm.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_ASR_TO_WASM_H -#define LFORTRAN_ASR_TO_WASM_H +#ifndef LIBASR_ASR_TO_WASM_H +#define LIBASR_ASR_TO_WASM_H #include @@ -18,4 +18,4 @@ Result asr_to_wasm(ASR::TranslationUnit_t &asr, Allocator &al, } // namespace LCompilers -#endif // LFORTRAN_ASR_TO_WASM_H +#endif // LIBASR_ASR_TO_WASM_H diff --git a/src/libasr/codegen/asr_to_x86.h b/src/libasr/codegen/asr_to_x86.h index 415e663a4e..0110b0a472 100644 --- a/src/libasr/codegen/asr_to_x86.h +++ b/src/libasr/codegen/asr_to_x86.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_ASR_TO_X86_H -#define LFORTRAN_ASR_TO_X86_H +#ifndef LIBASR_ASR_TO_X86_H +#define LIBASR_ASR_TO_X86_H #include @@ -12,4 +12,4 @@ namespace LCompilers { } // namespace LCompilers -#endif // LFORTRAN_ASR_TO_X86_H +#endif // LIBASR_ASR_TO_X86_H diff --git a/src/libasr/codegen/c_utils.h b/src/libasr/codegen/c_utils.h index e6a65e0ce2..c21b038114 100644 --- a/src/libasr/codegen/c_utils.h +++ b/src/libasr/codegen/c_utils.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_C_UTILS_H -#define LFORTRAN_C_UTILS_H +#ifndef LIBASR_C_UTILS_H +#define LIBASR_C_UTILS_H #include #include @@ -1880,4 +1880,4 @@ namespace BindPyUtils { } // namespace LCompilers -#endif // LFORTRAN_C_UTILS_H +#endif // LIBASR_C_UTILS_H diff --git a/src/libasr/codegen/evaluator.h b/src/libasr/codegen/evaluator.h index 9c8e1a21c7..c0934324fc 100644 --- a/src/libasr/codegen/evaluator.h +++ b/src/libasr/codegen/evaluator.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_EVALUATOR_H -#define LFORTRAN_EVALUATOR_H +#ifndef LIBASR_EVALUATOR_H +#define LIBASR_EVALUATOR_H #include #include @@ -75,4 +75,4 @@ class LLVMEvaluator } // namespace LCompilers -#endif // LFORTRAN_EVALUATOR_H +#endif // LIBASR_EVALUATOR_H diff --git a/src/libasr/codegen/llvm_array_utils.h b/src/libasr/codegen/llvm_array_utils.h index 002d6bdc90..5160cb70d4 100644 --- a/src/libasr/codegen/llvm_array_utils.h +++ b/src/libasr/codegen/llvm_array_utils.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_LLVM_ARR_UTILS_H -#define LFORTRAN_LLVM_ARR_UTILS_H +#ifndef LIBASR_LLVM_ARR_UTILS_H +#define LIBASR_LLVM_ARR_UTILS_H #include #include @@ -463,4 +463,4 @@ namespace LCompilers { } // namespace LCompilers -#endif // LFORTRAN_LLVM_ARR_UTILS_H +#endif // LIBASR_LLVM_ARR_UTILS_H diff --git a/src/libasr/codegen/llvm_utils.h b/src/libasr/codegen/llvm_utils.h index 904cbea903..41b38b7df5 100644 --- a/src/libasr/codegen/llvm_utils.h +++ b/src/libasr/codegen/llvm_utils.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_LLVM_UTILS_H -#define LFORTRAN_LLVM_UTILS_H +#ifndef LIBASR_LLVM_UTILS_H +#define LIBASR_LLVM_UTILS_H #include @@ -1112,4 +1112,4 @@ namespace LCompilers { } // namespace LCompilers -#endif // LFORTRAN_LLVM_UTILS_H +#endif // LIBASR_LLVM_UTILS_H diff --git a/src/libasr/codegen/wasm_decoder.h b/src/libasr/codegen/wasm_decoder.h index c42405ad16..c6201b93c6 100644 --- a/src/libasr/codegen/wasm_decoder.h +++ b/src/libasr/codegen/wasm_decoder.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_WASM_DECODER_H -#define LFORTRAN_WASM_DECODER_H +#ifndef LIBASR_WASM_DECODER_H +#define LIBASR_WASM_DECODER_H #include @@ -391,4 +391,4 @@ class WASMDecoder { } // namespace LCompilers -#endif // LFORTRAN_WASM_DECODER_H +#endif // LIBASR_WASM_DECODER_H diff --git a/src/libasr/codegen/wasm_to_wat.h b/src/libasr/codegen/wasm_to_wat.h index 51f1183f30..e907dcb1db 100644 --- a/src/libasr/codegen/wasm_to_wat.h +++ b/src/libasr/codegen/wasm_to_wat.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_WASM_TO_WAT_H -#define LFORTRAN_WASM_TO_WAT_H +#ifndef LIBASR_WASM_TO_WAT_H +#define LIBASR_WASM_TO_WAT_H #include @@ -10,4 +10,4 @@ Result wasm_to_wat(Vec &wasm_bytes, Allocator &al, } // namespace LCompilers -#endif // LFORTRAN_WASM_TO_WAT_H +#endif // LIBASR_WASM_TO_WAT_H diff --git a/src/libasr/codegen/wasm_to_x86.h b/src/libasr/codegen/wasm_to_x86.h index 11c456ab27..576f16fb2c 100644 --- a/src/libasr/codegen/wasm_to_x86.h +++ b/src/libasr/codegen/wasm_to_x86.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_WASM_TO_X86_H -#define LFORTRAN_WASM_TO_X86_H +#ifndef LIBASR_WASM_TO_X86_H +#define LIBASR_WASM_TO_X86_H #include @@ -11,4 +11,4 @@ Result wasm_to_x86(Vec &wasm_bytes, Allocator &al, } // namespace LCompilers -#endif // LFORTRAN_WASM_TO_X86_H +#endif // LIBASR_WASM_TO_X86_H diff --git a/src/libasr/codegen/wasm_utils.h b/src/libasr/codegen/wasm_utils.h index 7745840299..c0e1d6c71e 100644 --- a/src/libasr/codegen/wasm_utils.h +++ b/src/libasr/codegen/wasm_utils.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_WASM_UTILS_H -#define LFORTRAN_WASM_UTILS_H +#ifndef LIBASR_WASM_UTILS_H +#define LIBASR_WASM_UTILS_H #include #include @@ -145,4 +145,4 @@ void hexdump(void *ptr, int buflen); } // namespace LCompilers -#endif // LFORTRAN_WASM_UTILS_H +#endif // LIBASR_WASM_UTILS_H diff --git a/src/libasr/codegen/x86_assembler.cpp b/src/libasr/codegen/x86_assembler.cpp index 5f82a98f4f..5841ec7ebd 100644 --- a/src/libasr/codegen/x86_assembler.cpp +++ b/src/libasr/codegen/x86_assembler.cpp @@ -1,8 +1,8 @@ #ifdef __unix__ -#define LFORTRAN_LINUX +#define LIBASR_LINUX #endif -#ifdef LFORTRAN_LINUX +#ifdef LIBASR_LINUX #include #endif @@ -35,7 +35,7 @@ void X86Assembler::save_binary(const std::string &filename) { out.open(filename); out.write((const char*) m_code.p, m_code.size()); } -#ifdef LFORTRAN_LINUX +#ifdef LIBASR_LINUX std::string mode = "0755"; int mod = strtol(mode.c_str(), 0, 8); if (chmod(filename.c_str(),mod) < 0) { diff --git a/src/libasr/codegen/x86_assembler.h b/src/libasr/codegen/x86_assembler.h index bf722c668a..24cf6c8ed7 100644 --- a/src/libasr/codegen/x86_assembler.h +++ b/src/libasr/codegen/x86_assembler.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_CODEGEN_X86_ASSEMBER_H -#define LFORTRAN_CODEGEN_X86_ASSEMBER_H +#ifndef LIBASR_CODEGEN_X86_ASSEMBER_H +#define LIBASR_CODEGEN_X86_ASSEMBER_H /* @@ -13,7 +13,7 @@ final machine code is not the shortest possible, because jumps could possibly be encoded shorter if the final relative address is shorter, but it would require more passes and thus slower compilation. -For debugging purposes, one can enable the macro LFORTRAN_ASM_PRINT and one can +For debugging purposes, one can enable the macro LCOMPILERS_ASM_PRINT and one can then obtain a human readable assembly printout of all instructions. Disable the macro for best performance. @@ -36,9 +36,9 @@ Old Link: https://www.systutorials.com/go/intel-x86-64-reference-manual/ #include // Define to allow the Assembler print the asm instructions -#define LFORTRAN_ASM_PRINT +#define LCOMPILERS_ASM_PRINT -#ifdef LFORTRAN_ASM_PRINT +#ifdef LCOMPILERS_ASM_PRINT # define EMIT(s) emit(" ", s) # define EMIT_LABEL(s) emit("", s) # define EMIT_VAR(a, b, c) emit(" ", a + " equ " + c + " - " + b) @@ -424,7 +424,7 @@ class X86Assembler { Vec m_code; std::map m_symbols; uint32_t m_origin; -#ifdef LFORTRAN_ASM_PRINT +#ifdef LCOMPILERS_ASM_PRINT std::string m_asm_code; void emit(const std::string &indent, const std::string &s) { m_asm_code += indent + s + "\n"; @@ -444,7 +444,7 @@ class X86Assembler { #endif } -#ifdef LFORTRAN_ASM_PRINT +#ifdef LCOMPILERS_ASM_PRINT std::string get_asm() { return m_asm_code; } @@ -1638,6 +1638,6 @@ void emit_print_64(X86Assembler &a, const std::string &msg_label, uint64_t size) void emit_print_int_64(X86Assembler &a, const std::string &name); void emit_print_double(X86Assembler &a, const std::string &name); -} // namespace LFortran +} // namespace LCompilers -#endif // LFORTRAN_CODEGEN_X86_ASSEMBER_H +#endif // LIBASR_CODEGEN_X86_ASSEMBER_H diff --git a/src/libasr/colors.h b/src/libasr/colors.h index b5bf260086..119052012e 100644 --- a/src/libasr/colors.h +++ b/src/libasr/colors.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_COLORS_H -#define LFORTRAN_COLORS_H +#ifndef LIBASR_COLORS_H +#define LIBASR_COLORS_H namespace LCompilers { @@ -72,4 +72,4 @@ std::string color(T const value) } // namespace LCompilers -#endif // LFORTRAN_COLORS_H +#endif // LIBASR_COLORS_H diff --git a/src/libasr/config.h.in b/src/libasr/config.h.in index 292b593bb4..c0e73931d5 100644 --- a/src/libasr/config.h.in +++ b/src/libasr/config.h.in @@ -1,17 +1,17 @@ -#ifndef LFORTRAN_CONFIG_H -#define LFORTRAN_CONFIG_H +#ifndef LCOMPILERS_CONFIG_H +#define LCOMPILERS_CONFIG_H -/* Define if you want to enable ASSERT testing in LFortran */ -#cmakedefine WITH_LFORTRAN_ASSERT +/* Define if you want to enable ASSERT testing in LCompilers */ +#cmakedefine WITH_LCOMPILERS_ASSERT -/* LFortran version */ +/* LCompilers version */ #cmakedefine LFORTRAN_VERSION "@LFORTRAN_VERSION@" /* Define if LLVM is enabled */ -#cmakedefine HAVE_LFORTRAN_LLVM +#cmakedefine HAVE_LCOMPILERS_LLVM /* Define if RAPIDJSON is found */ -#cmakedefine HAVE_LFORTRAN_RAPIDJSON +#cmakedefine HAVE_LCOMPILERS_RAPIDJSON /* Define if stacktrace is enabled */ #cmakedefine HAVE_LFORTRAN_STACKTRACE @@ -23,12 +23,12 @@ #cmakedefine HAVE_LFORTRAN_UNWIND /* Define if cxxabi.h is present */ -#cmakedefine HAVE_LFORTRAN_DEMANGLE +#cmakedefine HAVE_LCOMPILERS_DEMANGLE /* Define if XEUS is enabled */ -#cmakedefine HAVE_LFORTRAN_XEUS +#cmakedefine HAVE_LCOMPILERS_XEUS /* Define if we should use binary modfiles */ -#cmakedefine WITH_LFORTRAN_BINARY_MODFILES +#cmakedefine WITH_LCOMPILERS_BINARY_MODFILES -#endif // LFORTRAN_CONFIG_H +#endif // LCOMPILERS_CONFIG_H diff --git a/src/libasr/containers.h b/src/libasr/containers.h index 502e5532fc..2019b9e197 100644 --- a/src/libasr/containers.h +++ b/src/libasr/containers.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_CONTAINERS_H -#define LFORTRAN_CONTAINERS_H +#ifndef LIBASR_CONTAINERS_H +#define LIBASR_CONTAINERS_H #include #include @@ -35,7 +35,7 @@ class VecIterator size_t m_index; }; -#ifdef WITH_LFORTRAN_ASSERT +#ifdef WITH_LCOMPILERS_ASSERT static int vec_called_const = 0xdeadbeef; #endif @@ -43,7 +43,7 @@ template struct Vec { size_t n, max; T* p; -#ifdef WITH_LFORTRAN_ASSERT +#ifdef WITH_LCOMPILERS_ASSERT int reserve_called; #endif @@ -54,7 +54,7 @@ struct Vec { LCOMPILERS_ASSERT(max > 0) this->max = max; p = al.allocate(max); -#ifdef WITH_LFORTRAN_ASSERT +#ifdef WITH_LCOMPILERS_ASSERT reserve_called = vec_called_const; #endif } @@ -158,7 +158,7 @@ struct Vec { this->p = p; this->n = n; this->max = n; -#ifdef WITH_LFORTRAN_ASSERT +#ifdef WITH_LCOMPILERS_ASSERT reserve_called = vec_called_const; #endif } diff --git a/src/libasr/diagnostics.h b/src/libasr/diagnostics.h index 63e1d832c3..2eed5433c5 100644 --- a/src/libasr/diagnostics.h +++ b/src/libasr/diagnostics.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_DIAGNOSTICS_H -#define LFORTRAN_DIAGNOSTICS_H +#ifndef LIBASR_DIAGNOSTICS_H +#define LIBASR_DIAGNOSTICS_H #include #include @@ -256,4 +256,4 @@ std::tuple diag_level_to_str(const Diagno } // namespace LCompilers -#endif // LFORTRAN_DIAGNOSTICS_H +#endif // LIBASR_DIAGNOSTICS_H diff --git a/src/libasr/exception.h b/src/libasr/exception.h index 1ca9d02a77..30b89ea90d 100644 --- a/src/libasr/exception.h +++ b/src/libasr/exception.h @@ -1,18 +1,18 @@ -#ifndef LFORTRAN_EXCEPTION_H -#define LFORTRAN_EXCEPTION_H +#ifndef LIBASR_EXCEPTION_H +#define LIBASR_EXCEPTION_H #ifdef __cplusplus extern "C" { #endif typedef enum { - LFORTRAN_NO_EXCEPTION = 0, - LFORTRAN_RUNTIME_ERROR = 1, - LFORTRAN_EXCEPTION = 2, - LFORTRAN_PARSER_ERROR = 4, - LFORTRAN_ASSERT_FAILED = 7, - LFORTRAN_ASSEMBLER_ERROR = 8, -} lfortran_exceptions_t; + LCOMPILERS_NO_EXCEPTION = 0, + LCOMPILERS_RUNTIME_ERROR = 1, + LCOMPILERS_EXCEPTION = 2, + LCOMPILERS_PARSER_ERROR = 4, + LCOMPILERS_ASSERT_FAILED = 7, + LCOMPILERS_ASSEMBLER_ERROR = 8, +} lcompilers_exceptions_t; #ifdef __cplusplus } @@ -100,14 +100,14 @@ const int stacktrace_depth = 4; class LCompilersException : public std::exception { std::string m_msg; - lfortran_exceptions_t ec; + lcompilers_exceptions_t ec; std::vector m_stacktrace_addresses; public: - LCompilersException(const std::string &msg, lfortran_exceptions_t error) + LCompilersException(const std::string &msg, lcompilers_exceptions_t error) : m_msg{msg}, ec{error}, m_stacktrace_addresses{get_stacktrace_addresses()} { } LCompilersException(const std::string &msg) - : LCompilersException(msg, LFORTRAN_EXCEPTION) + : LCompilersException(msg, LCOMPILERS_EXCEPTION) { } const char *what() const throw() @@ -121,9 +121,9 @@ class LCompilersException : public std::exception std::string name() const { switch (ec) { - case (lfortran_exceptions_t::LFORTRAN_EXCEPTION) : + case (lcompilers_exceptions_t::LCOMPILERS_EXCEPTION) : return "LCompilersException"; - case (lfortran_exceptions_t::LFORTRAN_ASSERT_FAILED) : + case (lcompilers_exceptions_t::LCOMPILERS_ASSERT_FAILED) : return "AssertFailed"; default : return "Unknown Exception"; } @@ -132,7 +132,7 @@ class LCompilersException : public std::exception { return m_stacktrace_addresses; } - lfortran_exceptions_t error_code() + lcompilers_exceptions_t error_code() { return ec; } @@ -142,7 +142,7 @@ class AssertFailed : public LCompilersException { public: AssertFailed(const std::string &msg) - : LCompilersException(msg, LFORTRAN_ASSERT_FAILED) + : LCompilersException(msg, LCOMPILERS_ASSERT_FAILED) { } }; @@ -151,7 +151,7 @@ class AssemblerError : public LCompilersException { public: AssemblerError(const std::string &msg) - : LCompilersException(msg, LFORTRAN_ASSEMBLER_ERROR) + : LCompilersException(msg, LCOMPILERS_ASSEMBLER_ERROR) { } }; @@ -169,4 +169,4 @@ static inline T TRY(Result result) { } // namespace LCompilers #endif // __cplusplus -#endif // LFORTRAN_EXCEPTION_H +#endif // LIBASR_EXCEPTION_H diff --git a/src/libasr/location.h b/src/libasr/location.h index fa3a684178..7505e7896a 100644 --- a/src/libasr/location.h +++ b/src/libasr/location.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_PARSER_LOCATION_H -#define LFORTRAN_PARSER_LOCATION_H +#ifndef LIBASR_PARSER_LOCATION_H +#define LIBASR_PARSER_LOCATION_H #include #include diff --git a/src/libasr/modfile.cpp b/src/libasr/modfile.cpp index d2c7501149..0f8225c10b 100644 --- a/src/libasr/modfile.cpp +++ b/src/libasr/modfile.cpp @@ -13,7 +13,7 @@ namespace LCompilers { const std::string lfortran_modfile_type_string = "LCompilers Modfile"; inline void save_asr(const ASR::TranslationUnit_t &m, std::string& asr_string) { - #ifdef WITH_LFORTRAN_BINARY_MODFILES + #ifdef WITH_LCOMPILERS_BINARY_MODFILES BinaryWriter b; #else TextWriter b; @@ -71,7 +71,7 @@ std::string save_pycfile(const ASR::TranslationUnit_t &m) { } inline void load_serialised_asr(const std::string &s, std::string& asr_binary) { -#ifdef WITH_LFORTRAN_BINARY_MODFILES +#ifdef WITH_LCOMPILERS_BINARY_MODFILES BinaryReader b(s); #else TextReader b(s); @@ -82,7 +82,7 @@ inline void load_serialised_asr(const std::string &s, std::string& asr_binary) { } std::string version = b.read_string(); if (version != LFORTRAN_VERSION) { - throw LCompilersException("Incompatible format: LFortran Modfile was generated using version '" + version + "', but current LFortran version is '" + LFORTRAN_VERSION + "'"); + throw LCompilersException("Incompatible format: LCompilers Modfile was generated using version '" + version + "', but current LCompilers version is '" + LFORTRAN_VERSION + "'"); } asr_binary = b.read_string(); } diff --git a/src/libasr/modfile.h b/src/libasr/modfile.h index b331af42c9..7e083e319d 100644 --- a/src/libasr/modfile.h +++ b/src/libasr/modfile.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_MODFILE_H -#define LFORTRAN_MODFILE_H +#ifndef LIBASR_MODFILE_H +#define LIBASR_MODFILE_H #include @@ -19,4 +19,4 @@ namespace LCompilers { } // namespace LCompilers -#endif // LFORTRAN_MODFILE_H +#endif // LIBASR_MODFILE_H diff --git a/src/libasr/pass/instantiate_template.cpp b/src/libasr/pass/instantiate_template.cpp index 14144170c3..431b326ec1 100644 --- a/src/libasr/pass/instantiate_template.cpp +++ b/src/libasr/pass/instantiate_template.cpp @@ -650,7 +650,7 @@ void check_restriction(std::map type_subs, diag::Label("Function's parameter " + avar + " of type " + atype, {arg->m_args[i]->base.loc}) - + } )); throw SemanticAbort(); diff --git a/src/libasr/pass/pass_utils.h b/src/libasr/pass/pass_utils.h index dddd00b3b7..170c0e069b 100644 --- a/src/libasr/pass/pass_utils.h +++ b/src/libasr/pass/pass_utils.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_PASS_UTILS_H -#define LFORTRAN_PASS_UTILS_H +#ifndef LIBASR_PASS_UTILS_H +#define LIBASR_PASS_UTILS_H #include #include @@ -332,7 +332,7 @@ namespace LCompilers { } void visit_FunctionCall(const ASR::FunctionCall_t& x) { - if (fill_function_dependencies) { + if (fill_function_dependencies) { ASR::symbol_t* asr_owner_sym = nullptr; if (current_scope->asr_owner && ASR::is_a(*current_scope->asr_owner)) { asr_owner_sym = ASR::down_cast(current_scope->asr_owner); @@ -412,7 +412,7 @@ namespace LCompilers { visit_stmt(*x.m_body[i]); } current_scope = parent_symtab; - } + } }; namespace ReplacerUtils { @@ -817,4 +817,4 @@ namespace LCompilers { } // namespace LCompilers -#endif // LFORTRAN_PASS_UTILS_H +#endif // LIBASR_PASS_UTILS_H diff --git a/src/libasr/runtime/lfortran_intrinsics.h b/src/libasr/runtime/lfortran_intrinsics.h index 3ea56e4991..66384cfa20 100644 --- a/src/libasr/runtime/lfortran_intrinsics.h +++ b/src/libasr/runtime/lfortran_intrinsics.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_INTRINSICS_H -#define LFORTRAN_INTRINSICS_H +#ifndef LIBASR_INTRINSICS_H +#define LIBASR_INTRINSICS_H #include #include diff --git a/src/libasr/semantic_exception.h b/src/libasr/semantic_exception.h index 9a4d4fd299..6c1bc1777e 100644 --- a/src/libasr/semantic_exception.h +++ b/src/libasr/semantic_exception.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_SEMANTICS_SEMANTIC_EXCEPTION_H -#define LFORTRAN_SEMANTICS_SEMANTIC_EXCEPTION_H +#ifndef LIBASR_SEMANTICS_SEMANTIC_EXCEPTION_H +#define LIBASR_SEMANTICS_SEMANTIC_EXCEPTION_H #include diff --git a/src/libasr/serialization.cpp b/src/libasr/serialization.cpp index 3c0bc96882..f83e2d6f4d 100644 --- a/src/libasr/serialization.cpp +++ b/src/libasr/serialization.cpp @@ -13,9 +13,8 @@ using LCompilers::ASRUtils::symbol_name; namespace LCompilers { - class ASRSerializationVisitor : -#ifdef WITH_LFORTRAN_BINARY_MODFILES +#ifdef WITH_LCOMPILERS_BINARY_MODFILES public BinaryWriter, #else public TextWriter, @@ -50,7 +49,7 @@ std::string serialize(const ASR::TranslationUnit_t &unit) { } class ASRDeserializationVisitor : -#ifdef WITH_LFORTRAN_BINARY_MODFILES +#ifdef WITH_LCOMPILERS_BINARY_MODFILES public BinaryReader, #else public TextReader, @@ -60,7 +59,7 @@ class ASRDeserializationVisitor : public: ASRDeserializationVisitor(Allocator &al, const std::string &s, bool load_symtab_id) : -#ifdef WITH_LFORTRAN_BINARY_MODFILES +#ifdef WITH_LCOMPILERS_BINARY_MODFILES BinaryReader(s), #else TextReader(s), diff --git a/src/libasr/stacktrace.cpp b/src/libasr/stacktrace.cpp index c356e4b3ff..d41af3e7ce 100644 --- a/src/libasr/stacktrace.cpp +++ b/src/libasr/stacktrace.cpp @@ -19,26 +19,26 @@ // The following C headers are needed for some specific C functionality (see // the comments), which is not available in C++: -#ifdef HAVE_LFORTRAN_UNWIND +#ifdef HAVE_LCOMPILERS_UNWIND // For _Unwind_Backtrace() function # include #endif -#if defined(HAVE_LFORTRAN_DEMANGLE) +#if defined(HAVE_LCOMPILERS_DEMANGLE) // For demangling function names # include #endif -#ifdef HAVE_LFORTRAN_LINK +#ifdef HAVE_LCOMPILERS_LINK // For dl_iterate_phdr() functionality # include #endif -#ifdef HAVE_LFORTRAN_MACHO +#ifdef HAVE_LCOMPILERS_MACHO # include #endif -#ifdef HAVE_LFORTRAN_BFD +#ifdef HAVE_LCOMPILERS_BFD // For bfd_* family of functions for loading debugging symbols from the binary // This is the only nonstandard header file and the binary must be linked // with "-lbfd". @@ -59,7 +59,7 @@ namespace LCompilers { std::string binary_executable_path = "/proc/self/exe"; -#ifdef HAVE_LFORTRAN_UNWIND +#ifdef HAVE_LCOMPILERS_UNWIND static _Unwind_Reason_Code unwind_callback(struct _Unwind_Context *context, void *vdata) @@ -76,11 +76,11 @@ static _Unwind_Reason_Code unwind_callback(struct _Unwind_Context *context, return _URC_NO_REASON; } -#endif // HAVE_LFORTRAN_UNWIND +#endif // HAVE_LCOMPILERS_UNWIND -#ifdef HAVE_LFORTRAN_LINK +#ifdef HAVE_LCOMPILERS_LINK /* Tries to find the 'data.addr' in the current shared lib (as passed in 'info'). If it succeeds, returns (in the 'data') the full path to the shared @@ -109,13 +109,13 @@ int shared_lib_callback(struct dl_phdr_info *info, return 0; } -#endif // HAVE_LFORTRAN_LINK +#endif // HAVE_LCOMPILERS_LINK // Fills in `local_pc` and `binary_filename` of `item` void get_local_address(StacktraceItem &item) { -#ifdef HAVE_LFORTRAN_LINK +#ifdef HAVE_LCOMPILERS_LINK // Iterate over all loaded shared libraries (see dl_iterate_phdr(3) - // Linux man page for more documentation) if (dl_iterate_phdr(shared_lib_callback, &item) == 0) { @@ -137,7 +137,7 @@ void get_local_address(StacktraceItem &item) abort(); } #else -#ifdef HAVE_LFORTRAN_MACHO +#ifdef HAVE_LCOMPILERS_MACHO for (uint32_t i = 0; i < _dyld_image_count(); i++) { const struct mach_header *header = _dyld_get_image_header(i); intptr_t offset = _dyld_get_image_vmaddr_slide(i); @@ -181,8 +181,8 @@ void get_local_address(StacktraceItem &item) abort(); #else item.local_pc=0; -#endif // HAVE_LFORTRAN_MACHO -#endif // HAVE_LFORTRAN_LINK +#endif // HAVE_LCOMPILERS_MACHO +#endif // HAVE_LCOMPILERS_LINK } @@ -202,7 +202,7 @@ std::string demangle_function_name(std::string name) s = "??"; } else { char *d = 0; -#if defined(HAVE_LFORTRAN_DEMANGLE) +#if defined(HAVE_LCOMPILERS_DEMANGLE) int status = 0; d = abi::__cxa_demangle(name.c_str(), 0, 0, &status); #endif @@ -218,7 +218,7 @@ std::string demangle_function_name(std::string name) } -#ifdef HAVE_LFORTRAN_BFD +#ifdef HAVE_LCOMPILERS_BFD /* This struct is used to pass information into process_section(). */ @@ -365,7 +365,7 @@ void get_symbol_info_bfd(std::string binary_filename, uintptr_t addr, } } -#endif // HAVE_LFORTRAN_BFD +#endif // HAVE_LCOMPILERS_BFD @@ -544,7 +544,7 @@ void show_stacktrace() std::vector get_stacktrace_addresses() { std::vector d; -#ifdef HAVE_LFORTRAN_UNWIND +#ifdef HAVE_LCOMPILERS_UNWIND _Unwind_Backtrace(unwind_callback, &d); #endif return d; @@ -624,14 +624,14 @@ void get_local_info_dwarfdump(std::vector &d) void get_local_info(std::vector &d) { -#ifdef HAVE_LFORTRAN_DWARFDUMP +#ifdef HAVE_LCOMPILERS_DWARFDUMP get_local_info_dwarfdump(d); #else -# ifdef HAVE_LFORTRAN_BFD +# ifdef HAVE_LCOMPILERS_BFD bfd_init(); # endif for (size_t i=0; i < d.size(); i++) { -# ifdef HAVE_LFORTRAN_BFD +# ifdef HAVE_LCOMPILERS_BFD get_symbol_info_bfd(d[i].binary_filename, d[i].local_pc, d[i].source_filename, d[i].function_name, d[i].line_number); # endif diff --git a/src/libasr/stacktrace.h b/src/libasr/stacktrace.h index 5a3e653943..318ab5d2e4 100644 --- a/src/libasr/stacktrace.h +++ b/src/libasr/stacktrace.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_STACKTRACE_H -#define LFORTRAN_STACKTRACE_H +#ifndef LIBASR_STACKTRACE_H +#define LIBASR_STACKTRACE_H #include #include @@ -66,4 +66,4 @@ std::string error_stacktrace(const std::vector &stacktrace); } // namespace LCompilers -#endif // LFORTRAN_STACKTRACE_H +#endif // LIBASR_STACKTRACE_H diff --git a/src/libasr/string_utils.h b/src/libasr/string_utils.h index 505ce43835..e7f9694885 100644 --- a/src/libasr/string_utils.h +++ b/src/libasr/string_utils.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_STRING_UTILS_H -#define LFORTRAN_STRING_UTILS_H +#ifndef LIBASR_STRING_UTILS_H +#define LIBASR_STRING_UTILS_H #include #include @@ -46,4 +46,4 @@ char* str_unescape_fortran(Allocator &al, LCompilers::Str &s, char ch); } // namespace LCompilers -#endif // LFORTRAN_STRING_UTILS_H +#endif // LIBASR_STRING_UTILS_H diff --git a/src/libasr/utils.h b/src/libasr/utils.h index 8f46ada7a4..ae2d4250b9 100644 --- a/src/libasr/utils.h +++ b/src/libasr/utils.h @@ -85,6 +85,9 @@ bool read_file(const std::string &filename, std::string &text); bool present(Vec &v, const char* name); bool present(char** const v, size_t n, const std::string name); int initialize(); +std::string get_runtime_library_dir(); +void get_executable_path(std::string &executable_path, int &dirname_length); +std::string get_runtime_library_header_dir(); } // namespace LCompilers diff --git a/src/libasr/utils2.cpp b/src/libasr/utils2.cpp index 51a2a3c5f4..15f96349ac 100644 --- a/src/libasr/utils2.cpp +++ b/src/libasr/utils2.cpp @@ -11,6 +11,10 @@ #include #include +#ifdef HAVE_WHEREAMI +#include +#endif + namespace LCompilers { std::string get_unique_ID() { diff --git a/src/libasr/wasm_instructions_visitor.py b/src/libasr/wasm_instructions_visitor.py index 614042ac48..3c9a6e97f7 100644 --- a/src/libasr/wasm_instructions_visitor.py +++ b/src/libasr/wasm_instructions_visitor.py @@ -2,8 +2,8 @@ import os import re -HEAD = r"""#ifndef LFORTRAN_%(MOD)s_H -#define LFORTRAN_%(MOD)s_H +HEAD = r"""#ifndef LIBASR_%(MOD)s_H +#define LIBASR_%(MOD)s_H // Generated by grammar/wasm_instructions_visitor.py @@ -27,7 +27,7 @@ } // namespace LCompilers -#endif // LFORTRAN_%(MOD)s_H +#endif // LIBASR_%(MOD)s_H """ class WASMInstructionsVisitor(): diff --git a/src/lpython/bigint.h b/src/lpython/bigint.h index 6fd5622a7b..c906cf618f 100644 --- a/src/lpython/bigint.h +++ b/src/lpython/bigint.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_BIGINT_H -#define LFORTRAN_BIGINT_H +#ifndef LPYTHON_BIGINT_H +#define LPYTHON_BIGINT_H #include @@ -165,4 +165,4 @@ static_assert(sizeof(BigInt) == 8); } // LCompilers::LPython -#endif // LFORTRAN_BIGINT_H +#endif // LPYTHON_BIGINT_H diff --git a/src/lpython/pickle.h b/src/lpython/pickle.h index 64e7f47850..da06cc1103 100644 --- a/src/lpython/pickle.h +++ b/src/lpython/pickle.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_PICKLE_H -#define LFORTRAN_PICKLE_H +#ifndef LPYTHON_PICKLE_H +#define LPYTHON_PICKLE_H #include #include @@ -25,4 +25,4 @@ namespace LCompilers::LPython { } -#endif // LFORTRAN_PICKLE_H +#endif // LPYTHON_PICKLE_H diff --git a/src/lpython/python_evaluator.cpp b/src/lpython/python_evaluator.cpp index c38fb92fea..db3988ce5a 100644 --- a/src/lpython/python_evaluator.cpp +++ b/src/lpython/python_evaluator.cpp @@ -6,7 +6,7 @@ #include #include -#ifdef HAVE_LFORTRAN_LLVM +#ifdef HAVE_LCOMPILERS_LLVM #include #include #else @@ -24,7 +24,7 @@ namespace LCompilers { PythonCompiler::PythonCompiler(CompilerOptions compiler_options) : al{1024*1024}, -#ifdef HAVE_LFORTRAN_LLVM +#ifdef HAVE_LCOMPILERS_LLVM e{std::make_unique()}, eval_count{0}, #endif @@ -37,7 +37,7 @@ PythonCompiler::~PythonCompiler() = default; Result> PythonCompiler::get_llvm3( -#ifdef HAVE_LFORTRAN_LLVM +#ifdef HAVE_LCOMPILERS_LLVM ASR::TranslationUnit_t &asr, LCompilers::PassManager& lpm, diag::Diagnostics &diagnostics, const std::string &infile #else @@ -46,7 +46,7 @@ Result> PythonCompiler::get_llvm3( #endif ) { -#ifdef HAVE_LFORTRAN_LLVM +#ifdef HAVE_LCOMPILERS_LLVM eval_count++; run_fn = "__lfortran_evaluate_" + std::to_string(eval_count); diff --git a/src/lpython/python_evaluator.h b/src/lpython/python_evaluator.h index b18b0aaf88..1fe4872709 100644 --- a/src/lpython/python_evaluator.h +++ b/src/lpython/python_evaluator.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_PYTHON_EVALUATOR_H -#define LFORTRAN_PYTHON_EVALUATOR_H +#ifndef LPYTHON_PYTHON_EVALUATOR_H +#define LPYTHON_PYTHON_EVALUATOR_H #include #include @@ -57,7 +57,7 @@ class PythonCompiler private: Allocator al; -#ifdef HAVE_LFORTRAN_LLVM +#ifdef HAVE_LCOMPILERS_LLVM std::unique_ptr e; int eval_count; #endif @@ -68,4 +68,4 @@ class PythonCompiler } // namespace LCompilers -#endif // LFORTRAN_PYTHON_EVALUATOR_H +#endif // LPYTHON_PYTHON_EVALUATOR_H diff --git a/src/lpython/python_serialization.cpp b/src/lpython/python_serialization.cpp index 7afe96faa8..594882b556 100644 --- a/src/lpython/python_serialization.cpp +++ b/src/lpython/python_serialization.cpp @@ -9,7 +9,7 @@ namespace LCompilers::LPython { class ASTDeserializationVisitor : -#ifdef WITH_LFORTRAN_BINARY_MODFILES +#ifdef WITH_LCOMPILERS_BINARY_MODFILES public BinaryReader, #else public TextReader, @@ -18,7 +18,7 @@ class ASTDeserializationVisitor : { public: ASTDeserializationVisitor(Allocator &al, const std::string &s) : -#ifdef WITH_LFORTRAN_BINARY_MODFILES +#ifdef WITH_LCOMPILERS_BINARY_MODFILES BinaryReader(s), #else TextReader(s), diff --git a/src/lpython/python_serialization.h b/src/lpython/python_serialization.h index b4c68ec025..5183e94dc2 100644 --- a/src/lpython/python_serialization.h +++ b/src/lpython/python_serialization.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_PYTHON_SERIALIZATION_H -#define LFORTRAN_PYTHON_SERIALIZATION_H +#ifndef LPYTHON_PYTHON_SERIALIZATION_H +#define LPYTHON_PYTHON_SERIALIZATION_H #include #include @@ -10,4 +10,4 @@ namespace LCompilers::LPython { } // namespace LCompilers::LPython -#endif // LFORTRAN_PYTHON_SERIALIZATION_H +#endif // LPYTHON_PYTHON_SERIALIZATION_H diff --git a/src/lpython/semantics/python_ast_to_asr.cpp b/src/lpython/semantics/python_ast_to_asr.cpp index fe3efe6f40..f1e220faf3 100644 --- a/src/lpython/semantics/python_ast_to_asr.cpp +++ b/src/lpython/semantics/python_ast_to_asr.cpp @@ -1200,7 +1200,7 @@ class CommonVisitor : public AST::BaseVisitor { Vec args_new; args_new.reserve(al, func->n_args); visit_expr_list_with_cast(func->m_args, func->n_args, args_new, args); - + if (ASRUtils::symbol_parent_symtab(stemp)->get_counter() != current_scope->get_counter()) { ADD_ASR_DEPENDENCIES(current_scope, stemp, dependencies); } diff --git a/src/lpython/semantics/python_ast_to_asr.h b/src/lpython/semantics/python_ast_to_asr.h index 8270846c32..ce0dc74eef 100644 --- a/src/lpython/semantics/python_ast_to_asr.h +++ b/src/lpython/semantics/python_ast_to_asr.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_PYTHON_AST_TO_ASR_H -#define LFORTRAN_PYTHON_AST_TO_ASR_H +#ifndef LPYTHON_PYTHON_AST_TO_ASR_H +#define LPYTHON_PYTHON_AST_TO_ASR_H #include #include @@ -15,4 +15,4 @@ namespace LCompilers::LPython { } // namespace LCompilers::LPython -#endif // LFORTRAN_PYTHON_AST_TO_ASR_H +#endif // LPYTHON_PYTHON_AST_TO_ASR_H diff --git a/src/lpython/semantics/semantic_exception.h b/src/lpython/semantics/semantic_exception.h index 8ee4c307f3..86a9f350df 100644 --- a/src/lpython/semantics/semantic_exception.h +++ b/src/lpython/semantics/semantic_exception.h @@ -1,5 +1,5 @@ -#ifndef LFORTRAN_SEMANTICS_SEMANTIC_EXCEPTION_H -#define LFORTRAN_SEMANTICS_SEMANTIC_EXCEPTION_H +#ifndef LPYTHON_SEMANTICS_SEMANTIC_EXCEPTION_H +#define LPYTHON_SEMANTICS_SEMANTIC_EXCEPTION_H #include diff --git a/src/lpython/utils.cpp b/src/lpython/utils.cpp index 6484a88448..af0d165307 100644 --- a/src/lpython/utils.cpp +++ b/src/lpython/utils.cpp @@ -7,8 +7,6 @@ #include -#include - #include #include #include diff --git a/src/lpython/utils.h b/src/lpython/utils.h index f6b9f88f9b..37a274a921 100644 --- a/src/lpython/utils.h +++ b/src/lpython/utils.h @@ -1,14 +1,11 @@ -#ifndef LFORTRAN_UTILS_H -#define LFORTRAN_UTILS_H +#ifndef LPYTHON_UTILS_H +#define LPYTHON_UTILS_H #include #include namespace LCompilers::LPython { -void get_executable_path(std::string &executable_path, int &dirname_length); -std::string get_runtime_library_dir(); -std::string get_runtime_library_header_dir(); bool is_directory(std::string path); bool path_exists(std::string path); @@ -19,4 +16,4 @@ std::string generate_visualize_html(std::string &astr_data_json); } // LFortran -#endif // LFORTRAN_UTILS_H +#endif // LPYTHON_UTILS_H diff --git a/tests/reference/llvm-assert1-8df4f31.json b/tests/reference/llvm-assert1-8df4f31.json index f7af1f27c3..02d6859bea 100644 --- a/tests/reference/llvm-assert1-8df4f31.json +++ b/tests/reference/llvm-assert1-8df4f31.json @@ -10,4 +10,4 @@ "stderr": null, "stderr_hash": null, "returncode": 0 -} \ No newline at end of file +} diff --git a/tests/reference/llvm-assert1-8df4f31.stdout b/tests/reference/llvm-assert1-8df4f31.stdout index 084a225695..d6b7e78115 100644 --- a/tests/reference/llvm-assert1-8df4f31.stdout +++ b/tests/reference/llvm-assert1-8df4f31.stdout @@ -1,5 +1,5 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" +; ModuleID = 'LCompilers' +source_filename = "LCompilers" define i32 @main(i32 %0, i8** %1) { .entry: diff --git a/tests/reference/llvm-bindc_01-c984f09.json b/tests/reference/llvm-bindc_01-c984f09.json index b8bf60feb9..e30f548ad6 100644 --- a/tests/reference/llvm-bindc_01-c984f09.json +++ b/tests/reference/llvm-bindc_01-c984f09.json @@ -10,4 +10,4 @@ "stderr": null, "stderr_hash": null, "returncode": 0 -} \ No newline at end of file +} diff --git a/tests/reference/llvm-bindc_01-c984f09.stdout b/tests/reference/llvm-bindc_01-c984f09.stdout index 16f056eec7..0770ec09b0 100644 --- a/tests/reference/llvm-bindc_01-c984f09.stdout +++ b/tests/reference/llvm-bindc_01-c984f09.stdout @@ -1,5 +1,5 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" +; ModuleID = 'LCompilers' +source_filename = "LCompilers" @queries = global void* null @x = global i16* null diff --git a/tests/reference/llvm-bool1-af4376b.json b/tests/reference/llvm-bool1-af4376b.json index 8a924e4972..3ee4345dbc 100644 --- a/tests/reference/llvm-bool1-af4376b.json +++ b/tests/reference/llvm-bool1-af4376b.json @@ -10,4 +10,4 @@ "stderr": null, "stderr_hash": null, "returncode": 0 -} \ No newline at end of file +} diff --git a/tests/reference/llvm-bool1-af4376b.stdout b/tests/reference/llvm-bool1-af4376b.stdout index 67423eab3e..bcd25665ef 100644 --- a/tests/reference/llvm-bool1-af4376b.stdout +++ b/tests/reference/llvm-bool1-af4376b.stdout @@ -1,5 +1,5 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" +; ModuleID = 'LCompilers' +source_filename = "LCompilers" @0 = private unnamed_addr constant [2 x i8] c" \00", align 1 @1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 diff --git a/tests/reference/llvm-expr14-b96b5b1.json b/tests/reference/llvm-expr14-b96b5b1.json index a3c6d2f1be..ea505c8de6 100644 --- a/tests/reference/llvm-expr14-b96b5b1.json +++ b/tests/reference/llvm-expr14-b96b5b1.json @@ -10,4 +10,4 @@ "stderr": null, "stderr_hash": null, "returncode": 0 -} \ No newline at end of file +} diff --git a/tests/reference/llvm-expr14-b96b5b1.stdout b/tests/reference/llvm-expr14-b96b5b1.stdout index 084a225695..d6b7e78115 100644 --- a/tests/reference/llvm-expr14-b96b5b1.stdout +++ b/tests/reference/llvm-expr14-b96b5b1.stdout @@ -1,5 +1,5 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" +; ModuleID = 'LCompilers' +source_filename = "LCompilers" define i32 @main(i32 %0, i8** %1) { .entry: diff --git a/tests/reference/llvm-expr_01-54467c1.json b/tests/reference/llvm-expr_01-54467c1.json index f3c32d129d..dbff56665c 100644 --- a/tests/reference/llvm-expr_01-54467c1.json +++ b/tests/reference/llvm-expr_01-54467c1.json @@ -10,4 +10,4 @@ "stderr": null, "stderr_hash": null, "returncode": 0 -} \ No newline at end of file +} diff --git a/tests/reference/llvm-expr_01-54467c1.stdout b/tests/reference/llvm-expr_01-54467c1.stdout index 1eb63578bf..8199a1bdae 100644 --- a/tests/reference/llvm-expr_01-54467c1.stdout +++ b/tests/reference/llvm-expr_01-54467c1.stdout @@ -1,5 +1,5 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" +; ModuleID = 'LCompilers' +source_filename = "LCompilers" @0 = private unnamed_addr constant [2 x i8] c" \00", align 1 @1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 diff --git a/tests/reference/llvm-func_inline_01-2d4583a.json b/tests/reference/llvm-func_inline_01-2d4583a.json index 075a1dfc5f..0e60d1465d 100644 --- a/tests/reference/llvm-func_inline_01-2d4583a.json +++ b/tests/reference/llvm-func_inline_01-2d4583a.json @@ -10,4 +10,4 @@ "stderr": null, "stderr_hash": null, "returncode": 0 -} \ No newline at end of file +} diff --git a/tests/reference/llvm-func_inline_01-2d4583a.stdout b/tests/reference/llvm-func_inline_01-2d4583a.stdout index ec43646d47..9dea0c35bf 100644 --- a/tests/reference/llvm-func_inline_01-2d4583a.stdout +++ b/tests/reference/llvm-func_inline_01-2d4583a.stdout @@ -1,5 +1,5 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" +; ModuleID = 'LCompilers' +source_filename = "LCompilers" @0 = private unnamed_addr constant [2 x i8] c" \00", align 1 @1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 diff --git a/tests/reference/llvm-print_04-443a8d8.stdout b/tests/reference/llvm-print_04-443a8d8.stdout index 520f8a3d65..2b41ca529f 100644 --- a/tests/reference/llvm-print_04-443a8d8.stdout +++ b/tests/reference/llvm-print_04-443a8d8.stdout @@ -1,5 +1,5 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" +; ModuleID = 'LCompilers' +source_filename = "LCompilers" @u = global i64 -922337203685477580 @x = global i32 -2147483648 diff --git a/tests/reference/llvm-test_issue_518-cdb641a.json b/tests/reference/llvm-test_issue_518-cdb641a.json index e11cc83f6d..883f5fa219 100644 --- a/tests/reference/llvm-test_issue_518-cdb641a.json +++ b/tests/reference/llvm-test_issue_518-cdb641a.json @@ -10,4 +10,4 @@ "stderr": null, "stderr_hash": null, "returncode": 0 -} \ No newline at end of file +} diff --git a/tests/reference/llvm-test_issue_518-cdb641a.stdout b/tests/reference/llvm-test_issue_518-cdb641a.stdout index 00236ee26f..a02ea9abe9 100644 --- a/tests/reference/llvm-test_issue_518-cdb641a.stdout +++ b/tests/reference/llvm-test_issue_518-cdb641a.stdout @@ -1,5 +1,5 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" +; ModuleID = 'LCompilers' +source_filename = "LCompilers" @0 = private unnamed_addr constant [16 x i8] c"AssertionError\0A\00", align 1 @1 = private unnamed_addr constant [16 x i8] c"AssertionError\0A\00", align 1 diff --git a/tests/reference/llvm-test_unary_op_03-046fb86.stdout b/tests/reference/llvm-test_unary_op_03-046fb86.stdout index f460174a28..9130244b78 100644 --- a/tests/reference/llvm-test_unary_op_03-046fb86.stdout +++ b/tests/reference/llvm-test_unary_op_03-046fb86.stdout @@ -1,5 +1,5 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" +; ModuleID = 'LCompilers' +source_filename = "LCompilers" @0 = private unnamed_addr constant [16 x i8] c"AssertionError\0A\00", align 1 @1 = private unnamed_addr constant [16 x i8] c"AssertionError\0A\00", align 1 diff --git a/tests/reference/llvm_dbg-expr_01-9fc5f30.json b/tests/reference/llvm_dbg-expr_01-9fc5f30.json index c139101c1d..1456b2a88b 100644 --- a/tests/reference/llvm_dbg-expr_01-9fc5f30.json +++ b/tests/reference/llvm_dbg-expr_01-9fc5f30.json @@ -10,4 +10,4 @@ "stderr": null, "stderr_hash": null, "returncode": 0 -} \ No newline at end of file +} diff --git a/tests/reference/llvm_dbg-expr_01-9fc5f30.stdout b/tests/reference/llvm_dbg-expr_01-9fc5f30.stdout index c942af4f3a..5f75cd77e4 100644 --- a/tests/reference/llvm_dbg-expr_01-9fc5f30.stdout +++ b/tests/reference/llvm_dbg-expr_01-9fc5f30.stdout @@ -1,5 +1,5 @@ -; ModuleID = 'LFortran' -source_filename = "LFortran" +; ModuleID = 'LCompilers' +source_filename = "LCompilers" @0 = private unnamed_addr constant [2 x i8] c" \00", align 1 @1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1