Skip to content

Revert "ASR: Support chained CompareOp" #2229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 2023
Merged
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
2 changes: 0 additions & 2 deletions integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@ RUN(NAME expr_18 FAIL LABELS cpython llvm c)
RUN(NAME expr_19 LABELS cpython llvm c)
RUN(NAME expr_20 LABELS cpython llvm c)
RUN(NAME expr_21 LABELS cpython llvm c)
RUN(NAME expr_22 LABELS cpython llvm c)

RUN(NAME expr_01u LABELS cpython llvm c NOFAST)
RUN(NAME expr_02u LABELS cpython llvm c NOFAST)
Expand Down Expand Up @@ -672,7 +671,6 @@ RUN(NAME structs_31 LABELS cpython llvm c)
RUN(NAME structs_32 LABELS cpython llvm c)
RUN(NAME structs_33 LABELS cpython llvm c)
RUN(NAME structs_34 LABELS cpython llvm c)
RUN(NAME structs_35 LABELS cpython llvm c)

RUN(NAME symbolics_01 LABELS cpython_sym c_sym)
RUN(NAME symbolics_02 LABELS cpython_sym c_sym)
Expand Down
22 changes: 0 additions & 22 deletions integration_tests/expr_22.py

This file was deleted.

32 changes: 0 additions & 32 deletions integration_tests/structs_35.py

This file was deleted.

11 changes: 2 additions & 9 deletions src/libasr/codegen/asr_to_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,6 @@ class ASRToCVisitor : public BaseCCPPVisitor<ASRToCVisitor>
std::string unit_src = "";
indentation_level = 0;
indentation_spaces = 4;
SymbolTable* current_scope_copy = current_scope;
current_scope = global_scope;
c_ds_api->set_indentation(indentation_level, indentation_spaces);
c_ds_api->set_global_scope(global_scope);
c_utils_functions->set_indentation(indentation_level, indentation_spaces);
Expand Down Expand Up @@ -762,7 +760,6 @@ R"(
out_file.close();
}
}
current_scope = current_scope_copy;
}

void visit_Module(const ASR::Module_t &x) {
Expand All @@ -771,8 +768,7 @@ R"(
} else {
intrinsic_module = false;
}
SymbolTable *current_scope_copy = current_scope;
current_scope = x.m_symtab;

std::string unit_src = "";
for (auto &item : x.m_symtab->get_scope()) {
if (ASR::is_a<ASR::Variable_t>(*item.second)) {
Expand Down Expand Up @@ -817,15 +813,13 @@ R"(
}
src = unit_src;
intrinsic_module = false;
current_scope = current_scope_copy;
}

void visit_Program(const ASR::Program_t &x) {
// Topologically sort all program functions
// and then define them in the right order
std::vector<std::string> func_order = ASRUtils::determine_function_definition_order(x.m_symtab);
SymbolTable *current_scope_copy = current_scope;
current_scope = x.m_symtab;

// Generate code for nested subroutines and functions first:
std::string contains;
for (auto &item : func_order) {
Expand Down Expand Up @@ -904,7 +898,6 @@ R"( // Initialise Numpy
+ decl + body
+ indent1 + "return 0;\n}\n";
indentation_level -= 2;
current_scope = current_scope_copy;
}

template <typename T>
Expand Down
3 changes: 0 additions & 3 deletions src/libasr/codegen/asr_to_c_cpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ class BaseCCPPVisitor : public ASR::BaseVisitor<Struct>

void visit_TranslationUnit(const ASR::TranslationUnit_t &x) {
global_scope = x.m_global_scope;
SymbolTable* current_scope_copy = current_scope;
current_scope = global_scope;
// All loose statements must be converted to a function, so the items
// must be empty:
LCOMPILERS_ASSERT(x.n_items == 0);
Expand Down Expand Up @@ -257,7 +255,6 @@ R"(#include <stdio.h>
}

src = unit_src;
current_scope = current_scope_copy;
}

std::string check_tmp_buffer() {
Expand Down
Loading