This document provides essential information for AI assistants to help fix bugs and implement features in the LLGo project.
## About LLGo
LLGo is a Go compiler based on LLVM designed to better integrate Go with the C ecosystem, including Python and JavaScript. It's a subproject of the XGo project that aims to expand the boundaries of Go/XGo for game development, AI and data science, WebAssembly, and embedded development.
## Project Structure
-`cmd/llgo` - Main llgo compiler command (usage similar to `go` command)
-`cl/` - Core compiler logic that converts Go packages to LLVM IR
-`ssa/` - LLVM IR file generation using Go SSA semantics
-`internal/build/` - Build process orchestration
-`runtime/` - LLGo runtime library
-`chore/` - Development tools (llgen, llpyg, ssadump, etc.)
For detailed dependency requirements and installation instructions, see the [Dependencies](README.md#dependencies) and [How to install](README.md#how-to-install) sections in the README.
### Update out.ll files after modifying compiler IR generation
**CRITICAL:** When you modify the compiler's IR generation logic (especially in `ssa/` or `cl/` packages), you MUST update all out.ll test files under the `cl/` directory.
#### Understanding out.ll files
The `out.ll` files under the `cl/` directory are comparison IR files that serve as reference outputs for the test suite:
- They are generated by `llgen` from the corresponding `in.go` files in the same directory
- They reflect the current compiler's LLVM IR representation of the Go source code
- They are used by tests to verify that the compiler generates correct and consistent IR output
#### Required steps after modifying IR generation logic
**Note:** Currently reports some issues related to lock passing by value in `ssa/type_cvt.go` and a possible unsafe.Pointer misuse in `cl/builtin_test.go`. These are known issues.