Skip to content

Commit

Permalink
remove special handling in the dependence analysis for files in the c…
Browse files Browse the repository at this point in the history
…urrent directory
  • Loading branch information
nikswamy committed Jan 20, 2025
1 parent 38dd19e commit e181cc9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/basic/FStarC.Find.fst
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ let include_path () =
cache_dir @ lib_paths () @ include_paths @ cmd_line_file_dirs
let do_find (paths : list string) (filename : string) : option string =
if BU.is_path_absolute filename then
if BU.file_exists filename then
Some filename
else
None
else
let filename = BU.basename filename in
try
(* In reverse, because the last directory has the highest precedence. *)
Expand Down
3 changes: 1 addition & 2 deletions src/parser/FStarC.Parser.Dep.fst
Original file line number Diff line number Diff line change
Expand Up @@ -471,14 +471,13 @@ let build_inclusion_candidates_list (): list (string & string) =
(* Note that [BatList.unique] keeps the last occurrence, that way one can
* always override the precedence order. *)
let include_directories = List.unique include_directories in
let cwd = normalize_file_path (getcwd ()) in
include_directories |> List.concatMap (fun d ->
let files = safe_readdir_for_include d in
files |> List.filter_map (fun f ->
let f = basename f in
check_and_strip_suffix f
|> Util.map_option (fun longname ->
let full_path = if d = cwd then f else join_paths d f in
let full_path = join_paths d f in
(longname, full_path))
)
)
Expand Down

0 comments on commit e181cc9

Please sign in to comment.