name: transpile
version: 0.9.0
author: |
- The C2Rust Project Developers <c2rust@immunant.com>
- Eric Mertens <emertens@galois.com>
- Alec Theriault <atheriault@galois.com>
about: Translate C code to equivalent Rust code
settings:
- TrailingVarArg
args:
- prefix-function-names:
long: prefix-function-names
help: Adds a prefix to all function names. Generally only useful for testing
takes_value: true
- dump-untyped-clang-ast:
long: dump-untyped-clang-ast
help: Prints out CBOR based Clang AST
takes_value: false
- dump-typed-clang-ast:
long: dump-typed-clang-ast
help: Prints out the parsed typed Clang AST
takes_value: false
- pretty-typed-clang-ast:
long: pretty-typed-clang-ast
help: Pretty-prints out the parsed typed Clang AST
takes_value: false
- translate-asm:
long: translate-asm
help: Translate inline assembly without translating the assembly fragment
takes_value: false
- no-incremental-relooper:
long: no-incremental-relooper
help: Disable relooping function bodies incrementally
takes_value: false
- no-simplify-structures:
long: no-simplify-structures
help: Do not run a pass to simplify structures
takes_value: false
- ignore-c-loop-info:
long: ignore-c-loop-info
help: Don't keep/use information about C loops
takes_value: false
- ignore-c-multiple-info:
long: ignore-c-multiple-info
help: Don't keep/use information about C branches
takes_value: false
- dump-function-cfgs:
long: ddump-function-cfgs
help: Dumps into files DOT visualizations of the CFGs of every function
takes_value: false
- json-function-cfgs:
long: json-function-cfgs
help: Dumps into files JSON visualizations of the CFGs of every function
takes_value: false
- dump-cfgs-liveness:
long: ddump-cfgs-liveness
help: Dump into the DOT file visualizations liveness information
requires: dump-function-cfgs
takes_value: false
- dump-structures:
long: ddump-structures
help: Dumps out to STDERR the intermediate structures produced by relooper
takes_value: false
- debug-labels:
long: ddebug-labels
help: Generate readable 'current_block' values in relooper
takes_value: false
- cross-checks:
long: cross-checks
short: x
help: Enable cross-checks
takes_value: false
- cross-check-config:
long: cross-check-config
short: X
help: Add the given configuration files to the top-level cross_check(...) attribute
requires: cross-checks
multiple: true
takes_value: true
- cross-check-backend:
long: cross-check-backend
help: Select which cross-checking backend to use, e.g., zstd-logging
takes_value: true
possible_values:
- dynamic-dlsym
- zstd-logging
- libclevrbuf-sys
- libfakechecks-sys
default_value: zstd-logging
- COMPILE_COMMANDS:
help: Input compile_commands.json file
required: true
index: 1
- invalid-code:
long: invalid-code
help: How to handle violated invariants or invalid code
possible_values:
- panic
- compile_error
default_value: compile_error
- emit-modules:
long: emit-modules
help: Emit .rs files as modules instead of crates, excluding the crate preambles
takes_value: false
- emit-build-files:
long: emit-build-files
short: e
help: Emit Rust build files, i.e., Cargo.toml for a library (or a binary if -m/--main is given). Implies --emit-modules.
takes_value: false
- output-dir:
long: output-dir
short: o
value_name: DIR
help: Path to output directory. Rust sources will be emitted in DIR/src/ and build files will be emitted in DIR/.
takes_value: true
- filter:
long: filter
short: f
help: Only transpile files matching filter
takes_value: true
- fail-on-error:
long: fail-on-error
help: Fail to translate a module when a portion is not able to be translated
takes_value: false
- main:
long: main
short: m
help: Emit Rust build files for a binary using the main function in the specified translation unit (implies -e/--emit-build-files)
takes_value: true
- overwrite-existing:
long: overwrite-existing
help: Emit files even if it causes existing files to be overwritten
takes_value: false
- reduce-type-annotations:
long: reduce-type-annotations
help: Reduces the number of explicit type annotations where it should be safe to do so
takes_value: false
- reorganize-definitions:
long: reorganize-definitions
short: r
help: Output file in such a way that the refactoring tool can deduplicate code
takes_value: false
- extra-clang-args:
help: Extra arguments to pass to clang frontend during parsing the input C file
takes_value: true
multiple: true
- warn:
short: W
help: Enable the specified warning (all enables all warnings)
takes_value: true
- emit-no-std:
long: emit-no-std
help: Emit code using core rather than std
takes_value: false
- verbose:
long: verbose
short: v
help: Verbose mode
takes_value: false