Skip to content

Commit

Permalink
Remove Tracing dependency on CilType
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Dec 6, 2023
1 parent 5937314 commit 1eb7af8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
18 changes: 18 additions & 0 deletions src/common/util/messages.ml
Original file line number Diff line number Diff line change
Expand Up @@ -340,3 +340,21 @@ let msg_final severity ?(tags=[]) ?(category=Category.Unknown) fmt =
GobPretty.igprintf () fmt

include Tracing

open Pretty

let tracel sys ?var fmt =
let loc = !current_loc in
let docloc sys doc =
printtrace sys (dprintf "(%a)@?" CilType.Location.pretty loc ++ indent 2 doc);
in
gtrace true docloc sys var ~loc ignore fmt

let traceli sys ?var ?(subsys=[]) fmt =
let loc = !current_loc in
let g () = activate sys subsys in
let docloc sys doc: unit =
printtrace sys (dprintf "(%a)" CilType.Location.pretty loc ++ indent 2 doc);
traceIndent ()
in
gtrace true docloc sys var ~loc g fmt
17 changes: 0 additions & 17 deletions src/common/util/tracing.ml
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,6 @@ let trace sys ?var fmt = gtrace true printtrace sys var ignore fmt
* c: continue/normal print w/o indent-change
*)

let tracel sys ?var fmt =
let loc = !current_loc in
let docloc sys doc =
printtrace sys (dprintf "(%a)@?" CilType.Location.pretty loc ++ indent 2 doc);
in
gtrace true docloc sys var ~loc ignore fmt

let tracei (sys:string) ?var ?(subsys=[]) fmt =
let f sys d = printtrace sys d; traceIndent () in
let g () = activate sys subsys in
Expand All @@ -85,13 +78,3 @@ let traceu sys fmt =
let f sys d = printtrace sys d; traceOutdent () in
let g () = deactivate sys in
gtrace true f sys None g fmt


let traceli sys ?var ?(subsys=[]) fmt =
let loc = !current_loc in
let g () = activate sys subsys in
let docloc sys doc: unit =
printtrace sys (dprintf "(%a)" CilType.Location.pretty loc ++ indent 2 doc);
traceIndent ()
in
gtrace true docloc sys var ~loc g fmt

0 comments on commit 1eb7af8

Please sign in to comment.