Skip to content

Commit 0336f84

Browse files
committed
update dependencies
1 parent 6e870f5 commit 0336f84

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/libasr/pass/class_constructor.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class ReplaceStructTypeConstructor: public ASR::BaseExprReplacer<ReplaceStructTy
2323
Vec<ASR::stmt_t*>& pass_result;
2424
bool& remove_original_statement;
2525
bool& inside_symtab;
26-
bool& apply_again;
2726
std::map<SymbolTable*, Vec<ASR::stmt_t*>>& symtab2decls;
2827

2928
public:
@@ -32,13 +31,12 @@ class ReplaceStructTypeConstructor: public ASR::BaseExprReplacer<ReplaceStructTy
3231
ASR::expr_t* result_var;
3332

3433
ReplaceStructTypeConstructor(Allocator& al_, Vec<ASR::stmt_t*>& pass_result_,
35-
bool& remove_original_statement_, bool& inside_symtab_, bool& apply_again_,
34+
bool& remove_original_statement_, bool& inside_symtab_,
3635
std::map<SymbolTable*, Vec<ASR::stmt_t*>>& symtab2decls_) :
3736
al(al_), pass_result(pass_result_),
3837
remove_original_statement(remove_original_statement_),
39-
inside_symtab(inside_symtab_), apply_again(apply_again_),
40-
symtab2decls(symtab2decls_), current_scope(nullptr),
41-
result_var(nullptr) {}
38+
inside_symtab(inside_symtab_), symtab2decls(symtab2decls_),
39+
current_scope(nullptr), result_var(nullptr) {}
4240

4341
void replace_StructTypeConstructor(ASR::StructTypeConstructor_t* x) {
4442
if( x->n_args == 0 ) {
@@ -133,7 +131,6 @@ class StructTypeConstructorVisitor : public ASR::CallReplacerOnExpressionsVisito
133131
Allocator& al;
134132
bool remove_original_statement;
135133
bool inside_symtab;
136-
bool apply_again;
137134
ReplaceStructTypeConstructor replacer;
138135
Vec<ASR::stmt_t*> pass_result;
139136
std::map<SymbolTable*, Vec<ASR::stmt_t*>> symtab2decls;
@@ -142,10 +139,9 @@ class StructTypeConstructorVisitor : public ASR::CallReplacerOnExpressionsVisito
142139

143140
StructTypeConstructorVisitor(Allocator& al_) :
144141
al(al_), remove_original_statement(false),
145-
inside_symtab(true), apply_again(false),
146-
replacer(al_, pass_result,
142+
inside_symtab(true), replacer(al_, pass_result,
147143
remove_original_statement, inside_symtab,
148-
apply_again, symtab2decls) {
144+
symtab2decls) {
149145
pass_result.n = 0;
150146
pass_result.reserve(al, 0);
151147
}
@@ -173,7 +169,6 @@ class StructTypeConstructorVisitor : public ASR::CallReplacerOnExpressionsVisito
173169
for (size_t i = 0; i < n_body; i++) {
174170
pass_result.n = 0;
175171
pass_result.reserve(al, 1);
176-
apply_again = false;
177172
remove_original_statement = false;
178173
replacer.result_var = nullptr;
179174
visit_stmt(*m_body[i]);
@@ -225,6 +220,8 @@ void pass_replace_class_constructor(Allocator &al,
225220
const LCompilers::PassOptions& /*pass_options*/) {
226221
StructTypeConstructorVisitor v(al);
227222
v.visit_TranslationUnit(unit);
223+
PassUtils::UpdateDependenciesVisitor w(al);
224+
w.visit_TranslationUnit(unit);
228225
}
229226

230227

0 commit comments

Comments
 (0)