-
Notifications
You must be signed in to change notification settings - Fork 13
feat: enhance safe_pop error diagnostics with context #151
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
base: main
Are you sure you want to change the base?
Conversation
OSL ChatGPT ReviewerNOTE: This is generated by an AI program, so some comments may not make sense. src/irx/builders/llvmliteir.py
|
OSL ChatGPT ReviewerNOTE: This is generated by an AI program, so some comments may not make sense. src/irx/builders/llvmliteir.py
|
OSL ChatGPT ReviewerNOTE: This is generated by an AI program, so some comments may not make sense. src/irx/builders/llvmliteir.py
|
iihimanshuu
left a comment
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.
Looks good to me!
OSL ChatGPT ReviewerNOTE: This is generated by an AI program, so some comments may not make sense. src/irx/builders/llvmliteir.py
|
fixes: #145
This PR enhances the safe_pop() utility in llvmliteir.py to provide better error diagnostics during the LLVM IR generation process. Previously, safe_pop() would silently return None on an empty stack, which made it difficult to trace which AST visitor failed to push a required value. This change implements "Fail Fast" behavior by allowing an optional context string that triggers a descriptive IndexError upon stack underflow.
Key Changes:
This PR is a:
Additional information:
By making this change, developers will see exactly which AST node failed to produce a result on the stack, cutting down debugging time significantly for visitor implementation bugs.