Commit b648f56
authored
postprocess: add
As a general-purpose solution to bypassing functions the postprocessor's
comment transferer (and future transforms, too) can't handle yet, this
adds an exclude list to skip functions in files. There is also
`--ident-filter`, which is a single regex just based on the function
name, but this is more specific and also takes into account the file
name. The file passed to `--exclude-file` is a YAML file containing file
paths (relative to the exclude file's directory) and the function names
within them to skip. This gets us around issues like
conditionally-compiled comments (#1534), the first function in a file
also including license comments and `#include`s, and anything else. I've
run this on `json-c` so far
```sh
(cd c2rust-postprocess/ && uv run postprocess $OLDPWD/tests/integration/tests/json-c/repo/lib.rs --no-update-rust --exclude-file $OLDPWD/tests/integration/tests/json-c/postprocess-exclude.yml)
```
and checked-in the LLM cache for it, but setting up the testing
infrastructure to run this automatically is still a WIP (should be the
next PR). Funnily enough, the LLM cache is going to end up behaving
similarly to snapshot tests once it's up and running.--exclude-file for skipping functions (#1541)File tree
137 files changed
+19370
-24
lines changed- c2rust-postprocess
- postprocess
- definitions
- tests
- examples
- llm-cache/CommentTransfer
- _json_c_set_last_err/9adf00d95ad0a6f053bb53b6cd6f44351e53f231893f4c9666ed52cf00d9921a
- _json_c_strerror/db3df7212135267a5fdd039ed23be7a9089869ded9a76de3d419e009d5ef2b68
- _json_c_visit/74372ced09d061616fb9dfc91f6f63ab6388eb2f6a682fee1630f82ee6936a07
- _json_object_to_fd/89aa8f3971f321ba3d023a079202addbf47d1407724098a6a858817fd0eede3c
- array_list_expand_internal/19cfb0e46106329dcaf89e1684e09003437a1b0f9831a6963416b8e2a8bd7e1a
- array_list_new/e4607d0b796959c68aac2c6628d52ae9c16395d12b8bbcf3d0d6d176ab0676fd
- get_dev_random_seed/654ec79873ddbc326edd81c2326c91604c0726d80117e2d18e8f48e3ae5a61f5
- get_string_component/9592c8b2b2337ee6f62ac2a0bad260642e3cb9d60d152f9bbd05c6772c9fdcde
- get_time_seed/ea11518781abc4114dc38aa814130890a5a3f00e5a865bbe87efb3a286e3047d
- hashlittle/728ec9128b7430fb67e15e80035b6c315ccff97949bebc1e27b02781802ac8a5
- is_valid_index/7fafa4d7603d6eefe4eabca9fab4b7ba1d5944061e5163bf487812b5e79bf9a2
- json_c_get_random_seed/50d2206e5d32ad72c929136c183151613702b1dca18376eb327ab161e358ab77
- json_c_shallow_copy_default/932d42cc819c306fb465684b9cb71994e1ba9d8f715bd34cf9611e310466be19
- json_c_version/045ae7a398c6a903d2c3940a0cb7dfe356dd6f57bca31ac1270a9dabbb8eb117
- json_escape_str/0a96667bfec58caa92dc7c5db32b373c7d643e9247bdf5f4bad78437c662b4a1
- json_object_all_values_equal/b846748e31784336ef09c25f5076d8499add2d65227a0cf9d828b770054203e7
- json_object_array_to_json_string/1f85b0363eb0fcba123430f9b2bab1f79339c7bc0f69bdb7cb50d77a2fe94372
- json_object_boolean_to_json_string/af52e24fd3a0407b548d38f8da2ca772f9af6247dd14f05e1a7f8cc11f284126
- json_object_copy_serializer_data/b7f74e5916e3e57c85367a05b25c13f9ae8b9babe5e84474fde42a0936ea6705
- json_object_deep_copy_recursive/abdab4a7a84b2ee05fea748d8945c7f8b3ac4b3747f2a42887a6b0ed0c1271dc
- json_object_deep_copy/9339f049a13fda87fff5be725d42b86bb640dab9ff428baf59d6c49e17811abc
- json_object_double_to_json_string_format/0cc1d7d02c12f27e740543a9e364f63effd2ba55da2833d12860dc23488d9c44
- json_object_generic_delete/f1bc8166d4af83b65026464e500f87b3cc202d6c9ecc769d83ffdfa4732f6d43
- json_object_get_double/45370a7b7c264feaf930868199fb2983d926c9d01329671216739f47c1dec39c
- json_object_get_int64/6b1e81819f035725cfe272aadb032854ad1e279c4f6734cf5260f105accd50d5
- json_object_get_int/afc09d6a125850a084a0707923072eb2f3029ceda506299626063e04dc16ed7b
- json_object_get/37597045577803d40d5b528279b98f05a841e9ba36095e327b4c4a12ee290146
- json_object_int_to_json_string/c15d16dc9478e62f036cdfb80bdb7894f81bf53a09586492ab1aa447142fd2e7
- json_object_is_type/3341671d5343f78a5f3bb5a94d3230b281403fdb7322ec8181f8784ae719e6a2
- json_object_iter_begin/dc6942b1d124daa5a7c03a6cb2f072ba6ef132419a6299dd08304af6ef79d8e2
- json_object_iter_end/38ff5c351e682910bd62bf4a224765f83a014d7ec8a794068e7b0e93391a51c2
- json_object_iter_equal/aa868e0f54f943e053b6f87e6ea07d6dec00a62778c5e79f562db470653a0f70
- json_object_iter_init_default/672e954c794215b248e3fec29e7bdb75414014377eba5b02fc09a86b58734ff2
- json_object_iter_next/e5cd12985386aa252c8680aa024a6d04a162f8c1c8663e309bce544a72259142
- json_object_iter_peek_name/d8027a3247db0b5c3ad56bbdd490ff91535330fc12d366a7a2c290ee06fdcf12
- json_object_iter_peek_value/8249eccc682ddb4822b7c7b70575c1ec6f1f836da80af0a33ba58eaffd8fab97
- json_object_new/1404331c347c7393f45a6571766fcefddc7c5cf90a3744dbdb917a17f5ef622f
- json_object_object_add_ex/3481d89c8aa610d221bcd0edaa9bd0fa21f9b6e30c6f283070c31990b78df007
- json_object_object_to_json_string/d675199bc1ff9e917bb1c7e3d7159745764077078abf63dd348ac86ed38d1c02
- json_object_put/78dabfbe4dfdff522e71890b2d56de8d07210494fadf315243345e0b6d0dff9b
- json_object_set_serializer/19c6b8faf444a12d9671f560802aa07b997772373c5a3753996ec0fdb9e490e6
- json_object_set_userdata/8540ec3938a2ebb6f647af77dbbb0c476d18be95229ef15bcf0426cf4ad5e131
- json_object_string_to_json_string/8e3235cbf62b4167b46c78f742446c905190b847c494721191a2daa32f31af94
- json_object_to_file_ext/1a05b089f7ad6666317d4d22bd44081ca8d7626b548d86ecbd0e36ae0f7ff84f
- json_object_to_file/b058b1215686cb7f12846bd45c3cefcb5c96dc4f92992787092b6460ab28ae75
- json_object_to_json_string_length/b212382c7c5b86e3b4892ff29c9921fcf35a1d855ab1304d3ffc0fbde3799414
- json_object_to_json_string/46a884c6c5a23cd2b63ffdc8982d9bbc1829be590a189df0beca663b550000bd
- json_pointer_get_recursive/59a2809f8a753257036c9490bedc48afe3d37c23fcc14c8787c11969050eac5c
- json_pointer_get_single_path/0d0542afbf8c17253e9d6ca9754615ae49185016e109c5da0bbe88212e5d20be
- json_pointer_get/e4b4ea02b7ab4dbaab52930d1d7a4324f661ec35df2e8b8716679083ebcc62b0
- json_pointer_set_single_path/79be311d333429233ae9ef91d3564b090dc362e0dca4d8f833a76aa79f75a475
- json_pointer_setf/ebb766ba26406ff7587a7b91d85dd70904eb01c7e539a460128aef1689c8d62b
- json_pointer_set/76289070ebe48774343f419d89fc44805ca1ff57e26b11d78a1f9c7db717917e
- json_tokener_parse_ex/eb0f9665433923288ddf941ee5d5bef30f5fb87a17952888a15b39aefc1887fc
- lh_char_hash/cbb02500330fcd0516eb8e142662c080ba0bce337470f998719a43a71fe8d2f7
- lh_perllike_str_hash/4246fa81c9325d9698903efc694b65daed222bfd2948cc3a9795104b08685b05
- lh_ptr_hash/2424db32ea43c616c3469b6e03490ea0f7324e875ad018ac7e18504b173abde9
- lh_table_delete_entry/a46322d305987677cd7babf57328141076150b73b6b5efed1fc00d190d1c89c4
- lh_table_lookup_ex/29582c45fc3aaf08ba2ab8311d21183be212cb72b36f0940e17e8d3cd5af52f0
- printbuf_extend/c68de4788a72c15d11aba545743730e20880278cd232f8d77361bee4877f722c
- sprintbuf/61141d171a3fd3aa6aa5d73a8168234378f11d3b4c37592ebe9e28c4c9566586
- string_replace_all_occurrences_with_char/6bdd364e47ee96ac8d75764b4f465f9bbf88b28153c00972f177cbedfaa2e8e0
- tests/integration/tests/json-c
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
137 files changed
+19370
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
20 | 53 | | |
21 | 54 | | |
22 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
48 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
49 | 61 | | |
50 | 62 | | |
51 | 63 | | |
| |||
116 | 128 | | |
117 | 129 | | |
118 | 130 | | |
| 131 | + | |
119 | 132 | | |
120 | 133 | | |
121 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| 99 | + | |
| 100 | + | |
97 | 101 | | |
98 | | - | |
99 | 102 | | |
100 | 103 | | |
101 | 104 | | |
102 | | - | |
| 105 | + | |
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
| |||
173 | 176 | | |
174 | 177 | | |
175 | 178 | | |
176 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
177 | 187 | | |
178 | | - | |
| 188 | + | |
179 | 189 | | |
180 | 190 | | |
181 | 191 | | |
| |||
206 | 216 | | |
207 | 217 | | |
208 | 218 | | |
209 | | - | |
| 219 | + | |
210 | 220 | | |
211 | 221 | | |
212 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
64 | | - | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
74 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
75 | 87 | | |
76 | 88 | | |
77 | 89 | | |
| |||
170 | 182 | | |
171 | 183 | | |
172 | 184 | | |
| 185 | + | |
173 | 186 | | |
174 | 187 | | |
175 | 188 | | |
| |||
187 | 200 | | |
188 | 201 | | |
189 | 202 | | |
| 203 | + | |
190 | 204 | | |
191 | 205 | | |
192 | 206 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
16 | 22 | | |
17 | 23 | | |
18 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 10 | + | |
14 | 11 | | |
15 | 12 | | |
16 | 13 | | |
| |||
Lines changed: 56 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
0 commit comments