fix: Improve logging controls and robust integer literal generation#280
Merged
Conversation
Zero/sentinel IntegerLiterals typed from an operand (_Bool, char8/16/32, or a
non-builtin) tripped StmtPrinter's llvm_unreachable("Unexpected type for integer
literal") during -print-tu. make_int_literal_printable remaps such literals to a
same-width standard integer; comparisons/assignments convert as usual.
…g-style) LOG() now checks a global MinLogLevel (default WARNING); --verbose lowers it to DEBUG. WARNING/ERROR/FATAL always emit. Removes the [INFO] spam from normal runs.
createDefaultArgument synthesized a zero typed param_type for any isIntegerType() param -- including _Bool/enum/char8_t, which crash StmtPrinter. Route through make_int_literal_printable. Completes the integer-literal unreachable fix.
Addresses PR #280 review: - #1: promote the printable-literal helper to Utils (CamelCase MakeIntLiteralPrintable) and route the switch case-value literals (integer/address switch in create_branchind and BuildSNodeFromRegion) through it, so a _Bool/char32_t discriminant can't trip StmtPrinter. Drops now-unused disc_width/case_width. - #2: guard the helper with isIntegralOrEnumerationType before getIntWidth (falls back to int for non-integer operand types). - #3: rename to CamelCase per clang-tidy.
Comment-only; no behavior change.
Collaborator
Author
Contributor
|
Claude finished @kumarak's task in 8m 3s —— View job PR Review — #280
No blocking issues found. Reviewed
|
The global default of WARNING suppressed INFO for every tool, but only patchir-decomp wires --verbose to re-enable it -- breaking patchir-transform's yaml-parser tests that grep for the INFO 'Successfully parsed' line (CI failure in PR #280). Default DEBUG restores historical behavior for tools that don't opt in; patchir-decomp still raises to WARNING (INFO off) unless --verbose.
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.
This pull request improves logging configuration and fixes several robustness issues related to integer literal generation in AST operations.
Key changes include: