Skip to content

Fix tuple arguments type in function #1349

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

Merged
merged 3 commits into from
Dec 4, 2022
Merged

Conversation

Smit-create
Copy link
Collaborator

Fixes #1348

@@ -2984,7 +2984,8 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
ASR::storage_typeType local_m_storage = ASR::storage_typeType::Default;
llvm_el_types.push_back(get_arg_type_from_ttype_t(asr_tuple->m_type[i], m_abi,
arg_m_abi, local_m_storage, arg_m_value_attr, local_n_dims,
local_a_kind, is_local_array_type, ASRUtils::intent_local));
local_a_kind, is_local_array_type,
ASRUtils::intent_local)->getPointerElementType());
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can't use getPointerElementType (not allowed from LLVM 15 onwards). So please figure out a different way to achieve the same goal that you are trying to by using this API.

arg_m_abi, local_m_storage, arg_m_value_attr, local_n_dims,
local_a_kind, is_local_array_type,
ASRUtils::intent_local)->getPointerElementType());
llvm_el_types.push_back(get_type_from_ttype_t(asr_tuple->m_type[i],
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can use get_type_from_ttype_t_util as well. It won't require you to declare auxiliary argument variables.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! Updated

@certik
Copy link
Contributor

certik commented Dec 4, 2022

What is the status of this? @czgdp1807 can you please review?

@czgdp1807
Copy link
Collaborator

Already reviewed. See #1349 (comment). Waiting for @Smit-create to update.

Copy link
Contributor

@certik certik left a comment

Choose a reason for hiding this comment

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

Looks great, a simple change.

@certik certik merged commit db69dd6 into lcompilers:main Dec 4, 2022
@Smit-create Smit-create deleted the i-1348 branch December 4, 2022 19:57
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.

BUG: [LLVM backend] Tuple as function args
3 participants