Skip to content

Commit

Permalink
Add --gen-c flag to cargo-rmc. (rust-lang#192)
Browse files Browse the repository at this point in the history
Co-authored-by: Adrian Palacios <73246657+adpaco-aws@users.noreply.github.com>
  • Loading branch information
2 people authored and tedinski committed Jun 10, 2021
1 parent a10fe87 commit a0f051d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/cargo-rmc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def main():
parser.add_argument("--quiet", "-q", action="store_true")
parser.add_argument("--debug", action="store_true")
parser.add_argument("--keep-temps", action="store_true")
parser.add_argument("--gen-c", action="store_true")
parser.add_argument("--mangler", default="v0")
parser.add_argument("--visualize", action="store_true")
parser.add_argument("--srcdir", default=".")
Expand Down Expand Up @@ -49,9 +50,14 @@ def main():
print("ERROR: unexpected number of json outputs")
return 1
cbmc_filename = "cbmc.out"
c_filename = "cbmc.c"
if EXIT_CODE_SUCCESS != rmc.symbol_table_to_gotoc(jsons[0], cbmc_filename, args.verbose, args.keep_temps):
return 1

if args.gen_c:
if EXIT_CODE_SUCCESS != rmc.goto_to_c(cbmc_filename, c_filename, args.verbose):
return 1

if "--function" not in args.cbmc_args:
args.cbmc_args.extend(["--function", args.function])

Expand Down

0 comments on commit a0f051d

Please sign in to comment.