Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aaf4180

Browse files
committed
Added visit_WhileLoop
1 parent 46161fc commit aaf4180

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/libasr/pass/replace_symbolic.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,18 @@ class ReplaceSymbolicVisitor : public PassUtils::PassVisitor<ReplaceSymbolicVisi
976976
}
977977
}
978978

979+
void visit_WhileLoop(const ASR::WhileLoop_t &x) {
980+
ASR::WhileLoop_t &xx = const_cast<ASR::WhileLoop_t&>(x);
981+
transform_stmts(xx.m_body, xx.n_body);
982+
if (ASR::is_a<ASR::IntrinsicScalarFunction_t>(*xx.m_test)) {
983+
ASR::IntrinsicScalarFunction_t* intrinsic_func = ASR::down_cast<ASR::IntrinsicScalarFunction_t>(xx.m_test);
984+
if (intrinsic_func->m_type->type == ASR::ttypeType::Logical) {
985+
ASR::expr_t* function_call = process_attributes(xx.base.base.loc, xx.m_test);
986+
xx.m_test = function_call;
987+
}
988+
}
989+
}
990+
979991
void visit_Return(const ASR::Return_t &x) {
980992
if (!symbolic_vars_to_free.empty()){
981993
for (ASR::symbol_t* symbol : symbolic_vars_to_free) {

0 commit comments

Comments
 (0)