-
Notifications
You must be signed in to change notification settings - Fork 156
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
Add list
comparison
#2025
Add list
comparison
#2025
Conversation
src/libasr/codegen/llvm_utils.cpp
Outdated
{ | ||
llvm::Value* i = LLVM::CreateLoad(*builder, idx); | ||
// llvm::Value* t1i = llvm_utils->tuple_api->read_item(t1, i, LLVM::is_llvm_struct( | ||
// tuple_type->m_type[i])); |
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.
How do we index tuple_type->m_type
with run time value i
?
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.
We can't. :-). Tuples should only be indexed with fixed indices available at compile time so that type of the indexed item can be figured out at compile time itself. Its the pattern as C++ std::tuple
.
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.
Some abstract APIs to reduce code duplication - https://llvm.org/doxygen/classllvm_1_1IRBuilderBase.html#a843d43d070f0b1c6a133403edce488ef.
WIP.Fixes #1832.
This PR implements only less than operation.