[m-rev.] for review: moving code for reading procedure representations

Zoltan Somogyi zs at csse.unimelb.edu.au
Fri Jul 27 19:46:16 AEST 2007


For review by anyone.

Zoltan.

Move the code for reading procedure representations from the browser directory
(in declarative_execution.m) to the mdbcomp directory (the file 
program_representation.m) in order to make it accessible for the deep
profiler, since future changes by Paul Bone will require this.

browser/declarative_execution.m:
mdbcomp/program_representation.m:
	Make the move.

	Turn a semidet function into a predicate.

	Update some old constructs.

mdbcomp/program_representation.m:
mdbcomp/slice_and_dice.m:
	Change the prefix on the functions exported to C to MR_MDBCOMP
	from the previous mixture of MR_MDB and ML.

trace/*.c:
	Conform to the new prefixes on exported C functions.

cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/libatomic_ops-1.2
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/doc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/hpc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/ibmc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/icc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/msftc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/sunc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/tests
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing boehm_gc/windows-untested
cvs diff: Diffing boehm_gc/windows-untested/vc60
cvs diff: Diffing boehm_gc/windows-untested/vc70
cvs diff: Diffing boehm_gc/windows-untested/vc71
cvs diff: Diffing browser
Index: browser/declarative_execution.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/browser/declarative_execution.m,v
retrieving revision 1.59
diff -u -b -r1.59 declarative_execution.m
--- browser/declarative_execution.m	2 May 2007 02:15:55 -0000	1.59
+++ browser/declarative_execution.m	26 Jul 2007 05:09:33 -0000
@@ -1332,9 +1332,8 @@
 :- type trace_node_map
     --->    map(map(trace_node_key, trace_node(trace_node_key))).
 
-    % Values of this type are represented in the same way (in the
-    % underlying C code) as corresponding values of the other
-    % instance.
+    % Values of this type are represented in the same way (in the underlying
+    % C code) as corresponding values of the other instance.
     %
 :- type trace_node_key
     --->    key(int).
@@ -1528,358 +1527,4 @@
     ).
 
 %-----------------------------------------------------------------------------%
-
-:- type bytecode --->   dummy_bytecode.
-
-:- pragma foreign_type("C", bytecode, "const MR_uint_least8_t *",
-    [can_pass_as_mercury_type, stable]).
-:- pragma foreign_type("Java", bytecode, "java.lang.Object", []). %stub only
-
-:- pred read_proc_rep(bytecode::in, label_layout::in, proc_rep::out) is det.
-:- pragma foreign_export("C", read_proc_rep(in, in, out),
-    "MR_DD_trace_read_rep").
-
-read_proc_rep(Bytecode, Label, ProcRep) :-
-    some [!Pos] (
-        !:Pos = 0,
-        read_int32(Bytecode, !Pos, Limit),
-        read_var_num_rep(Bytecode, !Pos, VarNumRep),
-        read_string(Bytecode, Label, !Pos, FileName),
-        Info = read_proc_rep_info(Limit, FileName),
-        read_vars(VarNumRep, Bytecode, !Pos, HeadVars),
-        read_goal(VarNumRep, Bytecode, Label, !Pos, Info, Goal),
-        ProcRep = proc_rep(HeadVars, Goal),
-        require(unify(!.Pos, Limit), "read_proc_rep: limit mismatch")
-    ).
-
-:- type read_proc_rep_info
-    --->    read_proc_rep_info(
-                limit       :: int,
-                filename    :: string
-            ).
-
-:- pred read_goal(var_num_rep::in, bytecode::in, label_layout::in, int::in,
-    int::out, read_proc_rep_info::in, goal_rep::out) is det.
-
-read_goal(VarNumRep, Bytecode, Label, !Pos, Info, Goal) :-
-    read_byte(Bytecode, !Pos, GoalTypeByte),
-    ( byte_to_goal_type(GoalTypeByte) = GoalType ->
-        (
-            GoalType = goal_conj,
-            read_goals(VarNumRep, Bytecode, Label, !Pos, Info,  Goals),
-            Goal = conj_rep(Goals)
-        ;
-            GoalType = goal_disj,
-            read_goals(VarNumRep, Bytecode, Label, !Pos, Info, Goals),
-            Goal = disj_rep(Goals)
-        ;
-            GoalType = goal_neg,
-            read_goal(VarNumRep, Bytecode, Label, !Pos, Info, SubGoal),
-            Goal = negation_rep(SubGoal)
-        ;
-            GoalType = goal_ite,
-            read_goal(VarNumRep, Bytecode, Label, !Pos, Info, Cond),
-            read_goal(VarNumRep, Bytecode, Label, !Pos, Info, Then),
-            read_goal(VarNumRep, Bytecode, Label, !Pos, Info, Else),
-            Goal = ite_rep(Cond, Then, Else)
-        ;
-            GoalType = goal_switch,
-            read_goals(VarNumRep, Bytecode, Label, !Pos, Info, Goals),
-            Goal = switch_rep(Goals)
-        ;
-            GoalType = goal_assign,
-            read_var(VarNumRep, Bytecode, !Pos, Target),
-            read_var(VarNumRep, Bytecode, !Pos, Source),
-            AtomicGoal = unify_assign_rep(Target, Source),
-            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
-                Info, AtomicGoal, Goal)
-        ;
-            GoalType = goal_construct,
-            read_var(VarNumRep, Bytecode, !Pos, Var),
-            read_cons_id(Bytecode, Label, !Pos, ConsId),
-            read_vars(VarNumRep, Bytecode, !Pos, ArgVars),
-            AtomicGoal = unify_construct_rep(Var, ConsId, ArgVars),
-            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
-                Info, AtomicGoal, Goal)
-        ;
-            GoalType = goal_deconstruct,
-            read_var(VarNumRep, Bytecode, !Pos, Var),
-            read_cons_id(Bytecode, Label, !Pos, ConsId),
-            read_vars(VarNumRep, Bytecode, !Pos, ArgVars),
-            AtomicGoal = unify_deconstruct_rep(Var, ConsId, ArgVars),
-            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
-                Info, AtomicGoal, Goal)
-        ;
-            GoalType = goal_partial_construct,
-            read_var(VarNumRep, Bytecode, !Pos, Var),
-            read_cons_id(Bytecode, Label, !Pos, ConsId),
-            read_maybe_vars(VarNumRep, Bytecode, !Pos, MaybeVars),
-            AtomicGoal = partial_construct_rep(Var, ConsId, MaybeVars),
-            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
-                Info, AtomicGoal, Goal)
-        ;
-            GoalType = goal_partial_deconstruct,
-            read_var(VarNumRep, Bytecode, !Pos, Var),
-            read_cons_id(Bytecode, Label, !Pos, ConsId),
-            read_maybe_vars(VarNumRep, Bytecode, !Pos, MaybeVars),
-            AtomicGoal = partial_deconstruct_rep(Var, ConsId, MaybeVars),
-            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
-                Info, AtomicGoal, Goal)
-        ;
-            GoalType = goal_simple_test,
-            read_var(VarNumRep, Bytecode, !Pos, Var1),
-            read_var(VarNumRep, Bytecode, !Pos, Var2),
-            AtomicGoal = unify_simple_test_rep(Var1, Var2),
-            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
-                Info, AtomicGoal, Goal)
-        ;
-            GoalType = goal_scope,
-            read_byte(Bytecode, !Pos, MaybeCutByte),
-            ( MaybeCutByte = 0 ->
-                MaybeCut = scope_is_no_cut
-            ; MaybeCutByte = 1 ->
-                MaybeCut = scope_is_cut
-            ;
-                error("read_goal: bad maybe_cut")
-            ),
-            read_goal(VarNumRep, Bytecode, Label, !Pos, Info, SubGoal),
-            Goal = scope_rep(SubGoal, MaybeCut)
-        ;
-            GoalType = goal_ho_call,
-            read_var(VarNumRep, Bytecode, !Pos, Var),
-            read_vars(VarNumRep, Bytecode, !Pos, Args),
-            AtomicGoal = higher_order_call_rep(Var, Args),
-            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
-                Info, AtomicGoal, Goal)
-        ;
-            GoalType = goal_method_call,
-            read_var(VarNumRep, Bytecode, !Pos, Var),
-            read_method_num(Bytecode, !Pos, MethodNum),
-            read_vars(VarNumRep, Bytecode, !Pos, Args),
-            AtomicGoal = method_call_rep(Var, MethodNum, Args),
-            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
-                Info, AtomicGoal, Goal)
-        ;
-            GoalType = goal_cast,
-            read_var(VarNumRep, Bytecode, !Pos, OutputVar),
-            read_var(VarNumRep, Bytecode, !Pos, InputVar),
-            AtomicGoal = cast_rep(OutputVar, InputVar),
-            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
-                Info, AtomicGoal, Goal)
-        ;
-            GoalType = goal_plain_call,
-            read_string(Bytecode, Label, !Pos, ModuleName),
-            read_string(Bytecode, Label, !Pos, PredName),
-            read_vars(VarNumRep, Bytecode, !Pos, Args),
-            AtomicGoal = plain_call_rep(ModuleName, PredName, Args),
-            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
-                Info, AtomicGoal, Goal)
-        ;
-            GoalType = goal_builtin_call,
-            read_string(Bytecode, Label, !Pos, ModuleName),
-            read_string(Bytecode, Label, !Pos, PredName),
-            read_vars(VarNumRep, Bytecode, !Pos, Args),
-            AtomicGoal = builtin_call_rep(ModuleName, PredName, Args),
-            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
-                Info, AtomicGoal, Goal)
-        ;
-            GoalType = goal_event_call,
-            read_string(Bytecode, Label, !Pos, EventName),
-            read_vars(VarNumRep, Bytecode, !Pos, Args),
-            AtomicGoal = event_call_rep(EventName, Args),
-            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
-                Info, AtomicGoal, Goal)
-        ;
-            GoalType = goal_foreign,
-            read_vars(VarNumRep, Bytecode, !Pos, Args),
-            AtomicGoal = pragma_foreign_code_rep(Args),
-            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
-                Info, AtomicGoal, Goal)
-        )
-    ;
-        error("read_goal: invalid goal type")
-    ).
-
-:- pred read_atomic_info(var_num_rep::in, bytecode::in, label_layout::in,
-    int::in, int::out, read_proc_rep_info::in, atomic_goal_rep::in,
-    goal_rep::out) is det.
-
-read_atomic_info(VarNumRep, Bytecode, Label, !Pos, Info, AtomicGoal, Goal) :-
-    read_byte(Bytecode, !Pos, DetismByte),
-    ( determinism_representation(DetismPrime, DetismByte) ->
-        Detism = DetismPrime
-    ;
-        error("read_atomic_info: bad detism")
-    ),
-    read_string(Bytecode, Label, !Pos, FileName0),
-    ( FileName0 = "" ->
-        FileName = Info ^ filename
-    ;
-        FileName = FileName0
-    ),
-    read_lineno(Bytecode, !Pos, LineNo),
-    read_vars(VarNumRep, Bytecode, !Pos, BoundVars),
-    Goal = atomic_goal_rep(Detism, FileName, LineNo, BoundVars, AtomicGoal).
-
-:- pred read_goals(var_num_rep::in, bytecode::in, label_layout::in, int::in,
-    int::out, read_proc_rep_info::in, list(goal_rep)::out) is det.
-
-read_goals(VarNumRep, Bytecode, Label, !Pos, Info, Goals) :-
-    read_length(Bytecode, !Pos, Len),
-    read_goals_2(VarNumRep, Bytecode, Label, !Pos, Info, Len, Goals).
-
-:- pred read_goals_2(var_num_rep::in, bytecode::in, label_layout::in, int::in,
-    int::out, read_proc_rep_info::in, int::in, list(goal_rep)::out) is det.
-
-read_goals_2(VarNumRep, Bytecode, Label, !Pos, Info, N, Goals) :-
-    ( N > 0 ->
-        read_goal(VarNumRep, Bytecode, Label, !Pos, Info, Head),
-        read_goals_2(VarNumRep, Bytecode, Label, !Pos, Info, N - 1, Tail),
-        Goals = [Head | Tail]
-    ;
-        Goals = []
-    ).
-
-:- pred read_vars(var_num_rep::in, bytecode::in, int::in, int::out,
-    list(var_rep)::out) is det.
-
-read_vars(VarNumRep, Bytecode, !Pos, Vars) :-
-    read_length(Bytecode, !Pos, Len),
-    read_vars_2(VarNumRep, Bytecode, Len, !Pos, Vars).
-
-:- pred read_vars_2(var_num_rep::in, bytecode::in, int::in, int::in, int::out,
-    list(var_rep)::out) is det.
-
-read_vars_2(VarNumRep, Bytecode, N, !Pos, Vars) :-
-    ( N > 0 ->
-        read_var(VarNumRep, Bytecode, !Pos, Head),
-        read_vars_2(VarNumRep, Bytecode, N - 1, !Pos, Tail),
-        Vars = [Head | Tail]
-    ;
-        Vars = []
-    ).
-
-:- pred read_maybe_vars(var_num_rep::in, bytecode::in, int::in, int::out,
-    list(maybe(var_rep))::out) is det.
-
-read_maybe_vars(VarNumRep, Bytecode, !Pos, MaybeVars) :-
-    read_length(Bytecode, !Pos, Len),
-    read_maybe_vars_2(VarNumRep, Bytecode, Len, !Pos, MaybeVars).
-
-:- pred read_maybe_vars_2(var_num_rep::in, bytecode::in, int::in, int::in,
-    int::out, list(maybe(var_rep))::out) is det.
-
-read_maybe_vars_2(VarNumRep, Bytecode, N, !Pos, MaybeVars) :-
-    ( N > 0 ->
-        read_byte(Bytecode, !Pos, YesOrNo),
-        ( YesOrNo = 1 ->
-            read_var(VarNumRep, Bytecode, !Pos, Head),
-            MaybeHead = yes(Head)
-        ; YesOrNo = 0 ->
-            MaybeHead = no
-        ; throw(internal_error("read_maybe_vars_2",
-            "invalid yes or no flag"))
-        ),
-        read_maybe_vars_2(VarNumRep, Bytecode, N - 1, !Pos, Tail),
-        MaybeVars = [MaybeHead | Tail]
-    ;
-        MaybeVars = []
-    ).
-
-:- pred read_var(var_num_rep::in, bytecode::in, int::in, int::out,
-    var_rep::out) is det.
-
-read_var(VarNumRep, Bytecode, !Pos, Var) :-
-    (
-        VarNumRep = byte,
-        read_byte(Bytecode, !Pos, Var)
-    ;
-        VarNumRep = short,
-        read_short(Bytecode, !Pos, Var)
-    ).
-
-:- pred read_length(bytecode::in, int::in, int::out, var_rep::out) is det.
-
-read_length(Bytecode, !Pos, Len) :-
-    read_short(Bytecode, !Pos, Len).
-
-:- pred read_lineno(bytecode::in, int::in, int::out, var_rep::out) is det.
-
-read_lineno(Bytecode, !Pos, LineNo) :-
-    read_short(Bytecode, !Pos, LineNo).
-
-:- pred read_method_num(bytecode::in, int::in, int::out, var_rep::out) is det.
-
-read_method_num(Bytecode, !Pos, MethodNum) :-
-    read_short(Bytecode, !Pos, MethodNum).
-
-:- pred read_cons_id(bytecode::in, label_layout::in, int::in, int::out,
-    cons_id_rep::out) is det.
-
-read_cons_id(Bytecode, Label, !Pos, ConsId) :-
-    read_string(Bytecode, Label, !Pos, ConsId).
-
-%-----------------------------------------------------------------------------%
-
-:- pred read_byte(bytecode::in, int::in, int::out, int::out) is det.
-
-:- pragma foreign_proc("C",
-    read_byte(Bytecode::in, Pos0::in, Pos::out, Value::out),
-    [will_not_call_mercury, thread_safe, promise_pure],
-"
-    Value = Bytecode[Pos0];
-    Pos = Pos0 + 1;
-").
-
-:- pred read_short(bytecode::in, int::in, int::out, int::out) is det.
-
-:- pragma foreign_proc("C",
-    read_short(Bytecode::in, Pos0::in, Pos::out, Value::out),
-    [will_not_call_mercury, thread_safe, promise_pure],
-"
-    Value = (Bytecode[Pos0] << 8) + Bytecode[Pos0+1];
-    Pos = Pos0 + 2;
-").
-
-:- pred read_int32(bytecode::in, int::in, int::out, int::out) is det.
-
-:- pragma foreign_proc("C",
-    read_int32(Bytecode::in, Pos0::in, Pos::out, Value::out),
-    [will_not_call_mercury, thread_safe, promise_pure],
-"
-    Value = (Bytecode[Pos0] << 24) + (Bytecode[Pos0+1] << 16) +
-        (Bytecode[Pos0+2] << 8) + Bytecode[Pos0+3];
-    Pos = Pos0 + 4;
-").
-
-:- pred read_string(bytecode::in, label_layout::in, int::in, int::out,
-    string::out) is det.
-
-:- pragma foreign_proc("C",
-    read_string(Bytecode::in, Label::in, Pos0::in, Pos::out, Value::out),
-    [will_not_call_mercury, thread_safe, promise_pure],
-"
-    int         offset;
-    const char  *str;
-
-    offset = (Bytecode[Pos0] << 24) + (Bytecode[Pos0+1] << 16) +
-        (Bytecode[Pos0+2] << 8) + Bytecode[Pos0+3];
-    Pos = Pos0 + 4;
-    str = Label->MR_sll_entry->MR_sle_module_layout->MR_ml_string_table
-        + offset;
-    MR_make_aligned_string(Value, str);
-").
-
-:- pred read_var_num_rep(bytecode::in, int::in, int::out, var_num_rep::out)
-    is det.
-
-read_var_num_rep(Bytecode, !Pos, VarNumRep) :-
-    read_byte(Bytecode, !Pos, Byte),
-    ( var_num_rep_byte(VarNumRep0, Byte) ->
-        VarNumRep = VarNumRep0
-    ;
-        error("read_var_num_rep: unknown var_num_rep")
-    ).
-
-%-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing debian/patches
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/base64
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/fixed
cvs diff: Diffing extras/gator
cvs diff: Diffing extras/gator/generations
cvs diff: Diffing extras/gator/generations/1
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_allegro
cvs diff: Diffing extras/graphics/mercury_allegro/examples
cvs diff: Diffing extras/graphics/mercury_allegro/samples
cvs diff: Diffing extras/graphics/mercury_allegro/samples/demo
cvs diff: Diffing extras/graphics/mercury_allegro/samples/mandel
cvs diff: Diffing extras/graphics/mercury_allegro/samples/pendulum2
cvs diff: Diffing extras/graphics/mercury_allegro/samples/speed
cvs diff: Diffing extras/graphics/mercury_glut
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/gears
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/log4m
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/mopenssl
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/net
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/posix/samples
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/solver_types
cvs diff: Diffing extras/solver_types/library
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/windows_installer_generator
cvs diff: Diffing extras/windows_installer_generator/sample
cvs diff: Diffing extras/windows_installer_generator/sample/images
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing extras/xml_stylesheets
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing mdbcomp
Index: mdbcomp/program_representation.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/mdbcomp/program_representation.m,v
retrieving revision 1.21
diff -u -b -r1.21 program_representation.m
--- mdbcomp/program_representation.m	2 Jul 2007 05:30:32 -0000	1.21
+++ mdbcomp/program_representation.m	26 Jul 2007 05:14:51 -0000
@@ -35,6 +35,7 @@
 :- interface.
 
 :- import_module mdbcomp.prim_data.
+:- import_module mdbcomp.rtti_access.
 
 :- import_module bool.
 :- import_module char.
@@ -282,11 +283,11 @@
     % goal_paths, this list is in top-down order.
 :- type term_path ==    list(int).
 
-    % Returns type_of(_ `with_type` proc_rep), for use in C code.
+    % Returns type_of(_ : proc_rep), for use in C code.
     %
 :- func proc_rep_type = type_desc.
 
-    % Returns type_of(_ `with_type` goal_rep), for use in C code.
+    % Returns type_of(_ : goal_rep), for use in C code.
     %
 :- func goal_rep_type = type_desc.
 
@@ -330,7 +331,7 @@
 
 :- func goal_type_to_byte(bytecode_goal_type) = int.
 
-:- func byte_to_goal_type(int) = bytecode_goal_type is semidet.
+:- pred byte_to_goal_type(int::in, bytecode_goal_type::out) is semidet.
 
     % A variable number is represented in a byte if there are no more than
     % 255 variables in the procedure.  Otherwise a short is used.
@@ -343,6 +344,19 @@
 :- mode var_num_rep_byte(in, out) is det.
 :- mode var_num_rep_byte(out, in) is semidet.
 
+%-----------------------------------------------------------------------------%
+
+:- type bytecode
+    --->    dummy_bytecode.
+
+:- pragma foreign_type("C", bytecode, "const MR_uint_least8_t *",
+    [can_pass_as_mercury_type, stable]).
+:- pragma foreign_type("Java", bytecode, "java.lang.Object", []). %stub only
+
+:- pred read_proc_rep(bytecode::in, label_layout::in, proc_rep::out) is det.
+
+%-----------------------------------------------------------------------------%
+
     % Some predicates that operate on polymorphic values do not need
     % the type_infos describing the types bound to the variables.
     % It is of course faster not to pass type_infos to such predicates
@@ -370,6 +384,8 @@
 :- implementation.
 
 :- import_module char.
+:- import_module exception.
+:- import_module int.
 :- import_module require.
 :- import_module string.
 
@@ -444,11 +460,11 @@
 
 :- pragma export(proc_rep_type = out, "ML_proc_rep_type").
 
-proc_rep_type = type_of(_ `with_type` proc_rep).
+proc_rep_type = type_of(_ : proc_rep).
 
 :- pragma export(goal_rep_type = out, "ML_goal_rep_type").
 
-goal_rep_type = type_of(_ `with_type` goal_rep).
+goal_rep_type = type_of(_ : goal_rep).
 
 %-----------------------------------------------------------------------------%
 
@@ -542,7 +558,7 @@
 goal_type_to_byte(Type) = TypeInt :-
     goal_type_byte(TypeInt, Type).
 
-byte_to_goal_type(TypeInt) = Type :-
+byte_to_goal_type(TypeInt, Type) :-
     goal_type_byte(TypeInt, Type).
 
 :- pred goal_type_byte(int, bytecode_goal_type).
@@ -576,6 +592,354 @@
 
 %-----------------------------------------------------------------------------%
 
+:- pragma foreign_export("C", read_proc_rep(in, in, out),
+    "MR_MDBCOMP_trace_read_rep").
+
+read_proc_rep(Bytecode, Label, ProcRep) :-
+    some [!Pos] (
+        !:Pos = 0,
+        read_int32(Bytecode, !Pos, Limit),
+        read_var_num_rep(Bytecode, !Pos, VarNumRep),
+        read_string(Bytecode, Label, !Pos, FileName),
+        Info = read_proc_rep_info(Limit, FileName),
+        read_vars(VarNumRep, Bytecode, !Pos, HeadVars),
+        read_goal(VarNumRep, Bytecode, Label, !Pos, Info, Goal),
+        ProcRep = proc_rep(HeadVars, Goal),
+        require(unify(!.Pos, Limit), "read_proc_rep: limit mismatch")
+    ).
+
+:- type read_proc_rep_info
+    --->    read_proc_rep_info(
+                limit       :: int,
+                filename    :: string
+            ).
+
+:- pred read_goal(var_num_rep::in, bytecode::in, label_layout::in, int::in,
+    int::out, read_proc_rep_info::in, goal_rep::out) is det.
+
+read_goal(VarNumRep, Bytecode, Label, !Pos, Info, Goal) :-
+    read_byte(Bytecode, !Pos, GoalTypeByte),
+    ( byte_to_goal_type(GoalTypeByte, GoalType) ->
+        (
+            GoalType = goal_conj,
+            read_goals(VarNumRep, Bytecode, Label, !Pos, Info,  Goals),
+            Goal = conj_rep(Goals)
+        ;
+            GoalType = goal_disj,
+            read_goals(VarNumRep, Bytecode, Label, !Pos, Info, Goals),
+            Goal = disj_rep(Goals)
+        ;
+            GoalType = goal_neg,
+            read_goal(VarNumRep, Bytecode, Label, !Pos, Info, SubGoal),
+            Goal = negation_rep(SubGoal)
+        ;
+            GoalType = goal_ite,
+            read_goal(VarNumRep, Bytecode, Label, !Pos, Info, Cond),
+            read_goal(VarNumRep, Bytecode, Label, !Pos, Info, Then),
+            read_goal(VarNumRep, Bytecode, Label, !Pos, Info, Else),
+            Goal = ite_rep(Cond, Then, Else)
+        ;
+            GoalType = goal_switch,
+            read_goals(VarNumRep, Bytecode, Label, !Pos, Info, Goals),
+            Goal = switch_rep(Goals)
+        ;
+            GoalType = goal_assign,
+            read_var(VarNumRep, Bytecode, !Pos, Target),
+            read_var(VarNumRep, Bytecode, !Pos, Source),
+            AtomicGoal = unify_assign_rep(Target, Source),
+            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
+                Info, AtomicGoal, Goal)
+        ;
+            GoalType = goal_construct,
+            read_var(VarNumRep, Bytecode, !Pos, Var),
+            read_cons_id(Bytecode, Label, !Pos, ConsId),
+            read_vars(VarNumRep, Bytecode, !Pos, ArgVars),
+            AtomicGoal = unify_construct_rep(Var, ConsId, ArgVars),
+            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
+                Info, AtomicGoal, Goal)
+        ;
+            GoalType = goal_deconstruct,
+            read_var(VarNumRep, Bytecode, !Pos, Var),
+            read_cons_id(Bytecode, Label, !Pos, ConsId),
+            read_vars(VarNumRep, Bytecode, !Pos, ArgVars),
+            AtomicGoal = unify_deconstruct_rep(Var, ConsId, ArgVars),
+            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
+                Info, AtomicGoal, Goal)
+        ;
+            GoalType = goal_partial_construct,
+            read_var(VarNumRep, Bytecode, !Pos, Var),
+            read_cons_id(Bytecode, Label, !Pos, ConsId),
+            read_maybe_vars(VarNumRep, Bytecode, !Pos, MaybeVars),
+            AtomicGoal = partial_construct_rep(Var, ConsId, MaybeVars),
+            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
+                Info, AtomicGoal, Goal)
+        ;
+            GoalType = goal_partial_deconstruct,
+            read_var(VarNumRep, Bytecode, !Pos, Var),
+            read_cons_id(Bytecode, Label, !Pos, ConsId),
+            read_maybe_vars(VarNumRep, Bytecode, !Pos, MaybeVars),
+            AtomicGoal = partial_deconstruct_rep(Var, ConsId, MaybeVars),
+            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
+                Info, AtomicGoal, Goal)
+        ;
+            GoalType = goal_simple_test,
+            read_var(VarNumRep, Bytecode, !Pos, Var1),
+            read_var(VarNumRep, Bytecode, !Pos, Var2),
+            AtomicGoal = unify_simple_test_rep(Var1, Var2),
+            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
+                Info, AtomicGoal, Goal)
+        ;
+            GoalType = goal_scope,
+            read_byte(Bytecode, !Pos, MaybeCutByte),
+            ( MaybeCutByte = 0 ->
+                MaybeCut = scope_is_no_cut
+            ; MaybeCutByte = 1 ->
+                MaybeCut = scope_is_cut
+            ;
+                error("read_goal: bad maybe_cut")
+            ),
+            read_goal(VarNumRep, Bytecode, Label, !Pos, Info, SubGoal),
+            Goal = scope_rep(SubGoal, MaybeCut)
+        ;
+            GoalType = goal_ho_call,
+            read_var(VarNumRep, Bytecode, !Pos, Var),
+            read_vars(VarNumRep, Bytecode, !Pos, Args),
+            AtomicGoal = higher_order_call_rep(Var, Args),
+            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
+                Info, AtomicGoal, Goal)
+        ;
+            GoalType = goal_method_call,
+            read_var(VarNumRep, Bytecode, !Pos, Var),
+            read_method_num(Bytecode, !Pos, MethodNum),
+            read_vars(VarNumRep, Bytecode, !Pos, Args),
+            AtomicGoal = method_call_rep(Var, MethodNum, Args),
+            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
+                Info, AtomicGoal, Goal)
+        ;
+            GoalType = goal_cast,
+            read_var(VarNumRep, Bytecode, !Pos, OutputVar),
+            read_var(VarNumRep, Bytecode, !Pos, InputVar),
+            AtomicGoal = cast_rep(OutputVar, InputVar),
+            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
+                Info, AtomicGoal, Goal)
+        ;
+            GoalType = goal_plain_call,
+            read_string(Bytecode, Label, !Pos, ModuleName),
+            read_string(Bytecode, Label, !Pos, PredName),
+            read_vars(VarNumRep, Bytecode, !Pos, Args),
+            AtomicGoal = plain_call_rep(ModuleName, PredName, Args),
+            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
+                Info, AtomicGoal, Goal)
+        ;
+            GoalType = goal_builtin_call,
+            read_string(Bytecode, Label, !Pos, ModuleName),
+            read_string(Bytecode, Label, !Pos, PredName),
+            read_vars(VarNumRep, Bytecode, !Pos, Args),
+            AtomicGoal = builtin_call_rep(ModuleName, PredName, Args),
+            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
+                Info, AtomicGoal, Goal)
+        ;
+            GoalType = goal_event_call,
+            read_string(Bytecode, Label, !Pos, EventName),
+            read_vars(VarNumRep, Bytecode, !Pos, Args),
+            AtomicGoal = event_call_rep(EventName, Args),
+            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
+                Info, AtomicGoal, Goal)
+        ;
+            GoalType = goal_foreign,
+            read_vars(VarNumRep, Bytecode, !Pos, Args),
+            AtomicGoal = pragma_foreign_code_rep(Args),
+            read_atomic_info(VarNumRep, Bytecode, Label, !Pos,
+                Info, AtomicGoal, Goal)
+        )
+    ;
+        error("read_goal: invalid goal type")
+    ).
+
+:- pred read_atomic_info(var_num_rep::in, bytecode::in, label_layout::in,
+    int::in, int::out, read_proc_rep_info::in, atomic_goal_rep::in,
+    goal_rep::out) is det.
+
+read_atomic_info(VarNumRep, Bytecode, Label, !Pos, Info, AtomicGoal, Goal) :-
+    read_byte(Bytecode, !Pos, DetismByte),
+    ( determinism_representation(DetismPrime, DetismByte) ->
+        Detism = DetismPrime
+    ;
+        error("read_atomic_info: bad detism")
+    ),
+    read_string(Bytecode, Label, !Pos, FileName0),
+    ( FileName0 = "" ->
+        FileName = Info ^ filename
+    ;
+        FileName = FileName0
+    ),
+    read_lineno(Bytecode, !Pos, LineNo),
+    read_vars(VarNumRep, Bytecode, !Pos, BoundVars),
+    Goal = atomic_goal_rep(Detism, FileName, LineNo, BoundVars, AtomicGoal).
+
+:- pred read_goals(var_num_rep::in, bytecode::in, label_layout::in, int::in,
+    int::out, read_proc_rep_info::in, list(goal_rep)::out) is det.
+
+read_goals(VarNumRep, Bytecode, Label, !Pos, Info, Goals) :-
+    read_length(Bytecode, !Pos, Len),
+    read_goals_2(VarNumRep, Bytecode, Label, !Pos, Info, Len, Goals).
+
+:- pred read_goals_2(var_num_rep::in, bytecode::in, label_layout::in, int::in,
+    int::out, read_proc_rep_info::in, int::in, list(goal_rep)::out) is det.
+
+read_goals_2(VarNumRep, Bytecode, Label, !Pos, Info, N, Goals) :-
+    ( N > 0 ->
+        read_goal(VarNumRep, Bytecode, Label, !Pos, Info, Head),
+        read_goals_2(VarNumRep, Bytecode, Label, !Pos, Info, N - 1, Tail),
+        Goals = [Head | Tail]
+    ;
+        Goals = []
+    ).
+
+:- pred read_vars(var_num_rep::in, bytecode::in, int::in, int::out,
+    list(var_rep)::out) is det.
+
+read_vars(VarNumRep, Bytecode, !Pos, Vars) :-
+    read_length(Bytecode, !Pos, Len),
+    read_vars_2(VarNumRep, Bytecode, Len, !Pos, Vars).
+
+:- pred read_vars_2(var_num_rep::in, bytecode::in, int::in, int::in, int::out,
+    list(var_rep)::out) is det.
+
+read_vars_2(VarNumRep, Bytecode, N, !Pos, Vars) :-
+    ( N > 0 ->
+        read_var(VarNumRep, Bytecode, !Pos, Head),
+        read_vars_2(VarNumRep, Bytecode, N - 1, !Pos, Tail),
+        Vars = [Head | Tail]
+    ;
+        Vars = []
+    ).
+
+:- pred read_maybe_vars(var_num_rep::in, bytecode::in, int::in, int::out,
+    list(maybe(var_rep))::out) is det.
+
+read_maybe_vars(VarNumRep, Bytecode, !Pos, MaybeVars) :-
+    read_length(Bytecode, !Pos, Len),
+    read_maybe_vars_2(VarNumRep, Bytecode, Len, !Pos, MaybeVars).
+
+:- pred read_maybe_vars_2(var_num_rep::in, bytecode::in, int::in, int::in,
+    int::out, list(maybe(var_rep))::out) is det.
+
+read_maybe_vars_2(VarNumRep, Bytecode, N, !Pos, MaybeVars) :-
+    ( N > 0 ->
+        read_byte(Bytecode, !Pos, YesOrNo),
+        ( YesOrNo = 1 ->
+            read_var(VarNumRep, Bytecode, !Pos, Head),
+            MaybeHead = yes(Head)
+        ; YesOrNo = 0 ->
+            MaybeHead = no
+        ;
+            error("read_maybe_vars_2: invalid yes or no flag")
+        ),
+        read_maybe_vars_2(VarNumRep, Bytecode, N - 1, !Pos, Tail),
+        MaybeVars = [MaybeHead | Tail]
+    ;
+        MaybeVars = []
+    ).
+
+:- pred read_var(var_num_rep::in, bytecode::in, int::in, int::out,
+    var_rep::out) is det.
+
+read_var(VarNumRep, Bytecode, !Pos, Var) :-
+    (
+        VarNumRep = byte,
+        read_byte(Bytecode, !Pos, Var)
+    ;
+        VarNumRep = short,
+        read_short(Bytecode, !Pos, Var)
+    ).
+
+:- pred read_length(bytecode::in, int::in, int::out, var_rep::out) is det.
+
+read_length(Bytecode, !Pos, Len) :-
+    read_short(Bytecode, !Pos, Len).
+
+:- pred read_lineno(bytecode::in, int::in, int::out, var_rep::out) is det.
+
+read_lineno(Bytecode, !Pos, LineNo) :-
+    read_short(Bytecode, !Pos, LineNo).
+
+:- pred read_method_num(bytecode::in, int::in, int::out, var_rep::out) is det.
+
+read_method_num(Bytecode, !Pos, MethodNum) :-
+    read_short(Bytecode, !Pos, MethodNum).
+
+:- pred read_cons_id(bytecode::in, label_layout::in, int::in, int::out,
+    cons_id_rep::out) is det.
+
+read_cons_id(Bytecode, Label, !Pos, ConsId) :-
+    read_string(Bytecode, Label, !Pos, ConsId).
+
+%-----------------------------------------------------------------------------%
+
+:- pred read_byte(bytecode::in, int::in, int::out, int::out) is det.
+
+:- pragma foreign_proc("C",
+    read_byte(Bytecode::in, Pos0::in, Pos::out, Value::out),
+    [will_not_call_mercury, thread_safe, promise_pure],
+"
+    Value = Bytecode[Pos0];
+    Pos = Pos0 + 1;
+").
+
+:- pred read_short(bytecode::in, int::in, int::out, int::out) is det.
+
+:- pragma foreign_proc("C",
+    read_short(Bytecode::in, Pos0::in, Pos::out, Value::out),
+    [will_not_call_mercury, thread_safe, promise_pure],
+"
+    Value = (Bytecode[Pos0] << 8) + Bytecode[Pos0+1];
+    Pos = Pos0 + 2;
+").
+
+:- pred read_int32(bytecode::in, int::in, int::out, int::out) is det.
+
+:- pragma foreign_proc("C",
+    read_int32(Bytecode::in, Pos0::in, Pos::out, Value::out),
+    [will_not_call_mercury, thread_safe, promise_pure],
+"
+    Value = (Bytecode[Pos0] << 24) + (Bytecode[Pos0+1] << 16) +
+        (Bytecode[Pos0+2] << 8) + Bytecode[Pos0+3];
+    Pos = Pos0 + 4;
+").
+
+:- pred read_string(bytecode::in, label_layout::in, int::in, int::out,
+    string::out) is det.
+
+:- pragma foreign_proc("C",
+    read_string(Bytecode::in, Label::in, Pos0::in, Pos::out, Value::out),
+    [will_not_call_mercury, thread_safe, promise_pure],
+"
+    int         offset;
+    const char  *str;
+
+    offset = (Bytecode[Pos0] << 24) + (Bytecode[Pos0+1] << 16) +
+        (Bytecode[Pos0+2] << 8) + Bytecode[Pos0+3];
+    Pos = Pos0 + 4;
+    str = Label->MR_sll_entry->MR_sle_module_layout->MR_ml_string_table
+        + offset;
+    MR_make_aligned_string(Value, str);
+").
+
+:- pred read_var_num_rep(bytecode::in, int::in, int::out, var_num_rep::out)
+    is det.
+
+read_var_num_rep(Bytecode, !Pos, VarNumRep) :-
+    read_byte(Bytecode, !Pos, Byte),
+    ( var_num_rep_byte(VarNumRep0, Byte) ->
+        VarNumRep = VarNumRep0
+    ;
+        error("read_var_num_rep: unknown var_num_rep")
+    ).
+
+%-----------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
+
 no_type_info_builtin(ModuleName, PredName, Arity) :-
     no_type_info_builtin_2(ModuleNameType, PredName, Arity),
     (
Index: mdbcomp/slice_and_dice.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/mdbcomp/slice_and_dice.m,v
retrieving revision 1.14
diff -u -b -r1.14 slice_and_dice.m
--- mdbcomp/slice_and_dice.m	19 Jan 2007 07:05:05 -0000	1.14
+++ mdbcomp/slice_and_dice.m	26 Jul 2007 05:00:11 -0000
@@ -271,7 +271,7 @@
 % mechanism for reading in slices above.
 
 :- pragma foreign_export("C", read_dice(in, in, out, di, uo),
-    "MR_MDB_read_dice").
+    "MR_MDBCOMP_read_dice").
 
 read_dice(PassFile, FailFile, Result, !IO) :-
     read_trace_counts_source(PassFile, ReadPassResult, !IO),
@@ -301,7 +301,7 @@
 	is det.
 
 :- pragma foreign_export("C", maybe_dice_error_to_problem_string(in, out),
-	"MR_DD_maybe_dice_error_to_problem_string").
+	"MR_MDBCOMP_maybe_dice_error_to_problem_string").
 
 maybe_dice_error_to_problem_string(ok(_), "").
 maybe_dice_error_to_problem_string(error(ErrorStr), ErrorStr).
@@ -309,7 +309,7 @@
 :- pred det_maybe_dice_error_to_dice(maybe_error(dice)::in, dice::out) is det.
 
 :- pragma foreign_export("C", det_maybe_dice_error_to_dice(in, out),
-	"MR_DD_det_maybe_dice_error_to_dice").
+	"MR_MDBCOMP_det_maybe_dice_error_to_dice").
 
 det_maybe_dice_error_to_dice(ok(Dice), Dice).
 det_maybe_dice_error_to_dice(error(_), _) :-
@@ -586,7 +586,7 @@
 
 :- pragma foreign_export("C",
     read_dice_to_string_no_limit(in, in, in, in, in, out, out, di, uo),
-    "MR_MDB_read_dice_to_string").
+    "MR_MDBCOMP_read_dice_to_string").
 
 :- pred read_dice_to_string_no_limit(string::in, string::in, string::in,
     int::in, string::in, string::out, string::out, io::di, io::uo) is det.
@@ -834,7 +834,7 @@
 
 :- pragma foreign_export("C",
     get_suspicion_for_label_layout(in, in) = out,
-	"MR_DD_get_suspicion_for_label_layout").
+	"MR_MDBCOMP_get_suspicion_for_label_layout").
 
 get_suspicion_for_label_layout(Dice, LabelLayout) = Suspicion :-
 	ProcLayout = get_proc_layout_from_label_layout(LabelLayout),
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/standalone_c
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/solver_types
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing slice
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/par_conj
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/trailing
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
Index: trace/mercury_trace_cmd_browsing.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_browsing.c,v
retrieving revision 1.5
diff -u -b -r1.5 mercury_trace_cmd_browsing.c
--- trace/mercury_trace_cmd_browsing.c	5 Dec 2006 03:51:20 -0000	1.5
+++ trace/mercury_trace_cmd_browsing.c	26 Jul 2007 05:26:07 -0000
@@ -554,7 +554,7 @@
                 problem = "current procedure has no body bytecodes";
             } else {
                 MR_TRACE_CALL_MERCURY(
-                    MR_DD_trace_read_rep(entry->MR_sle_body_bytes,
+                    MR_MDBCOMP_trace_read_rep(entry->MR_sle_body_bytes,
                         event_info->MR_event_sll, &rep);
                 );
 
@@ -766,7 +766,7 @@
     }
 
     MR_TRACE_CALL_MERCURY(
-        MR_DD_trace_read_rep(entry->MR_sle_body_bytes,
+        MR_MDBCOMP_trace_read_rep(entry->MR_sle_body_bytes,
             event_info->MR_event_sll, &rep);
     );
 
Index: trace/mercury_trace_cmd_exp.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_exp.c,v
retrieving revision 1.2
diff -u -b -r1.2 mercury_trace_cmd_exp.c
--- trace/mercury_trace_cmd_exp.c	29 Nov 2006 05:18:35 -0000	1.2
+++ trace/mercury_trace_cmd_exp.c	26 Jul 2007 05:24:03 -0000
@@ -248,7 +248,7 @@
     );
 
     MR_TRACE_CALL_MERCURY(
-        MR_MDB_read_dice_to_string(aligned_pass_trace_counts_file,
+        MR_MDBCOMP_read_dice_to_string(aligned_pass_trace_counts_file,
             aligned_fail_trace_count_file, aligned_sort_str,
             number_of_lines, aligned_module, &dice, &problem);
     );
Index: trace/mercury_trace_declarative.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_declarative.c,v
retrieving revision 1.111
diff -u -b -r1.111 mercury_trace_declarative.c
--- trace/mercury_trace_declarative.c	7 Jun 2007 06:53:54 -0000	1.111
+++ trace/mercury_trace_declarative.c	26 Jul 2007 05:25:40 -0000
@@ -2268,17 +2268,17 @@
     );
 
     MR_TRACE_CALL_MERCURY(
-        MR_MDB_read_dice(
+        MR_MDBCOMP_read_dice(
             aligned_pass_trace_counts_file,
             aligned_fail_trace_counts_file,
             &maybe_dice);
-        MR_DD_maybe_dice_error_to_problem_string(maybe_dice, problem);
+        MR_MDBCOMP_maybe_dice_error_to_problem_string(maybe_dice, problem);
     );
     if (! MR_streq(*problem, "")) {
         return MR_FALSE;
     } else {
         MR_TRACE_CALL_MERCURY(
-            MR_DD_det_maybe_dice_error_to_dice(maybe_dice, &dice);
+            MR_MDBCOMP_det_maybe_dice_error_to_dice(maybe_dice, &dice);
         );
     }
 
@@ -2306,7 +2306,7 @@
                 table_cell = &(module->MR_ml_label_exec_count[label_index]);
                 MR_TRACE_CALL_MERCURY(
                     f_suspicion =
-                        MR_DD_get_suspicion_for_label_layout(dice, label);
+                        MR_MDBCOMP_get_suspicion_for_label_layout(dice, label);
                 );
                 /*
                 ** Instead of using a ratio between 0 and 1 we store an integer
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list