From 4fce428b487b29e04395fad35f3101a5633badf1 Mon Sep 17 00:00:00 2001 From: anutosh491 Date: Tue, 17 Oct 2023 13:08:56 +0530 Subject: [PATCH] Implemented visit_If for supporting func attribute --- src/libasr/pass/replace_symbolic.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/libasr/pass/replace_symbolic.cpp b/src/libasr/pass/replace_symbolic.cpp index 45ddbffd59..f8059f50b1 100644 --- a/src/libasr/pass/replace_symbolic.cpp +++ b/src/libasr/pass/replace_symbolic.cpp @@ -1091,6 +1091,20 @@ class ReplaceSymbolicVisitor : public PassUtils::PassVisitor(x); + transform_stmts(xx.m_body, xx.n_body); + transform_stmts(xx.m_orelse, xx.n_orelse); + SymbolTable* module_scope = current_scope->parent; + if (ASR::is_a(*xx.m_test)) { + ASR::IntrinsicScalarFunction_t* intrinsic_func = ASR::down_cast(xx.m_test); + if (intrinsic_func->m_type->type == ASR::ttypeType::Logical) { + ASR::expr_t* function_call = process_attributes(al, xx.base.base.loc, xx.m_test, module_scope); + xx.m_test = function_call; + } + } + } + void visit_SubroutineCall(const ASR::SubroutineCall_t &x) { SymbolTable* module_scope = current_scope->parent; Vec call_args;