Skip to content

Commit

Permalink
Extract cpp special path regex construction
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Oct 4, 2023
1 parent 475f3bb commit 093eb5e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/maingoblint.ml
Original file line number Diff line number Diff line change
Expand Up @@ -410,14 +410,19 @@ let preprocess_files () =
);
preprocessed

(** Regex for special "paths" in cpp output:
<built-in>, <command-line>, but also translations! *)
let special_path_regexp = Str.regexp "<.+>"

(** Parse preprocessed files *)
let parse_preprocessed preprocessed =
(* get the AST *)
if get_bool "dbg.verbose" then print_endline "Parsing files.";

let goblint_cwd = GobFpath.cwd () in
let get_ast_and_record_deps (preprocessed_file, task_opt) =
let transform_file (path_str, system_header) = if Str.string_match (Str.regexp "<.+>") path_str 0 then
let transform_file (path_str, system_header) =
if Str.string_match special_path_regexp path_str 0 then
(path_str, system_header) (* ignore special "paths" *)
else
let path = Fpath.v path_str in
Expand Down

0 comments on commit 093eb5e

Please sign in to comment.