Skip to content

Add crangler man page #6938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions doc/man/crangler.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
.TH CRANGLER "1" "June 2022" "crangler-5.59.0" "User Commands"
.SH NAME
crangler \- C source transformation
.SH SYNOPSIS
.B crangler [\-?] [\-h] [\-\-help]

.BI crangler \ file.json

.SH DESCRIPTION
.B crangler
is a command-line utility that makes changes to a preprocessed C file
that are prescribed in a JSON configuration file.

The supported transformations are:
.IP
Add a contract (pre/post/assigns) to a named C function.
.IP
Add a loop invariant to a loop identified by the name of the function its in and
a loop number.
.IP
Remove the
.B static
storage classifier from a function or a variable.
.IP
Replace a function call by a call to a stub.
.PP
The resulting source file is written to standard output or to a file specified
in the JSON configuration.
.SH EXAMPLE
The following JSON configuration file makes
.B crangler
preprocess
.IR remove_static1.c .
While processing this file to produce a preprocessed result, no non-standard
include paths or defines reqired.
Transformations configured here are
removing the
.B static
storage classifier from all functions matching the regular expression
.BR foobar[12] ,
and replacing calls to \fIbar\fR by calls to a function called \fIbar_stub\fR.
No objects are listed that require transformation.
The result is written to standard output.
.EX
{
"sources": [
"remove_static1.c"
],
"includes": [],
"defines": [],
"functions": [
{
"foobar[12]": [
"remove static"
],
"bar": [
"stub bar_stub"
]
}
],
"objects": [],
"output": "stdout"
}
.EE
.SH ENVIRONMENT
All tools honor the TMPDIR environment variable when generating temporary
files and directories.
.SH BUGS
If you encounter a problem please create an issue at
.B https://github.com/diffblue/cbmc/issues
.SH COPYRIGHT
2021, Daniel Kroening