diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2016-05-09 07:38:06 +0200 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2016-05-24 15:52:11 +0200 |
commit | 8c28d0630576de35e739edebc2abe127d18de22a (patch) | |
tree | 03ceac74e5bf28a4d3bed7167c863ffff9c14a54 | |
parent | daf677cd5738187b30288e65cb89100b629ef5ba (diff) | |
download | compcert-8c28d0630576de35e739edebc2abe127d18de22a.tar.gz compcert-8c28d0630576de35e739edebc2abe127d18de22a.zip |
Added version string to Clightgen.
Clightgen now also prints a version string. Also the CompCert version
string is now similar in both modes.
Bug 18768.
-rw-r--r-- | driver/Driver.ml | 2 | ||||
-rw-r--r-- | exportclight/Clightgen.ml | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/driver/Driver.ml b/driver/Driver.ml index db281d2d..b8c92d6c 100644 --- a/driver/Driver.ml +++ b/driver/Driver.ml @@ -289,7 +289,7 @@ let perform_actions () = let version_string = if Version.buildnr <> "" && Version.tag <> "" then - sprintf "The CompCert verified compiler, %s, Build: %s, Tag: %s\n" Version.version Version.buildnr Version.tag + sprintf "The CompCert C verified compiler, %s, Build: %s, Tag: %s\n" Version.version Version.buildnr Version.tag else "The CompCert C verified compiler, version "^ Version.version ^ "\n" diff --git a/exportclight/Clightgen.ml b/exportclight/Clightgen.ml index c6ba9649..0a586acd 100644 --- a/exportclight/Clightgen.ml +++ b/exportclight/Clightgen.ml @@ -67,9 +67,15 @@ let process_c_file sourcename = compile_c_file sourcename preproname (prefixname ^ ".v") end +let version_string = + if Version.buildnr <> "" && Version.tag <> "" then + sprintf "The CompCert Clight generator, %s, Build: %s, Tag: %s\n" Version.version Version.buildnr Version.tag + else + "The CompCert Clight generator, version "^ Version.version ^ "\n" + let usage_string = -"The CompCert Clight generator\n\ -Usage: clightgen [options] <source files>\n\ + version_string ^ +"Usage: clightgen [options] <source files>\n\ Recognized source files:\n\ \ .c C source file\n\ Processing options:\n\ @@ -95,6 +101,9 @@ General options:\n\ let print_usage_and_exit _ = printf "%s" usage_string; exit 0 +let print_version_and_exit _ = + printf "%s" version_string; exit 0 + let language_support_options = [ option_fbitfields; option_flongdouble; option_fstruct_passing; option_fvararg_calls; option_funprototyped; @@ -111,6 +120,9 @@ let cmdline_actions = (* Getting help *) Exact "-help", Self print_usage_and_exit; Exact "--help", Self print_usage_and_exit; +(* Getting version info *) + Exact "-version", Self print_version_and_exit; + Exact "--version", Self print_version_and_exit; (* Processing options *) Exact "-E", Set option_E;] (* Preprocessing options *) |