-
Notifications
You must be signed in to change notification settings - Fork 163
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
Dftatom: Changes from lfortran LibASR #2334
Conversation
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)); |
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.
Does "data only array" in this context mean "FixedSizeArray" inside a struct?
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.
Yes.
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.
Ok. I would maybe document this in a comment, or maybe name the variable fixed_array_inside_struct
, or something like that.
@@ -698,8 +698,7 @@ static inline ASR::symbol_t *get_asr_owner(const ASR::expr_t *expr) { | |||
return ASRUtils::get_asr_owner(ASR::down_cast<ASR::FunctionCall_t>(expr)->m_name); | |||
} | |||
default: { | |||
throw LCompilersException("Cannot find the ASR owner of underlying symbol of expression " | |||
+ std::to_string(expr->type)); | |||
return nullptr; |
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.
Note: this changes the API, now it will return nullptr
if the node does not have an ASR owner.
related lfortran/lfortran#2488