Skip to content

Conversation

@ubaidsk
Copy link
Collaborator

@ubaidsk ubaidsk commented Sep 22, 2023

ASR::dimension_t* m_dims;
int n_dims = ASRUtils::extract_dimensions_from_ttype(x_mv_type, m_dims);
bool is_data_only_array = ASRUtils::is_fixed_size_array(m_dims, n_dims) && ASRUtils::get_asr_owner(arr_expr) &&
ASR::is_a<ASR::StructType_t>(*ASRUtils::get_asr_owner(arr_expr));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does "data only array" in this context mean "FixedSizeArray" inside a struct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I would maybe document this in a comment, or maybe name the variable fixed_array_inside_struct, or something like that.

default: {
throw LCompilersException("Cannot find the ASR owner of underlying symbol of expression "
+ std::to_string(expr->type));
return nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this changes the API, now it will return nullptr if the node does not have an ASR owner.

@certik certik merged commit 2293972 into lcompilers:main Sep 22, 2023
@ubaidsk ubaidsk deleted the changes_from_lf branch September 23, 2023 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants