@@ -269,10 +269,16 @@ class ReplaceSymbolicVisitor : public PassUtils::PassVisitor<ReplaceSymbolicVisi
269
269
270
270
ASR::ttype_t * f_signature= xx.m_function_signature ;
271
271
ASR::FunctionType_t *f_type = ASR::down_cast<ASR::FunctionType_t>(f_signature);
272
- ASR::ttype_t *type1 = ASRUtils::TYPE (ASR::make_CPtr_t (al, xx.base .base .loc ));
272
+ ASR::ttype_t *CPtr_type = ASRUtils::TYPE (ASR::make_CPtr_t (al, xx.base .base .loc ));
273
273
for (size_t i = 0 ; i < f_type->n_arg_types ; ++i) {
274
274
if (f_type->m_arg_types [i]->type == ASR::ttypeType::SymbolicExpression) {
275
- f_type->m_arg_types [i] = type1;
275
+ f_type->m_arg_types [i] = CPtr_type;
276
+ } else if (f_type->m_arg_types [i]->type == ASR::ttypeType::List) {
277
+ ASR::List_t* list = ASR::down_cast<ASR::List_t>(f_type->m_arg_types [i]);
278
+ if (list->m_type ->type == ASR::ttypeType::SymbolicExpression){
279
+ ASR::ttype_t * list_type = ASRUtils::TYPE (ASR::make_List_t (al, xx.base .base .loc , CPtr_type));
280
+ f_type->m_arg_types [i] = list_type;
281
+ }
276
282
}
277
283
}
278
284
@@ -592,6 +598,17 @@ class ReplaceSymbolicVisitor : public PassUtils::PassVisitor<ReplaceSymbolicVisi
592
598
ASR::expr_t * function_call = process_attributes (xx.base .base .loc , xx.m_test );
593
599
xx.m_test = function_call;
594
600
}
601
+ } else if (ASR::is_a<ASR::LogicalNot_t>(*xx.m_test )) {
602
+ ASR::LogicalNot_t* logical_not = ASR::down_cast<ASR::LogicalNot_t>(xx.m_test );
603
+ if (ASR::is_a<ASR::IntrinsicScalarFunction_t>(*logical_not->m_arg )) {
604
+ ASR::IntrinsicScalarFunction_t* intrinsic_func = ASR::down_cast<ASR::IntrinsicScalarFunction_t>(logical_not->m_arg );
605
+ if (intrinsic_func->m_type ->type == ASR::ttypeType::Logical) {
606
+ ASR::expr_t * function_call = process_attributes (xx.base .base .loc , logical_not->m_arg );
607
+ ASR::expr_t * new_logical_not = ASRUtils::EXPR (ASR::make_LogicalNot_t (al, xx.base .base .loc , function_call,
608
+ logical_not->m_type , logical_not->m_value ));
609
+ xx.m_test = new_logical_not;
610
+ }
611
+ }
595
612
}
596
613
}
597
614
0 commit comments