CONTRIBUTING: src-self-hosted -> src
parent
21c488ce68
commit
daf6c0da5b
|
@ -173,21 +173,21 @@ repo, we maintain a C API on top of Clang's C++ API:
|
||||||
Clang's C++ API changes. This one file necessarily does include Clang's C++ headers, which
|
Clang's C++ API changes. This one file necessarily does include Clang's C++ headers, which
|
||||||
makes it the slowest-to-compile source file in all of Zig's codebase.
|
makes it the slowest-to-compile source file in all of Zig's codebase.
|
||||||
|
|
||||||
* `src-self-hosted/clang.zig` - the Zig equivalent of `src/zig_clang.h`. This is a manually
|
* `src/clang.zig` - the Zig equivalent of `src/zig_clang.h`. This is a manually
|
||||||
maintained list of types and functions that are ABI-compatible with the Clang C API we
|
maintained list of types and functions that are ABI-compatible with the Clang C API we
|
||||||
maintain. In theory this could be generated by running translate-c on `src/zig_clang.h`,
|
maintain. In theory this could be generated by running translate-c on `src/zig_clang.h`,
|
||||||
but that would introduce a dependency cycle, since we are using this file to implement
|
but that would introduce a dependency cycle, since we are using this file to implement
|
||||||
translate-c.
|
translate-c.
|
||||||
|
|
||||||
Finally, the actual source code for the translate-c feature is
|
Finally, the actual source code for the translate-c feature is
|
||||||
`src-self-hosted/translate_c.zig`. This code uses the Clang C API exposed by
|
`src/translate_c.zig`. This code uses the Clang C API exposed by
|
||||||
`src-self-hosted/clang.zig`, and produces Zig AST.
|
`src/clang.zig`, and produces Zig AST.
|
||||||
|
|
||||||
The steps for contributing to translate-c look like this:
|
The steps for contributing to translate-c look like this:
|
||||||
|
|
||||||
1. Identify a test case you want to improve. Add it as a run-translated-c test
|
1. Identify a test case you want to improve. Add it as a run-translated-c test
|
||||||
case (usually preferable), or as a translate-c test case.
|
case (usually preferable), or as a translate-c test case.
|
||||||
|
|
||||||
2. Edit `src-self-hosted/translate_c.zig` to improve the behavior.
|
2. Edit `src/translate_c.zig` to improve the behavior.
|
||||||
|
|
||||||
3. Run the relevant tests: `./zig build test-run-translated-c test-translate-c`
|
3. Run the relevant tests: `./zig build test-run-translated-c test-translate-c`
|
||||||
|
|
Loading…
Reference in New Issue