Skip to content
Snippets Groups Projects
Commit 93f3e754 authored by Michele Alberti's avatar Michele Alberti Committed by Virgile Prevosto
Browse files

[kernel] Take into account print-as-is option in printer.

parent b97e0e91
No related branches found
No related tags found
No related merge requests found
...@@ -36,13 +36,7 @@ let play_analysis () = ...@@ -36,13 +36,7 @@ let play_analysis () =
Db.Main.apply (); Db.Main.apply ();
Log.treat_deferred_error (); Log.treat_deferred_error ();
(* Printing code, if required, have to be done at end. *) (* Printing code, if required, have to be done at end. *)
if Kernel.PrintCode.get () if Kernel.PrintCode.get () then File.pretty_ast ();
then begin
(* Consider user's request, if any, to print code as given by Cil. *)
Cil_printer.state.Printer_api.print_cil_as_is <-
Cil_printer.state.Printer_api.print_cil_as_is || Kernel.PrintAsIs.get ();
File.pretty_ast ();
end;
(* Easier to handle option -set-project-as-default at the last moment: (* Easier to handle option -set-project-as-default at the last moment:
no need to worry about nested [Project.on] *) no need to worry about nested [Project.on] *)
Project.set_keep_current (Kernel.Set_project_as_default.get ()); Project.set_keep_current (Kernel.Set_project_as_default.get ());
......
...@@ -3406,6 +3406,7 @@ class cil_printer () = object (self) ...@@ -3406,6 +3406,7 @@ class cil_printer () = object (self)
method file fmt file = method file fmt file =
fprintf fmt "@[/* Generated by Frama-C */@\n" ; fprintf fmt "@[/* Generated by Frama-C */@\n" ;
state.print_cil_as_is <- state.print_cil_as_is || Kernel.PrintAsIs.get ();
print_std_includes fmt file.globals; print_std_includes fmt file.globals;
Cil.iterGlobals file (fun g -> self#global fmt g); Cil.iterGlobals file (fun g -> self#global fmt g);
fprintf fmt "@]@." fprintf fmt "@]@."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment