aboutsummaryrefslogtreecommitdiffstats
path: root/cparser
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-03-24 16:07:45 +0100
committerBernhard Schommer <bernhardschommer@gmail.com>2015-03-24 16:07:45 +0100
commit2ebf8bfda476966209d681470ebe6301fb10db0a (patch)
tree15bc824d8c92a5d089852a3a21648cba7af242eb /cparser
parent275d7f4091609ae30093a4a83a20a74997229f9c (diff)
downloadcompcert-kvx-2ebf8bfda476966209d681470ebe6301fb10db0a.tar.gz
compcert-kvx-2ebf8bfda476966209d681470ebe6301fb10db0a.zip
Added missing functions for printing the structs and unions. Still missing printing of packed structs.
Diffstat (limited to 'cparser')
-rw-r--r--cparser/Parse.ml13
-rw-r--r--cparser/Parse.mli2
2 files changed, 10 insertions, 5 deletions
diff --git a/cparser/Parse.ml b/cparser/Parse.ml
index 59b04e7a..71c9454f 100644
--- a/cparser/Parse.ml
+++ b/cparser/Parse.ml
@@ -41,7 +41,7 @@ let parse_transformations s =
let preprocessed_file transfs name sourcefile =
Cerrors.reset();
let ic = open_in sourcefile in
- let p =
+ let p,d =
try
let t = parse_transformations transfs in
let lb = Lexer.init name ic in
@@ -57,9 +57,14 @@ let preprocessed_file transfs name sourcefile =
| Parser.Parser.Inter.Timeout_pr -> assert false
| Parser.Parser.Inter.Parsed_pr (ast, _ ) -> ast) in
let p1 = Timing.time "Elaboration" Elab.elab_file ast in
- Timing.time2 "Emulations" transform_program t p1
+ let debug =
+ if !Clflags.option_g && Configuration.advanced_debug then
+ Some (CtoDwarf.program_to_dwarf p1 name)
+ else
+ None in
+ Timing.time2 "Emulations" transform_program t p1,debug
with
| Cerrors.Abort ->
- [] in
+ [],None in
close_in ic;
- if Cerrors.check_errors() then None else Some p
+ if Cerrors.check_errors() then None,None else Some p,d
diff --git a/cparser/Parse.mli b/cparser/Parse.mli
index 58c3cfb9..ac8feb70 100644
--- a/cparser/Parse.mli
+++ b/cparser/Parse.mli
@@ -15,7 +15,7 @@
(* Entry point for the library: parse, elaborate, and transform *)
-val preprocessed_file: string -> string -> string -> C.program option
+val preprocessed_file: string -> string -> string -> C.program option * DwarfTypes.dw_entry option
(* first arg: desired transformations
second arg: source file name before preprocessing