-
Notifications
You must be signed in to change notification settings - Fork 32
Cc #435
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
Conversation
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.
Pull request overview
This PR adds support for goto statements, enhances preprocessor macro support, and improves CLI compatibility with standard C compilers.
- Implements goto statement handling in the linearizer with proper basic block termination and dead code handling
- Adds comprehensive predefined macros for stdint.h, stddef.h, and inttypes.h compatibility (type definitions, limits, format specifiers)
- Enables _has* feature detection macros in preprocessor conditional expressions
- Replaces non-standard
--dump-asmflag with standard-S -o -for assembly output
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| cc/token/preprocess.rs | Adds architecture-specific macro definitions during preprocessor initialization and implements __has_attribute/__has_builtin/__has_feature/__has_extension support in preprocessor conditional expressions |
| cc/tests/pcc/mod.rs | Adds three comprehensive tests for goto statement functionality (forward jump, backward jump/loop, and multiple labels) |
| cc/tests/features/debug.rs | Updates test commands from --dump-asm to -S -o - to align with standard compiler CLI conventions |
| cc/main.rs | Removes deprecated --dump-asm flag and implements -S -o - for assembly output to stdout |
| cc/linearize.rs | Implements proper goto statement handling by setting current_bb to None after branch emission to mark subsequent code as unreachable |
| cc/arch/x86_64/codegen.rs | Simplifies block label emission to always use block ID labels for consistency with IR jumps, removing special handling for C source labels |
| cc/arch/aarch64/codegen.rs | Applies the same block label simplification as x86_64 for consistency |
| cc/arch/mod.rs | Adds six new helper functions providing comprehensive predefined macros for stdint.h, stddef.h, and inttypes.h compatibility |
| cc/arch/lir.rs | Removes unused Directive::Raw variant that was previously used for custom label formatting |
| cc/TODO.md | Adds detailed implementation guides for future C11 features (complex numbers, alignment, thread-local storage) |
| cc/README.md | Updates documentation to reflect goto support and standardized CLI flags |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.