[mypyc] Misc improvements to ll_builder helpers#20722
Merged
Conversation
These were extracted from a branch that adds vec type support to mypyc. I'm splitting the branch into multiple PRs to make reviewing easier.
p-sawicki
approved these changes
Feb 2, 2026
Comment on lines
+2949
to
+2954
| for_loop = builder.begin_for(start_ptr, end_ptr, int32_rprimitive.size) | ||
|
|
||
| # For loop body | ||
| builder.set_mem(for_loop.index, int32_rprimitive, Integer(0, int32_rprimitive)) | ||
|
|
||
| for_loop.finish() |
Collaborator
There was a problem hiding this comment.
i think it would be more convenient to change ForBuilder into a context manager.
Collaborator
Author
There was a problem hiding this comment.
I will look at this later after I've merged the whole mypyc vec support branch.
Collaborator
|
This PR seems to have broken the windows builds. building '2dc1e0389069ba707e56__mypyc' extension
creating build\temp.win-amd64-cpython-314\Release\build
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -ID:\a\mypy_mypyc-wheels\mypy_mypyc-wheels\mypy\mypyc\lib-rt -Ibuild -IC:\Users\runneradmin\AppData\Local\Temp\build-env-3i7vzaet\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\python.3.14.2\tools\include -IC:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\python.3.14.2\tools\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcbuild\__native_2dc1e0389069ba707e56.c /Fobuild\temp.win-amd64-cpython-314\Release\build\__native_2dc1e0389069ba707e56.obj /O2 /DEBUG:NONE /wd4102 /wd4101 /wd4146 /GL- /wd9025
cl : Command line warning D9025 : overriding '/GL' with '/GL-'
cl : Command line warning D9014 : invalid value '9025' for '/wd'; assuming '5999'
__native_2dc1e0389069ba707e56.c
D:\a\mypy_mypyc-wheels\mypy_mypyc-wheels\mypy\build\__native_2dc1e0389069ba707e56.h(11642): error C2059: syntax error: '__leave'
D:\a\mypy_mypyc-wheels\mypy_mypyc-wheels\mypy\build\__native_2dc1e0389069ba707e56.h(11643): error C2059: syntax error: '}'
error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.44.35207\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2https://github.com/mypyc/mypy_mypyc-wheels/actions |
JukkaL
added a commit
that referenced
this pull request
Feb 3, 2026
The `leave` attribute appears to cause a conflict with reserved C names in Windows. A better fix would be to fix name generation in mypyc, but this quick fix hopefully unblocks mypyc wheel builds. Context: #20722 (comment)
Collaborator
Author
|
Hopefully this fixes the wheel builds: #20730 |
JukkaL
added a commit
that referenced
this pull request
Feb 3, 2026
The `leave` attribute appears to cause a conflict with reserved C names in Windows. A better fix would be to fix name generation in mypyc, but this quick fix hopefully unblocks mypyc wheel builds. Context: #20722 (comment)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These were extracted from a branch that adds vec type support to mypyc. I'm splitting the branch into multiple PRs to make reviewing easier. Add some simple IR generation helpers, add more coercions between fixed-width integer types, and add a helper for generating IR for simple for loops.