Improve programming style.

compiler/hlds_llds.m:
    Give some function symbols more meaningful names.

compiler/code_loc_dep.m:
    Give some function symbols and variables more meaningful names.

    Replace list(prog_var) with set_of_progvar in the signatures
    of some predicates to express the invariant that the argument
    should not contain any duplicates.

    Provide a utility predicate for ite_gen.m.

    Generate more readable debug output.

compiler/ite_gen.m:
    Factor out some common code.

    Optimize some tests.

    Break up a predicate to reduce the level of indentation.

    Add some module qualifications to reduce type ambiguity.

compiler/var_locn.m:
    Separate the two use cases of init_var_locn_state_2, since one needs
    more work than the other. Factor out the parts that are common to both.

compiler/llds.m:
    Define a bespoke type to control whether auto-comments are printed or not.

compiler/code_gen.m:
compiler/disj_gen.m:
compiler/frameopt.m:
compiler/hlds_out_goal.m:
compiler/layout_out.m:
compiler/live_vars.m:
compiler/live_vars.m:
compiler/liveness.m:
compiler/liveness.m:
compiler/llds_out_file.m:
compiler/llds_out_instr.m:
compiler/llds_out_util.m:
compiler/lookup_switch.m:
compiler/lookup_switch.m:
compiler/opt_debug.m:
compiler/optimize.m:
compiler/use_local_vars.m:
    Conform to the changes above.
This commit is contained in:
Zoltan Somogyi
2020-07-17 10:48:13 +10:00
parent 4987544ab4
commit 9d6c8d1780
19 changed files with 536 additions and 486 deletions

View File

@@ -65,7 +65,6 @@
:- import_module parse_tree.prog_data_foreign.
:- import_module parse_tree.set_of_var.
:- import_module bool.
:- import_module cord.
:- import_module int.
:- import_module io.
@@ -196,7 +195,7 @@ generate_goal(ContextModel, Goal, Code, !CI, !CLD) :-
( if should_trace_code_gen(!.CI) then
io.format("\nGOAL FINISH: %s\n", [s(GoalDesc)], !IO),
Instrs = cord.list(Code),
write_instrs(Instrs, no, yes, !IO)
write_instrs(Instrs, no, auto_comments, !IO)
else
true
)