Skip to content

Commit c1d8cfb

Browse files
committed
Merge branch 'master' into generated_name_override
2 parents 5209ebd + 576fd8d commit c1d8cfb

File tree

1,224 files changed

+2039
-583
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,224 files changed

+2039
-583
lines changed

.github/workflows/bindgen.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868

6969
# TODO: Actually run quickchecks once `bindgen` is reliable enough.
7070
- name: Build quickcheck tests
71-
run: cd tests/quickchecking && cargo test
71+
run: cd bindgen-tests/tests/quickchecking && cargo test
7272

7373
test-expectations:
7474
runs-on: ${{matrix.os}}
@@ -88,7 +88,7 @@ jobs:
8888
override: true
8989

9090
- name: Test expectations
91-
run: cd tests/expectations && cargo test
91+
run: cd bindgen-tests/tests/expectations && cargo test
9292

9393
test:
9494
runs-on: ${{matrix.os}}

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
target/
33
*~
44
bindgen-integration/Cargo.lock
5-
tests/expectations/Cargo.lock
5+
bindgen-tests/tests/expectations/Cargo.lock
6+
bindgen-tests/tests/quickchecking/Cargo.lock
67
#*#
78

89
# Test script output

CONTRIBUTING.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,19 @@ parameters a given type uses. The analyses are defined in
318318

319319
The final phase is generating Rust source text from the analyzed IR, and it is
320320
defined in `src/codegen/*`. We use the `quote` crate, which provides the `quote!
321-
{ ... }` macro for quasi-quoting Rust forms.
321+
{ ... }` macro for quasi-quoting Rust forms. Some options that affect the
322+
generated Rust code are implemented using the [`syn`](https://docs.rs/syn) crate.
323+
324+
### Implementing new options using `syn`
325+
326+
If a new option can be implemented using the `syn` crate it should be added to
327+
the `codegen::postprocessing` module by following these steps:
328+
329+
- Introduce a new field to `BindgenOptions` for the option.
330+
- Write a free function inside `codegen::postprocessing` implementing the
331+
option. This function with the same name of the `BindgenOptions` field.
332+
- Add a new value to the `codegen::postprocessing::PASSES` for the option using
333+
the `pass!` macro.
322334

323335
## Pull Requests and Code Reviews
324336

0 commit comments

Comments
 (0)