feat: enhance safe_pop error diagnostics with context#151
feat: enhance safe_pop error diagnostics with context#151Gitjay11 wants to merge 5 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
|
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
|
|
hi @xmnlab @yuvimittal , I’d appreciate your feedback whenever you’re available. Thanks |
|
@Gitjay11 , the CI seems to fail, could you please look into it! |
ffeb12f to
30c66b0
Compare
30c66b0 to
1749e49
Compare
|
hi @yuvimittal , All the checks have passed. you can review it now, Thankyou. |
OSL ChatGPT ReviewerNOTE: This is generated by an AI program, so some comments may not make sense. workflows/main.yamlChatGPT was not able to review the file. Error: Error code: 429 - {'error': {'message': 'You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}} src/irx/builders/llvmliteir.pyChatGPT was not able to review the file. Error: Error code: 429 - {'error': {'message': 'You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}} tests/test_llvmlite_helpers.pyChatGPT was not able to review the file. Error: Error code: 429 - {'error': {'message': 'You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}} |
|
@Gitjay11 , please dont make any changes in .yaml file |
| auto-update-conda: true | ||
| conda-solver: libmamba | ||
| python-version: "3.13" | ||
| python-version: "3.12" |
| from datetime import datetime | ||
| from datetime import time as _time | ||
| from typing import Any, Callable, Optional, cast | ||
| from typing import Any, Callable, Optional |
There was a problem hiding this comment.
i didnt understand why you removed cast!?
cast and safe_pop serve totally different purpose
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.