Skip to content

Commit 35a5621

Browse files
authored
clear compiler options to use bcs and adopt additional_named_address (#114)
1 parent f4aabeb commit 35a5621

27 files changed

+1067
-1867
lines changed

api/bindings_compiler.h

Lines changed: 13 additions & 242 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,6 @@
1414
#include <stdlib.h>
1515

1616

17-
enum CoverageOption {
18-
/**
19-
* Display a coverage summary for all modules in this package
20-
*/
21-
CoverageOption_Summary = 0,
22-
/**
23-
* Display coverage information about the module against source code
24-
*/
25-
CoverageOption_Source = 1,
26-
/**
27-
* Display coverage information about the module against disassembled bytecode
28-
*/
29-
CoverageOption_Bytecode = 2,
30-
};
31-
typedef uint8_t CoverageOption;
32-
3317
enum ErrnoValue {
3418
ErrnoValue_Success = 0,
3519
ErrnoValue_Other = 1,
@@ -97,253 +81,40 @@ typedef struct {
9781
size_t len;
9882
} ByteSliceView;
9983

100-
typedef struct {
101-
/**
102-
* Compile in 'dev' mode. The 'dev-addresses' and 'dev-dependencies' fields will be used if
103-
* this flag is set. This flag is useful for development of packages that expose named
104-
* addresses that are not set to a specific value.
105-
*/
106-
bool dev_mode;
107-
/**
108-
* Compile in 'test' mode. The 'dev-addresses' and 'dev-dependencies' fields will be used
109-
* along with any code in the 'tests' directory.
110-
*/
111-
bool test_mode;
112-
/**
113-
* Generate documentation for packages
114-
*/
115-
bool generate_docs;
116-
/**
117-
* Generate ABIs for packages
118-
*/
119-
bool generate_abis;
120-
/**
121-
* Installation directory for compiled artifacts. Defaults to current directory.
122-
*/
123-
ByteSliceView install_dir;
124-
/**
125-
* Force recompilation of all packages
126-
*/
127-
bool force_recompilation;
128-
/**
129-
* Only fetch dependency repos to MOVE_HOME
130-
*/
131-
bool fetch_deps_only;
132-
/**
133-
* Skip fetching latest git dependencies
134-
*/
135-
bool skip_fetch_latest_git_deps;
136-
/**
137-
* bytecode version. set 0 to unset and to use default
138-
*/
139-
uint32_t bytecode_version;
140-
/**
141-
* Compiler version. set 0 to unset and to use default
142-
*/
143-
uint32_t compiler_version;
144-
/**
145-
* language version. set 0 to unset and to use default
146-
*/
147-
uint32_t language_version;
148-
} CompilerBuildConfig;
149-
150-
typedef struct {
151-
/**
152-
* Path to a package which the command should be run with respect to.
153-
*/
154-
ByteSliceView package_path;
155-
/**
156-
* Print additional diagnostics if available.
157-
*/
158-
bool verbose;
159-
/**
160-
* Package build options
161-
*/
162-
CompilerBuildConfig build_config;
163-
} CompilerArgument;
164-
165-
typedef struct {
166-
ByteSliceView module_name;
167-
} CompilerCoverageBytecodeOption;
168-
169-
typedef struct {
170-
ByteSliceView module_name;
171-
} CompilerCoverageSourceOption;
172-
173-
typedef struct {
174-
/**
175-
* Whether function coverage summaries should be displayed
176-
*/
177-
bool functions;
178-
/**
179-
* Output CSV data of coverage
180-
*/
181-
bool output_csv;
182-
} CompilerCoverageSummaryOption;
183-
184-
typedef struct {
185-
/**
186-
* Whether to include private declarations and implementations into the generated
187-
* documentation. Defaults to false.
188-
*/
189-
bool include_impl;
190-
/**
191-
* Whether to include specifications in the generated documentation. Defaults to false.
192-
*/
193-
bool include_specs;
194-
/**
195-
* Whether specifications should be put side-by-side with declarations or into a separate
196-
* section. Defaults to false.
197-
*/
198-
bool specs_inlined;
199-
/**
200-
* Whether to include a dependency diagram. Defaults to false.
201-
*/
202-
bool include_dep_diagram;
203-
/**
204-
* Whether details should be put into collapsed sections. This is not supported by
205-
* all markdown, but the github dialect. Defaults to false.
206-
*/
207-
bool collapsed_sections;
208-
/**
209-
* Package-relative path to an optional markdown template which is a used to create a
210-
* landing page. Placeholders in this file are substituted as follows: `> {{move-toc}}` is
211-
* replaced by a table of contents of all modules; `> {{move-index}}` is replaced by an index,
212-
* and `> {{move-include NAME_OF_MODULE_OR_SCRIP}}` is replaced by the the full
213-
* documentation of the named entity. (The given entity will not longer be placed in
214-
* its own file, so this can be used to create a single manually populated page for
215-
* the package.)
216-
*/
217-
ByteSliceView landing_page_template;
218-
/**
219-
* Package-relative path to a file whose content is added to each generated markdown file.
220-
* This can contain common markdown references fpr this package (e.g. `[move-book]: <url>`).
221-
*/
222-
ByteSliceView references_file;
223-
} CompilerDocgenOption;
224-
225-
typedef struct {
226-
ByteSliceView verbosity;
227-
/**
228-
* Filters targets out from the package. Any module with a matching file name will
229-
* be a target, similar as with `cargo test`.
230-
*/
231-
ByteSliceView filter;
232-
/**
233-
* Whether to display additional information in error reports. This may help
234-
* debugging but also can make verification slower.
235-
*/
236-
bool trace;
237-
/**
238-
* Whether to use cvc5 as the smt solver backend. The environment variable
239-
* `CVC5_EXE` should point to the binary.
240-
*/
241-
bool cvc5;
242-
/**
243-
* The depth until which stratified functions are expanded.
244-
*/
245-
size_t stratification_depth;
246-
/**
247-
* A seed for the prover.
248-
*/
249-
size_t random_seed;
250-
/**
251-
* The number of cores to use for parallel processing of verification conditions.
252-
*/
253-
size_t proc_cores;
254-
/**
255-
* A (soft) timeout for the solver, per verification condition, in seconds.
256-
*/
257-
size_t vc_timeout;
258-
/**
259-
* Whether to check consistency of specs by injecting impossible assertions.
260-
*/
261-
bool check_inconsistency;
262-
/**
263-
* Whether to keep loops as they are and pass them on to the underlying solver.
264-
*/
265-
bool keep_loops;
266-
/**
267-
* Number of iterations to unroll loops. set 0 to unset
268-
*/
269-
uint64_t loop_unroll;
270-
/**
271-
* Whether output for e.g. diagnosis shall be stable/redacted so it can be used in test
272-
* output.
273-
*/
274-
bool stable_test_output;
275-
/**
276-
* Whether to dump intermediate step results to files.
277-
*/
278-
bool dump;
279-
/**
280-
* indicating that this prover run is for a test.
281-
*/
282-
bool for_test;
283-
} CompilerProveOption;
284-
285-
typedef struct {
286-
/**
287-
* A filter string to determine which unit tests to run. A unit test will be run only if it
288-
* contains this string in its fully qualified (<addr>::<module_name>::<fn_name>) name.
289-
*/
290-
ByteSliceView filter;
291-
/**
292-
* Report test statistics at the end of testing
293-
*/
294-
bool report_statistics;
295-
/**
296-
* Show the storage state at the end of execution of a failing test
297-
*/
298-
bool report_storage_on_error;
299-
/**
300-
* Ignore compiler's warning, and continue run tests
301-
*/
302-
bool ignore_compile_warnings;
303-
/**
304-
* Collect coverage information for later use with the various `package coverage` subcommands
305-
*/
306-
bool compute_coverage;
307-
} CompilerTestOption;
308-
309-
UnmanagedVector build_move_package(UnmanagedVector *errmsg, CompilerArgument compiler_args);
84+
UnmanagedVector build_move_package(UnmanagedVector *errmsg, ByteSliceView compiler_args_paylod);
31085

31186
UnmanagedVector clean_move_package(UnmanagedVector *errmsg,
312-
CompilerArgument compiler_args,
87+
ByteSliceView compiler_args_paylod,
31388
bool clean_cache,
31489
bool clean_byproduct,
31590
bool force);
31691

31792
UnmanagedVector coverage_bytecode_move_package(UnmanagedVector *errmsg,
318-
CompilerArgument compiler_args,
319-
CompilerCoverageBytecodeOption coverage_opt);
93+
ByteSliceView compiler_args_paylod,
94+
ByteSliceView coverage_opt_payload);
32095

32196
UnmanagedVector coverage_source_move_package(UnmanagedVector *errmsg,
322-
CompilerArgument compiler_args,
323-
CompilerCoverageSourceOption coverage_opt);
97+
ByteSliceView compiler_args_paylod,
98+
ByteSliceView coverage_opt_payload);
32499

325100
UnmanagedVector coverage_summary_move_package(UnmanagedVector *errmsg,
326-
CompilerArgument compiler_args,
327-
CompilerCoverageSummaryOption coverage_opt);
101+
ByteSliceView compiler_args_paylod,
102+
ByteSliceView coverage_opt_payload);
328103

329104
UnmanagedVector create_new_move_package(UnmanagedVector *errmsg,
330-
CompilerArgument compiler_args,
105+
ByteSliceView compiler_args_paylod,
331106
ByteSliceView name_view);
332107

333108
void destroy_unmanaged_vector(UnmanagedVector v);
334109

335110
UnmanagedVector docgen_move_package(UnmanagedVector *errmsg,
336-
CompilerArgument compiler_args,
337-
CompilerDocgenOption docgen_opt);
111+
ByteSliceView compiler_args_paylod,
112+
ByteSliceView docgen_opt_payload);
338113

339114
UnmanagedVector new_unmanaged_vector(bool nil, const uint8_t *ptr, size_t length);
340115

341-
UnmanagedVector prove_move_package(UnmanagedVector *errmsg,
342-
CompilerArgument compiler_args,
343-
CompilerProveOption prove_opt);
344-
345116
UnmanagedVector test_move_package(UnmanagedVector *errmsg,
346-
CompilerArgument compiler_args,
347-
CompilerTestOption test_opt);
117+
ByteSliceView compiler_args_paylod,
118+
ByteSliceView test_opt_payload);
348119

349120
#endif /* __LIBCOMPILER__ */

0 commit comments

Comments
 (0)