feat:Generalize LiteralList lowering to support float, string and mixed-type lists#185
feat:Generalize LiteralList lowering to support float, string and mixed-type lists#185yogendra-17 wants to merge 2 commits intoarxlang:mainfrom
Conversation
OSL ChatGPT ReviewerNOTE: This is generated by an AI program, so some comments may not make sense. src/irx/builders/llvmliteir.py
tests/test_literal_list.py
|
OSL ChatGPT ReviewerNOTE: This is generated by an AI program, so some comments may not make sense. src/irx/builders/llvmliteir.py
tests/test_literal_list.py
|
c87d4ab to
87b6e11
Compare
OSL ChatGPT ReviewerNOTE: This is generated by an AI program, so some comments may not make sense. src/irx/builders/llvmliteir.py
tests/test_literal_list.py
|
87b6e11 to
65ceece
Compare
Notes
you work. When you’re ready for a review, change the status to Ready for
review to trigger a new review round. If you make additional changes and
don’t want to trigger the bot, switch the PR back to Draft.
share your feedback; it helps us improve the tool.
as possible to increase the chances of a timely review. Large PRs may not be
reviewed and may be closed.
self-documenting
(guidance).
our Discord to discuss ideas, blockers, or issues
(https://discord.gg/Nu4MdGj9jB).
sensitive data/PII in code, configs, logs, screenshots, or commit history. If
something leaks, rotate the credentials immediately, invalidate the old key,
and note it in the PR so maintainers can assist.
needed for tests, prefer small fixtures or programmatic downloads declared in
makim.yaml (e.g., a task that fetches data at test time). If a large binary is
unavoidable, discuss first and consider Git LFS.
Pull Request description
This PR enhances LiteralList lowering by removing the restriction that only homogeneous integer constant lists are supported. Previously, the visitor raised TypeError for valid constructs such as float lists ([1.0, 2.0]) and string lists (["a", "b"]). The implementation has been generalized to infer a common element type, perform necessary type coercions (including integer widening and int-to-float promotion), and correctly handle both constant and runtime-valued elements. Constant lists continue to use the efficient constant-array path, while non-constant lists are lowered using alloca and store, ensuring consistent and type-safe LLVM IR generation.
How to test these changes
...Pull Request checklists
This PR is a:
About this PR:
Author's checklist:
complexity.
Additional information
Reviewer's checklist
Copy and paste this template for your review's note: