Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
89620efb
Commit
89620efb
authored
4 years ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[kernel] File: rewrites function [compute_sources_table].
parent
2b9be50b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/kernel_services/ast_queries/file.ml
+22
-26
22 additions, 26 deletions
src/kernel_services/ast_queries/file.ml
with
22 additions
and
26 deletions
src/kernel_services/ast_queries/file.ml
+
22
−
26
View file @
89620efb
...
...
@@ -1656,33 +1656,29 @@ let print_all_sources out all_sources_tbl =
let
compute_sources_table
cpp_commands
=
let
all_sources_tbl
=
Hashtbl
.
create
7
in
List
.
iter
(
fun
(
f
,
cmd_opt
)
->
add_source_if_new
all_sources_tbl
(
get_filepath
f
);
match
cmd_opt
with
|
None
->
()
|
Some
(
cpp_cmd
,
_ppf
,
_sl
)
->
let
audit_sources_tmpfile
=
create_temp_file
"audit_produce_sources"
".txt"
let
process_file
(
file
,
cmd_opt
)
=
add_source_if_new
all_sources_tbl
(
get_filepath
file
);
match
cmd_opt
with
|
None
->
()
|
Some
(
cpp_cmd
,
_ppf
,
_sl
)
->
let
tmp_file
=
create_temp_file
"audit_produce_sources"
".txt"
in
let
tmp_file
=
(
tmp_file
:>
string
)
in
let
cmd_for_sources
=
cpp_cmd
^
" -H -MM >/dev/null 2>"
^
tmp_file
in
let
exit_code
=
Sys
.
command
cmd_for_sources
in
if
exit_code
=
0
then
add_included_sources
all_sources_tbl
tmp_file
else
let
cause_frama_c_compliant
=
if
Kernel
.
CppGnuLike
.
get
()
then
""
else
Format
.
asprintf
"
\n
Please ensure preprocessor is Frama-C compliant \
(see option %s)"
Kernel
.
CppGnuLike
.
option_name
in
let
cmd_for_sources
=
cpp_cmd
^
" -H -MM >/dev/null 2>"
^
(
audit_sources_tmpfile
:>
string
)
in
let
exit_code
=
Sys
.
command
cmd_for_sources
in
if
exit_code
<>
0
then
begin
let
cause_frama_c_compliant
=
if
not
(
Kernel
.
CppGnuLike
.
get
()
)
then
Format
.
asprintf
"
\n
Please ensure preprocessor is Frama-C-compliant \
(see option %s)"
Kernel
.
CppGnuLike
.
option_name
else
""
in
Kernel
.
abort
"error running command to obtain included sources \
(exit code %d):@
\n
%s%s"
exit_code
cmd_for_sources
cause_frama_c_compliant
;
end
else
add_included_sources
all_sources_tbl
(
audit_sources_tmpfile
:>
string
);
)
cpp_commands
;
Kernel
.
abort
"error running command to obtain included sources \
(exit code %d):@
\n
%s%s"
exit_code
cmd_for_sources
cause_frama_c_compliant
;
in
List
.
iter
process_file
cpp_commands
;
all_sources_tbl
let
source_hashes_of_json
path
=
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment