Skip to content
Snippets Groups Projects
Commit 49146e6f authored by Loïc Correnson's avatar Loïc Correnson
Browse files

[server] activate printing of stdlib

parent 18092bd2
No related branches found
No related tags found
No related merge requests found
...@@ -338,11 +338,13 @@ let () = Request.register ~package ...@@ -338,11 +338,13 @@ let () = Request.register ~package
~input:(module Kf) ~output:(module Jtext) ~input:(module Kf) ~output:(module Jtext)
begin fun kf -> begin fun kf ->
let libc = Kernel.PrintLibc.get () in let libc = Kernel.PrintLibc.get () in
if not libc then Kernel.PrintLibc.set true ; try
let global = Kernel_function.get_global kf in if not libc then Kernel.PrintLibc.set true ;
let ast = Jbuffer.to_json Printer.pp_global global in let global = Kernel_function.get_global kf in
if not libc then Kernel.PrintLibc.set false ; let ast = Jbuffer.to_json Printer.pp_global global in
ast if not libc then Kernel.PrintLibc.set false ; ast
with err ->
if not libc then Kernel.PrintLibc.set false ; raise err
end end
module Functions = module Functions =
...@@ -352,9 +354,17 @@ struct ...@@ -352,9 +354,17 @@ struct
let signature kf = let signature kf =
let global = Kernel_function.get_global kf in let global = Kernel_function.get_global kf in
Rich_text.to_string Printer_tag.pretty (PGlobal global) let libc = Kernel.PrintLibc.get () in
try
if not libc then Kernel.PrintLibc.set true ;
let txt = Rich_text.to_string Printer_tag.pretty (PGlobal global) in
if not libc then Kernel.PrintLibc.set false ;
if Kernel_function.is_main kf then (txt ^ " /* main */") else txt
with err ->
if not libc then Kernel.PrintLibc.set false ; raise err
let is_builtin kf = Cil.is_builtin (Kernel_function.get_vi kf) let is_builtin kf =
Cil_builtins.is_builtin (Kernel_function.get_vi kf)
let is_stdlib kf = let is_stdlib kf =
let vi = Kernel_function.get_vi kf in let vi = Kernel_function.get_vi kf in
......
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