Skip to content

Commit

Permalink
Rename Macros to Libasr and LPython
Browse files Browse the repository at this point in the history
  • Loading branch information
Thirumalai-Shaktivel committed Nov 19, 2022
1 parent bb2e4fe commit cf81f9c
Show file tree
Hide file tree
Showing 64 changed files with 200 additions and 199 deletions.
3 changes: 2 additions & 1 deletion build1.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
cmake ^
-DCMAKE_BUILD_TYPE=Release ^
-DWITH_LLVM=yes ^
-DLFORTRAN_BUILD_ALL=yes ^
-DLPYTHON_BUILD_ALL=yes ^
-DWITH_STACKTRACE=no ^
-DCMAKE_PREFIX_PATH="%CONDA_PREFIX%" ^
-DCMAKE_INSTALL_PREFIX=%cd%/inst ^
.

cmake --build . --config Release -j8 --target install
2 changes: 1 addition & 1 deletion src/bin/lpython.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ EMSCRIPTEN_KEEPALIVE char* emit_wasm_from_source(char *input) {
int main(int argc, char *argv[])
{
LCompilers::initialize();
#if defined(HAVE_LFORTRAN_STACKTRACE)
#if defined(HAVE_LCOMPILERS_STACKTRACE)
LCompilers::print_stack_on_segfault();
#endif
try {
Expand Down
4 changes: 2 additions & 2 deletions src/libasr/alloc.h
Original file line number Diff line number Diff line change
@@ -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 <algorithm>
#include <cstdlib>
Expand Down
6 changes: 3 additions & 3 deletions src/libasr/asdl_cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2133,8 +2133,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
Expand Down Expand Up @@ -2190,7 +2190,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,
Expand Down
6 changes: 3 additions & 3 deletions src/libasr/asr_scopes.h
Original file line number Diff line number Diff line change
@@ -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 <map>

Expand Down Expand Up @@ -84,4 +84,4 @@ struct SymbolTable {

} // namespace LCompilers

#endif // LFORTRAN_SEMANTICS_ASR_SCOPES_H
#endif // LIBASR_SEMANTICS_ASR_SCOPES_H
6 changes: 3 additions & 3 deletions src/libasr/asr_utils.h
Original file line number Diff line number Diff line change
@@ -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 <functional>
#include <map>
Expand Down Expand Up @@ -2179,4 +2179,4 @@ static inline ASR::EnumType_t* get_EnumType_from_symbol(ASR::symbol_t* s) {

} // namespace LCompilers

#endif // LFORTRAN_ASR_UTILS_H
#endif // LIBASR_ASR_UTILS_H
6 changes: 3 additions & 3 deletions src/libasr/asr_verify.h
Original file line number Diff line number Diff line change
@@ -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 <libasr/asr.h>

Expand Down Expand Up @@ -40,4 +40,4 @@ namespace LCompilers {

} // namespace LCompilers

#endif // LFORTRAN_ASR_VERIFY_H
#endif // LIBASR_ASR_VERIFY_H
2 changes: 1 addition & 1 deletion src/libasr/assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

#endif // defined(WITH_LCOMPILERS_ASSERT)

#define LFORTRAN_ERROR(description) \
#define LCOMPILERS_ERROR(description) \
std::cerr << description; \
std::cerr << "\n"; \
abort();
Expand Down
6 changes: 3 additions & 3 deletions src/libasr/bigint.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef LFORTRAN_BIGINT_H
#define LFORTRAN_BIGINT_H
#ifndef LIBASR_BIGINT_H
#define LIBASR_BIGINT_H

#include <cstdint>

Expand Down Expand Up @@ -165,4 +165,4 @@ static_assert(sizeof(BigInt) == 8);

} // namespace LCompilers

#endif // LFORTRAN_BIGINT_H
#endif // LIBASR_BIGINT_H
6 changes: 3 additions & 3 deletions src/libasr/bwriter.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef LFORTRAN_BWRITER_H
#define LFORTRAN_BWRITER_H
#ifndef LIBASR_BWRITER_H
#define LIBASR_BWRITER_H

#include <sstream>
#include <iomanip>
Expand Down Expand Up @@ -254,4 +254,4 @@ class TextReader

} // namespace LCompilers

#endif // LFORTRAN_BWRITER_H
#endif // LIBASR_BWRITER_H
6 changes: 3 additions & 3 deletions src/libasr/codegen/asr_to_c.h
Original file line number Diff line number Diff line change
@@ -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 <libasr/asr.h>
#include <libasr/utils.h>
Expand All @@ -12,4 +12,4 @@ namespace LCompilers {

} // namespace LCompilers

#endif // LFORTRAN_ASR_TO_C_H
#endif // LIBASR_ASR_TO_C_H
6 changes: 3 additions & 3 deletions src/libasr/codegen/asr_to_c_cpp.h
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -1650,4 +1650,4 @@ R"(#include <stdio.h>

} // namespace LCompilers

#endif // LFORTRAN_ASR_TO_C_CPP_H
#endif // LIBASR_ASR_TO_C_CPP_H
6 changes: 3 additions & 3 deletions src/libasr/codegen/asr_to_cpp.h
Original file line number Diff line number Diff line change
@@ -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 <libasr/asr.h>
#include <libasr/utils.h>
Expand All @@ -11,4 +11,4 @@ namespace LCompilers {

} // namespace LCompilers

#endif // LFORTRAN_ASR_TO_CPP_H
#endif // LIBASR_ASR_TO_CPP_H
6 changes: 3 additions & 3 deletions src/libasr/codegen/asr_to_julia.h
Original file line number Diff line number Diff line change
@@ -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 <libasr/asr.h>
#include <libasr/asr_utils.h>
Expand All @@ -13,4 +13,4 @@ namespace LCompilers {

} // namespace LCompilers

#endif // LFORTRAN_ASR_TO_JULIA_H
#endif // LIBASR_ASR_TO_JULIA_H
6 changes: 3 additions & 3 deletions src/libasr/codegen/asr_to_llvm.h
Original file line number Diff line number Diff line change
@@ -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 <libasr/asr.h>
#include <libasr/codegen/evaluator.h>
Expand All @@ -17,4 +17,4 @@ namespace LCompilers {

} // namespace LCompilers

#endif // LFORTRAN_ASR_TO_LLVM_H
#endif // LIBASR_ASR_TO_LLVM_H
6 changes: 3 additions & 3 deletions src/libasr/codegen/asr_to_py.h
Original file line number Diff line number Diff line change
@@ -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 <libasr/asr.h>
#include <tuple>
Expand All @@ -10,4 +10,4 @@ namespace LCompilers {

} // namespace LCompilers

#endif // LFORTRAN_ASR_TO_PY_H
#endif // LIBASR_ASR_TO_PY_H
6 changes: 3 additions & 3 deletions src/libasr/codegen/asr_to_wasm.h
Original file line number Diff line number Diff line change
@@ -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 <libasr/asr.h>

Expand All @@ -17,4 +17,4 @@ Result<int> asr_to_wasm(ASR::TranslationUnit_t &asr, Allocator &al,

} // namespace LCompilers

#endif // LFORTRAN_ASR_TO_WASM_H
#endif // LIBASR_ASR_TO_WASM_H
6 changes: 3 additions & 3 deletions src/libasr/codegen/asr_to_x86.h
Original file line number Diff line number Diff line change
@@ -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 <libasr/asr.h>

Expand All @@ -12,4 +12,4 @@ namespace LCompilers {

} // namespace LCompilers

#endif // LFORTRAN_ASR_TO_X86_H
#endif // LIBASR_ASR_TO_X86_H
6 changes: 3 additions & 3 deletions src/libasr/codegen/c_utils.h
Original file line number Diff line number Diff line change
@@ -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 <libasr/asr.h>
#include <libasr/asr_utils.h>
Expand Down Expand Up @@ -945,4 +945,4 @@ class CCPPDSUtils {

} // namespace LCompilers

#endif // LFORTRAN_C_UTILS_H
#endif // LIBASR_C_UTILS_H
6 changes: 3 additions & 3 deletions src/libasr/codegen/evaluator.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef LFORTRAN_EVALUATOR_H
#define LFORTRAN_EVALUATOR_H
#ifndef LIBASR_EVALUATOR_H
#define LIBASR_EVALUATOR_H

#include <complex>
#include <iostream>
Expand Down Expand Up @@ -75,4 +75,4 @@ class LLVMEvaluator

} // namespace LCompilers

#endif // LFORTRAN_EVALUATOR_H
#endif // LIBASR_EVALUATOR_H
6 changes: 3 additions & 3 deletions src/libasr/codegen/llvm_array_utils.h
Original file line number Diff line number Diff line change
@@ -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 <map>
#include <memory>
Expand Down Expand Up @@ -406,4 +406,4 @@ namespace LCompilers {

} // namespace LCompilers

#endif // LFORTRAN_LLVM_ARR_UTILS_H
#endif // LIBASR_LLVM_ARR_UTILS_H
6 changes: 3 additions & 3 deletions src/libasr/codegen/llvm_utils.h
Original file line number Diff line number Diff line change
@@ -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 <memory>

Expand Down Expand Up @@ -570,4 +570,4 @@ namespace LCompilers {

} // namespace LCompilers

#endif // LFORTRAN_LLVM_UTILS_H
#endif // LIBASR_LLVM_UTILS_H
6 changes: 3 additions & 3 deletions src/libasr/codegen/wasm_decoder.h
Original file line number Diff line number Diff line change
@@ -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 <fstream>

Expand Down Expand Up @@ -331,4 +331,4 @@ class WASMDecoder {

} // namespace LCompilers

#endif // LFORTRAN_WASM_DECODER_H
#endif // LIBASR_WASM_DECODER_H
6 changes: 3 additions & 3 deletions src/libasr/codegen/wasm_to_wat.h
Original file line number Diff line number Diff line change
@@ -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 <libasr/wasm_visitor.h>

Expand Down Expand Up @@ -288,4 +288,4 @@ Result<std::string> wasm_to_wat(Vec<uint8_t> &wasm_bytes, Allocator &al,

} // namespace LCompilers

#endif // LFORTRAN_WASM_TO_WAT_H
#endif // LIBASR_WASM_TO_WAT_H
6 changes: 3 additions & 3 deletions src/libasr/codegen/wasm_to_x86.h
Original file line number Diff line number Diff line change
@@ -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 <libasr/wasm_visitor.h>

Expand All @@ -11,4 +11,4 @@ Result<int> wasm_to_x86(Vec<uint8_t> &wasm_bytes, Allocator &al,

} // namespace LCompilers

#endif // LFORTRAN_WASM_TO_X86_H
#endif // LIBASR_WASM_TO_X86_H
6 changes: 3 additions & 3 deletions src/libasr/codegen/wasm_utils.h
Original file line number Diff line number Diff line change
@@ -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 <iostream>
#include <unordered_map>
Expand Down Expand Up @@ -70,4 +70,4 @@ void hexdump(void *ptr, int buflen);

} // namespace LCompilers

#endif // LFORTRAN_WASM_UTILS_H
#endif // LIBASR_WASM_UTILS_H
6 changes: 3 additions & 3 deletions src/libasr/codegen/x86_assembler.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifdef __unix__
#define LFORTRAN_LINUX
#define LIBASR_LINUX
#endif

#ifdef LFORTRAN_LINUX
#ifdef LIBASR_LINUX
#include <sys/stat.h>
#endif

Expand All @@ -16,7 +16,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) {
Expand Down
Loading

0 comments on commit cf81f9c

Please sign in to comment.