Add LLVM IR backend#3
Open
tienex wants to merge 1 commit into
Open
Conversation
This commit adds a new LLVM IR backend to the Portable C Compiler (PCC). The backend generates LLVM intermediate representation instead of native assembly code. Changes: - Created arch/llvm/ directory with all required backend files - Added macdefs.h with LLVM type definitions (64-bit target) - Implemented code.c for Pass 1 LLVM IR output generation - Implemented local.c with Pass 1 utility functions - Implemented local2.c for Pass 2 LLVM IR code generation - Added table.c with minimal instruction matching table - Implemented order.c for instruction ordering - Updated configure.ac to recognize 'llvm' as a target CPU The backend uses virtual registers and generates LLVM IR instructions through the zzzcode() mechanism. It supports basic operations including: - Arithmetic operations (add, sub, mul, div, mod) - Bitwise operations (and, or, xor) - Shift operations - Comparison operations - Floating point operations - Function calls To use: configure with --target=llvm-linux-gnu or similar 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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 commit adds a new LLVM IR backend to the Portable C Compiler (PCC). The backend generates LLVM intermediate representation instead of native assembly code.
Changes:
The backend uses virtual registers and generates LLVM IR instructions through the zzzcode() mechanism. It supports basic operations including:
To use: configure with --target=llvm-linux-gnu or similar
🤖 Generated with Claude Code