Skip to content

Commit

Permalink
(core) fix p_unit/p_asr warnings
Browse files Browse the repository at this point in the history
Src-commit: 32021763a38cdc98458038ce54c5ce6edae6a01f
  • Loading branch information
jfmc committed Jul 11, 2023
1 parent 5b5fefb commit df13077
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions core/lib/compiler/p_unit/p_asr.pl
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@

process_main_info_file(M, Opts, Base) :-
p_unit_log(['{Processing main module ']),
defines_module(Base, M),
c_itf:defines_module(Base, M),
assertz_fact(processed_file(Base)),
assert_itf(defines_module, M, _, _, Base),
%% forces generation of defines/5 data (used below)
Expand Down Expand Up @@ -489,7 +489,7 @@
file_up_to_date(AsrName, PlName),
% display('Reading asr file '), display(AsrName), nl,
read_asr_file(AsrName),
defines_module(Base, M),
c_itf:defines_module(Base, M),
assert_itf(defines_module, M, _, _, Base)
).

Expand Down Expand Up @@ -750,12 +750,13 @@
head_expand(Type, PD, M, Dict, ExpPD, loc(Source, LB, LE)) :-
not_allow_external(Type, PD),
!,
functor(PD, F, A),
( functor(Meta, F, A), meta_args(M, Meta) -> true ; Meta = 0 ),
functor(PD, F, A),
( functor(Meta, F, A), meta_args(M, Meta) -> true ; Meta = 0 ),
module_expand(PD, true, M, Dict, ExpPD0, _, Source, LB, LE),
fix_assrt_head(ExpPD0, Meta, M, ExpPD),
fix_assrt_head(ExpPD0, Meta, M, ExpPD),
functor(PD, F, A),
(defines(M, F, A) -> true ; assertz_fact(defines(M, F, A))).
% TODO: doing this is dangerous (JF)
( c_itf:defines(M, F, A) -> true ; assertz_fact(c_itf:defines(M, F, A)) ).
% Using module_expand in this way allows us to write assertions of
% predicates that are in other modules: --EMM
head_expand(_, PD, M, Dict, ExpPD, loc(Source, LB, LE)) :-
Expand Down Expand Up @@ -856,7 +857,7 @@
%% Related file processing

process_related_file(Rel, Opts, Base) :-
defines_module(Base, M),
c_itf:defines_module(Base, M),
assertz_fact(processed_file(Base)),
% display( processed_file( Base ) ), nl,

Expand Down

0 comments on commit df13077

Please sign in to comment.