Skip to content

Commit 0580c44

Browse files
authored
Merge pull request #2229 from lcompilers/revert-2213-i-2131
Revert "ASR: Support chained CompareOp"
2 parents 1bc5ad6 + f93f213 commit 0580c44

File tree

6 files changed

+72
-179
lines changed

6 files changed

+72
-179
lines changed

integration_tests/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,6 @@ RUN(NAME expr_18 FAIL LABELS cpython llvm c)
472472
RUN(NAME expr_19 LABELS cpython llvm c)
473473
RUN(NAME expr_20 LABELS cpython llvm c)
474474
RUN(NAME expr_21 LABELS cpython llvm c)
475-
RUN(NAME expr_22 LABELS cpython llvm c)
476475

477476
RUN(NAME expr_01u LABELS cpython llvm c NOFAST)
478477
RUN(NAME expr_02u LABELS cpython llvm c NOFAST)
@@ -672,7 +671,6 @@ RUN(NAME structs_31 LABELS cpython llvm c)
672671
RUN(NAME structs_32 LABELS cpython llvm c)
673672
RUN(NAME structs_33 LABELS cpython llvm c)
674673
RUN(NAME structs_34 LABELS cpython llvm c)
675-
RUN(NAME structs_35 LABELS cpython llvm c)
676674

677675
RUN(NAME symbolics_01 LABELS cpython_sym c_sym)
678676
RUN(NAME symbolics_02 LABELS cpython_sym c_sym)

integration_tests/expr_22.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

integration_tests/structs_35.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/libasr/codegen/asr_to_c.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,6 @@ class ASRToCVisitor : public BaseCCPPVisitor<ASRToCVisitor>
583583
std::string unit_src = "";
584584
indentation_level = 0;
585585
indentation_spaces = 4;
586-
SymbolTable* current_scope_copy = current_scope;
587-
current_scope = global_scope;
588586
c_ds_api->set_indentation(indentation_level, indentation_spaces);
589587
c_ds_api->set_global_scope(global_scope);
590588
c_utils_functions->set_indentation(indentation_level, indentation_spaces);
@@ -762,7 +760,6 @@ R"(
762760
out_file.close();
763761
}
764762
}
765-
current_scope = current_scope_copy;
766763
}
767764

768765
void visit_Module(const ASR::Module_t &x) {
@@ -771,8 +768,7 @@ R"(
771768
} else {
772769
intrinsic_module = false;
773770
}
774-
SymbolTable *current_scope_copy = current_scope;
775-
current_scope = x.m_symtab;
771+
776772
std::string unit_src = "";
777773
for (auto &item : x.m_symtab->get_scope()) {
778774
if (ASR::is_a<ASR::Variable_t>(*item.second)) {
@@ -817,15 +813,13 @@ R"(
817813
}
818814
src = unit_src;
819815
intrinsic_module = false;
820-
current_scope = current_scope_copy;
821816
}
822817

823818
void visit_Program(const ASR::Program_t &x) {
824819
// Topologically sort all program functions
825820
// and then define them in the right order
826821
std::vector<std::string> func_order = ASRUtils::determine_function_definition_order(x.m_symtab);
827-
SymbolTable *current_scope_copy = current_scope;
828-
current_scope = x.m_symtab;
822+
829823
// Generate code for nested subroutines and functions first:
830824
std::string contains;
831825
for (auto &item : func_order) {
@@ -904,7 +898,6 @@ R"( // Initialise Numpy
904898
+ decl + body
905899
+ indent1 + "return 0;\n}\n";
906900
indentation_level -= 2;
907-
current_scope = current_scope_copy;
908901
}
909902

910903
template <typename T>

src/libasr/codegen/asr_to_c_cpp.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,6 @@ class BaseCCPPVisitor : public ASR::BaseVisitor<Struct>
193193

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

259257
src = unit_src;
260-
current_scope = current_scope_copy;
261258
}
262259

263260
std::string check_tmp_buffer() {

0 commit comments

Comments
 (0)