Files
mercury/compiler/structure_reuse.m
Zoltan Somogyi 9ad83d648d Convert predicates that used to have one clause for each kind of
Estimated hours taken: 12
Branches: main

compiler/*.m:
	Convert predicates that used to have one clause for each kind of
	HLDS goal into explicit disjunctions, since this gives the debugger
	a meaningful name for each argument. In some cases, this exposed
	arguments that were used by *no* clause. In other cases, it allowed
	factoring out common code, as well as code that *should* have been
	common but wasn't.

	Put the disjuncts in a meaningful order. In too many cases, they were
	almost random.

	Merge the resulting predicates into their parents, in places where
	the Prolog indexing one could get from separate clauses was the only
	reason for separating those predicates from their parents in the first
	place. Similarly, merge child predicates handling generic call kinds
	and such back into the main predicate where this improves clarity.
	In some cases, this allows putting the extraction of hlds_goal_expr
	from a hlds_goal into one place, instead of repeating it in lots of
	places.

	Give some predicates more descriptive names. In some cases, rationalize
	argument order. In some cases, rationalize the order of predicates
	in the module.

	Replace some uses of booleans with purpose-specific types.

	Give some fields names, and put type-identifying prefixes on the names
	of other fields, to make tag files work better.

	In some cases, reorder fields to them put into related groups.

	Use more standard and/or more descriptive variable names

	Use a standard syntax for if-then-else in each module.

	Follow our style convention for comments.
2008-01-21 00:32:55 +00:00

36 lines
1.1 KiB
Mathematica

%-----------------------------------------------------------------------------%
% vim: ft=mercury ts=4 sw=4 et
%-----------------------------------------------------------------------------%
% Copyright (C) 2006, 2008 The University of Melbourne.
% This file may only be copied under the terms of the GNU General
% Public License - see the file COPYING in the Mercury distribution.
%-----------------------------------------------------------------------------%
%
% File: structure_reuse.m.
% Main author: nancy.
%
% Package grouping all the modules related to the structure reuse analysis
% part of compile-time garbage collection.
%
%-----------------------------------------------------------------------------%
:- module transform_hlds.ctgc.structure_reuse.
:- interface.
:- include_module analysis.
:- include_module lfu.
:- include_module lbu.
:- include_module direct.
:- include_module indirect.
:- include_module versions.
% :- include_module util.
:- include_module domain.
:- import_module hlds.
:- import_module transform_hlds.ctgc.structure_sharing.
:- import_module check_hlds.
:- end_module transform_hlds.ctgc.structure_reuse.