Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,9 @@ RUN(NAME print_04 LABELS cpython llvm llvm_jit c)
RUN(NAME print_06 LABELS cpython llvm llvm_jit) # renable c
RUN(NAME print_05 LABELS cpython llvm llvm_jit c wasm wasm_x64)
RUN(NAME print_float LABELS cpython llvm llvm_jit c wasm wasm_x64)
# RUN(NAME print_list_tuple_01 LABELS cpython llvm llvm_jit NOFAST) # renable c # post sync
RUN(NAME print_list_tuple_01 LABELS cpython llvm llvm_jit NOFAST) # renable c # post sync
# RUN(NAME print_list_tuple_02 LABELS cpython llvm llvm_jit c NOFAST)
# RUN(NAME print_list_tuple_03 LABELS cpython llvm llvm_jit c NOFAST)
RUN(NAME print_list_tuple_03 LABELS cpython llvm llvm_jit c NOFAST)
RUN(NAME test_list_item_mixed_print LABELS cpython llvm llvm_jit NOFAST) # renable c # post sync
# RUN(NAME test_intrinsic_function_mixed_print LABELS cpython llvm llvm_jit NOFAST) # post sync

Expand Down Expand Up @@ -562,11 +562,11 @@ RUN(NAME test_list_concat LABELS cpython llvm llvm_jit c NOFAST)
# RUN(NAME test_list_reserve LABELS cpython llvm llvm_jit) # post sync
# RUN(NAME test_const_list LABELS cpython llvm llvm_jit) # post sync
# RUN(NAME test_const_access LABELS cpython llvm llvm_jit) # post sync
# RUN(NAME test_tuple_01 LABELS cpython llvm llvm_jit) # renable c # post sync
# RUN(NAME test_tuple_02 LABELS cpython llvm llvm_jit c NOFAST)
# RUN(NAME test_tuple_03 LABELS cpython llvm llvm_jit) # renable c # post sync
# RUN(NAME test_tuple_04 LABELS cpython llvm llvm_jit) # renable c # post sync
# RUN(NAME test_tuple_concat LABELS cpython llvm llvm_jit) # post sync
RUN(NAME test_tuple_01 LABELS cpython llvm llvm_jit) # renable c # post sync
RUN(NAME test_tuple_02 LABELS cpython llvm llvm_jit NOFAST) # renable c
RUN(NAME test_tuple_03 LABELS cpython llvm llvm_jit) # renable c # post sync
RUN(NAME test_tuple_04 LABELS cpython llvm llvm_jit) # renable c # post sync
RUN(NAME test_tuple_concat LABELS cpython llvm llvm_jit) # post sync
# RUN(NAME test_tuple_nested LABELS cpython llvm llvm_jit) # post sync
# RUN(NAME test_const_dict LABELS cpython llvm llvm_jit) # post sync
# RUN(NAME test_params LABELS cpython llvm llvm_jit NOFAST)
Expand Down Expand Up @@ -671,7 +671,7 @@ RUN(NAME test_c_interop_01 LABELS cpython llvm llvm_jit c)
# RUN(NAME bindpy_06 LABELS cpython llvm_py EXTRA_ARGS --enable-cpython NOFAST COPY_TO_BIN bindpy_06_module.py REQ_PY_VER 3.10)
# RUN(NAME test_generics_01 LABELS cpython llvm llvm_jit NOFAST) # renable c # post sync
RUN(NAME test_cmath LABELS cpython llvm llvm_jit c NOFAST)
RUN(NAME test_complex_01 LABELS cpython llvm llvm_jit c wasm wasm_x64)
RUN(NAME test_complex_01 LABELS cpython llvm llvm_jit c wasm) # renable wasm_x64
RUN(NAME test_complex_02 LABELS cpython llvm llvm_jit c)
RUN(NAME test_ConstantEllipsis LABLES cpython llvm llvm_jit c)
RUN(NAME test_max_min LABELS cpython llvm llvm_jit c)
Expand Down
2 changes: 1 addition & 1 deletion libasr
Submodule libasr updated 801 files
4 changes: 0 additions & 4 deletions src/bin/lpython.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1880,8 +1880,6 @@ int main(int argc, char *argv[])
// app.add_option("-J", arg_J, "Where to save mod files");
app.add_flag("--jit", to_jit, "Execute the program using just-in-time (JIT) compiler");
app.add_flag("-g", compiler_options.emit_debug_info, "Compile with debugging information");
app.add_flag("--debug-with-line-column", compiler_options.emit_debug_line_column,
"Convert the linear location info into line + column in the debugging information");
// app.add_option("-D", compiler_options.c_preprocessor_defines, "Define <macro>=<value> (or 1 if <value> omitted)")->allow_extra_args(false);
app.add_flag("--version", arg_version, "Display compiler version information");

Expand Down Expand Up @@ -2085,7 +2083,6 @@ int main(int argc, char *argv[])
lpython_pass_manager.parse_pass_arg(arg_pass, skip_pass);
lpython_pass_manager.use_default_passes();
compiler_options.po.disable_main = true;
compiler_options.emit_debug_line_column = false;
compiler_options.separate_compilation = false;
return interactive_python_repl(lpython_pass_manager, compiler_options, arg_v);
#else
Expand Down Expand Up @@ -2225,7 +2222,6 @@ int main(int argc, char *argv[])
return 1;
}
compiler_options.emit_debug_info = false;
compiler_options.emit_debug_line_column = false;
compiler_options.separate_compilation = false;
return compile_python_using_llvm(arg_file, "", runtime_library_dir,
lpython_pass_manager, compiler_options, time_report, false, true);
Expand Down
13 changes: 0 additions & 13 deletions src/lpython/python_evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,19 +445,6 @@ Result<std::unique_ptr<LLVMModule>> PythonCompiler::get_llvm3(
)
{
#ifdef HAVE_LFORTRAN_LLVM
if (compiler_options.emit_debug_info) {
if (!compiler_options.emit_debug_line_column) {
diagnostics.add(LCompilers::diag::Diagnostic(
"The `emit_debug_line_column` is not enabled; please use the "
"`--debug-with-line-column` option to get the correct "
"location information",
LCompilers::diag::Level::Error,
LCompilers::diag::Stage::Semantic, {})
);
Error err;
return err;
}
}
// ASR -> LLVM
std::unique_ptr<LCompilers::LLVMModule> m;
Result<std::unique_ptr<LCompilers::LLVMModule>> res
Expand Down
1 change: 0 additions & 1 deletion src/lpython/python_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ namespace LCompilers::LPython {
custom_interpreter() : e{CompilerOptions()} {
e.compiler_options.interactive = true;
e.compiler_options.po.disable_main = true;
e.compiler_options.emit_debug_line_column = false;
e.compiler_options.separate_compilation = false;
}
virtual ~custom_interpreter() = default;
Expand Down
9 changes: 8 additions & 1 deletion src/lpython/semantics/python_ast_to_asr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3518,7 +3518,14 @@ class CommonVisitor : public AST::BaseVisitor<StructType> {
this->visit_expr(*x.m_elts[i]);
ASR::expr_t *expr = ASRUtils::EXPR(tmp);
elements.push_back(al, expr);
tuple_type_vec.push_back(al, ASRUtils::expr_type(expr));
ASR::ttype_t *type = ASRUtils::expr_type(expr);

if (ASRUtils::is_character(*type) && !ASRUtils::is_allocatable(type))
type = ASRUtils::TYPE(ASR::make_Allocatable_t(al, x.base.base.loc,
ASRUtils::TYPE(ASR::make_String_t(al, x.base.base.loc, 1, nullptr,
ASR::string_length_kindType::DeferredLength,
ASR::string_physical_typeType::DescriptorString))));
tuple_type_vec.push_back(al, type);
}
ASR::ttype_t *tuple_type = ASRUtils::TYPE(ASR::make_Tuple_t(al, x.base.base.loc,
tuple_type_vec.p, tuple_type_vec.n));
Expand Down
43 changes: 21 additions & 22 deletions src/lpython/semantics/python_intrinsic_eval.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ struct IntrinsicNodeHandler {
loc);
}
ASR::expr_t *arg = nullptr;
ASR::expr_t *res_value = nullptr;
ASR::ttype_t *arg_type = nullptr;
if (args.size() > 0) {
arg = args[0].m_value;
Expand All @@ -345,43 +344,43 @@ struct IntrinsicNodeHandler {
sm << ival;
std::string value_str = sm.str();
sm.clear();
ASR::ttype_t* res_type = ASRUtils::TYPE(ASR::make_Allocatable_t(al, loc,
ASRUtils::TYPE(ASR::make_String_t(al, loc, 1, nullptr,
ASR::string_length_kindType::DeferredLength,
ASR::string_physical_typeType::DescriptorString))));
res_value = ASR::down_cast<ASR::expr_t>(ASR::make_StringConstant_t(al,
loc, s2c(al, value_str), res_type));
ASR::ttype_t* res_type = ASRUtils::TYPE(ASR::make_String_t(al, loc, 1,
ASRUtils::EXPR(ASR::make_IntegerConstant_t(al, loc,
value_str.size(), ASRUtils::TYPE(ASR::make_Integer_t(al, loc, 4)))),
ASR::string_length_kindType::ExpressionLength,
ASR::string_physical_typeType::DescriptorString));
return ASR::make_StringConstant_t(al, loc, s2c(al, value_str), res_type);
}
return ASR::make_Cast_t(al, loc, arg, ASR::cast_kindType::RealToString,
str_type, res_value);
str_type, nullptr);
} else if (ASRUtils::is_integer(*arg_type)) {
if (ASRUtils::expr_value(arg) != nullptr) {
int64_t number = ASR::down_cast<ASR::IntegerConstant_t>(
ASRUtils::expr_value(arg))->m_n;
std::string value_str = std::to_string(number);
ASR::ttype_t* res_type = ASRUtils::TYPE(ASR::make_Allocatable_t(al, loc,
ASRUtils::TYPE(ASR::make_String_t(al, loc, 1, nullptr,
ASR::string_length_kindType::DeferredLength,
ASR::string_physical_typeType::DescriptorString))));
res_value = ASR::down_cast<ASR::expr_t>(ASR::make_StringConstant_t(al,
loc, s2c(al, value_str), res_type));
ASR::ttype_t* res_type = ASRUtils::TYPE(ASR::make_String_t(al, loc, 1,
ASRUtils::EXPR(ASR::make_IntegerConstant_t(al, loc,
value_str.size(), ASRUtils::TYPE(ASR::make_Integer_t(al, loc, 4)))),
ASR::string_length_kindType::ExpressionLength,
ASR::string_physical_typeType::DescriptorString));
return ASR::make_StringConstant_t(al, loc, s2c(al, value_str), res_type);
}
return ASR::make_Cast_t(al, loc, arg, ASR::cast_kindType::IntegerToString,
str_type, res_value);
str_type, nullptr);
} else if (ASRUtils::is_logical(*arg_type)) {
if(ASRUtils::expr_value(arg) != nullptr) {
bool bool_number = ASR::down_cast<ASR::LogicalConstant_t>(
ASRUtils::expr_value(arg))->m_value;
std::string value_str = (bool_number)? "True" : "False";
ASR::ttype_t* res_type = ASRUtils::TYPE(ASR::make_Allocatable_t(al, loc,
ASRUtils::TYPE(ASR::make_String_t(al, loc, 1, nullptr,
ASR::string_length_kindType::DeferredLength,
ASR::string_physical_typeType::DescriptorString))));
res_value = ASR::down_cast<ASR::expr_t>(ASR::make_StringConstant_t(al,
loc, s2c(al, value_str), res_type));
ASR::ttype_t* res_type = ASRUtils::TYPE(ASR::make_String_t(al, loc, 1,
ASRUtils::EXPR(ASR::make_IntegerConstant_t(al, loc,
value_str.size(), ASRUtils::TYPE(ASR::make_Integer_t(al, loc, 4)))),
ASR::string_length_kindType::ExpressionLength,
ASR::string_physical_typeType::DescriptorString));
return ASR::make_StringConstant_t(al, loc, s2c(al, value_str), res_type);
}
return ASR::make_Cast_t(al, loc, arg, ASR::cast_kindType::LogicalToString,
str_type, res_value);
str_type, nullptr);

} else if (ASRUtils::is_character(*arg_type)) {
return (ASR::asr_t *)arg;
Expand Down
Loading
Loading