LLVM backend: Compute size_t instead of hardcoded 64-bit
Open
Nobody has claimed this yet.
P-low
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
The LLVM backend (https://github.com/leanprover/lean4/pull/1837) currently assumes that size_t is 64bit. I believe the correct way to do this is to:
- Create a notion of target architecture in Lean (to support cross compilation)
- Load the information about the target architecture, using LLVMCreateTargetData
- Use LLVMPointerSize to get the number of bytes. We should then use the corresponding
i(<number_of_bytes>*8)type instead of assumingi64everywhere.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the LLVM backend and linked pull request #1837 first. The work is complete when target architecture information can be represented and loaded through LLVMCreateTargetData, LLVMPointerSize determines the pointer width, and hardcoded i64 assumptions are replaced with the corresponding integer type.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100