-
-
Notifications
You must be signed in to change notification settings - Fork 215
DEV : Introduce and implement ArrayConstructor
#3579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ArrayConstructor
|
Thanks! This requires careful review, I'll try to do it later today. It looks good though from first look. |
certik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this is fine.
Do tests pass if in is_value_constant in asr_utils.h you change:
} case ASR::exprType::ArrayConstant: {
ASR::ArrayConstant_t* array_constant = ASR::down_cast<ASR::ArrayConstant_t>(a_value);
for( size_t i = 0; i < array_constant->n_args; i++ ) {
if( !ASRUtils::is_value_constant(array_constant->m_args[i]) &&
!ASRUtils::is_value_constant(ASRUtils::expr_value(array_constant->m_args[i])) ) {
return false;
}
}
return true;
}to:
} case ASR::exprType::ArrayConstant: {
return true;
}?
This is important for asr verify in this PR to ensure that things are truly constant now.
|
I’ll check this in a while. Thanks for reviewing. |
|
Everything works well locally, let's wait for CI tests. |
DEV : Introduce and implement `ArrayConstructor` Former-commit-id: 64b25fa
DEV : Introduce and implement `ArrayConstructor`
DEV : Introduce and implement `ArrayConstructor`
DEV : Introduce and implement `ArrayConstructor`
Towards #3566. This PR adds a new node
ArrayConstructor, adds asr verify check for ArrayConstant to only have*Constants, also checks thatArrayConstantcannot have anotherArrayConstant.Lot of lines can be removed from
*_ArrayConstant_*that I'll prefer to do in subsequent PRs.