Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Each contains:
When adding a new feature to llcppg, follow this workflow to verify your changes:

1. **Create a test case** in `cl/internal/convert/_testdata/` with:
- A `conf/` directory containing `llcppg.cfg` and `llcppg.symb.json`
- A `conf/` directory containing `llcppg.cfg` and `llcppg.sym.json`
- An `hfile/` directory with your test header files
- Configuration that exercises your new feature

Expand All @@ -163,7 +163,7 @@ When adding a new feature to llcppg, follow this workflow to verify your changes
cl/internal/convert/_testdata/yourfeature/
├── conf/
│ ├── llcppg.cfg
│ └── llcppg.symb.json
│ └── llcppg.sym.json
├── hfile/
│ └── test.h
└── gogensig.expect (generated with gen:true)
Expand Down
2 changes: 1 addition & 1 deletion _cmptest/llcppgend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func testFrom(t *testing.T, tc testCase, isStatic bool, gen bool) {
t.Fatal(err)
}

// llcppg.symb.json is a middle file
// llcppg.sym.json is a middle file
os.Remove(filepath.Join(resultDir, config.LLCPPG_SYMB))
copyFile(cfgPath, filepath.Join(resultDir, tc.pkg.Name, config.LLCPPG_CFG))

Expand Down
2 changes: 1 addition & 1 deletion cl/internal/convert/funcname.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

// GoFuncSpec parses and stores components of a Go function name
// Input examples from llcppg.symb.json's "go" field:
// Input examples from llcppg.sym.json's "go" field:
// 1. Simple function: "AddPatchToArray"
// 2. Method with pointer receiver: "(*Sqlite3Stmt).Sqlite3BindParameterIndex"
// 3. Method with value receiver: "CJSONBool.CJSONCreateBool"
Expand Down
2 changes: 1 addition & 1 deletion cmd/llcppg/llcppg.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func main() {
flag.BoolVar(&vSigfetch, "vfetch", false, "Enable verbose of llcppsigfetch")
flag.BoolVar(&vSymg, "vsymg", false, "Enable verbose of llcppsymg")
flag.BoolVar(&vGogen, "vgogen", false, "Enable verbose of gogensig")
flag.BoolVar(&symbGen, "symbgen", false, "Only use llcppsymg to generate llcppg.symb.json")
flag.BoolVar(&symbGen, "symbgen", false, "Only use llcppsymg to generate llcppg.sym.json")
flag.BoolVar(&codeGen, "codegen", false, "Only use (llcppsigfetch & gogensig) to generate go code binding")
flag.BoolVar(&help, "h", false, "Display help information")
flag.BoolVar(&help, "help", false, "Display help information")
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

const LLCPPG_CFG = "llcppg.cfg"
const LLCPPG_SYMB = "llcppg.symb.json"
const LLCPPG_SYMB = "llcppg.sym.json"
const LLCPPG_SIGFETCH = "llcppg.sigfetch.json"
const LLCPPG_PUB = "llcppg.pub"

Expand Down
2 changes: 1 addition & 1 deletion config/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func ConfigFromReader(reader io.Reader) (Config, error) {
return config, nil
}

// llcppg.symb.json
// llcppg.sym.json
func GetSymTableFromFile(symFile string) (symTable *SymTable, err error) {
bytes, err := os.ReadFile(symFile)
if err != nil {
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions doc/en/dev/llcppg.md
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ llcppsymg is the symbol table generator in the llcppg toolchain, responsible for

1. Parse library symbols: Extract exported symbols from libraries using the nm tool
2. Parse header file declarations: Analyze C/C++ header files using libclang for function declarations
3. Find intersection: Match library symbols with header declarations and then generate symbol table named `llcppg.symb.json`.
3. Find intersection: Match library symbols with header declarations and then generate symbol table named `llcppg.sym.json`.

#### Static Library Support

Expand Down Expand Up @@ -888,7 +888,7 @@ For example, to convert `(*CJSON).PrintUnformatted` from a method to a function,
}
}
```
and the `llcppg.symb.json` will be:
and the `llcppg.sym.json` will be:
```json
[
{
Expand Down Expand Up @@ -949,7 +949,7 @@ gogensig - # read pkg-info-file from stdin
```

#### Function Generation
During execution, gogensig only generates functions whose corresponding mangle exists in `llcppg.symb.json`, determining whether to generate functions/methods with specified Go names by parsing the go field corresponding to the mangle.
During execution, gogensig only generates functions whose corresponding mangle exists in `llcppg.sym.json`, determining whether to generate functions/methods with specified Go names by parsing the go field corresponding to the mangle.

1. Regular function format: "FunctionName"
* Generates regular functions, using `//go:linkname` annotation
Expand Down
Loading