Files
mercury/scripts/Mmake.vars.in
Simon Taylor 18430aaef1 Aditi compilation.
Estimated hours taken: 1200

Aditi compilation.

compiler/options.m:
	The documentation for these is commented out because the Aditi
	system is not currently useful to the general public.
	--aditi: enable Aditi compilation.
	--dump-rl: write the intermediate RL to `<module>.rl_dump'.
	--dump-rl-bytecode: write a text version of the bytecodes
		to `<module>.rla'
	--aditi-only: don't produce a `.c' file.
	--filenames-from-stdin: accept a list of filenames to compile
		from stdin. This is used by the query shell.
	--optimize-rl, --optimize-rl-cse, --optimize-rl-invariants,
	--optimize-rl-index, --detect-rl-streams:
		Options to control RL optimization passes.
	--aditi-user:
		Default owner of any Aditi procedures,
		defaults to $USER or "guest".
	--generate-schemas:
		write schemas for base relations to `<module>'.base_schema
		and schemas for derived relations to `<module>'.derived_schema.
		This is used by the query shell.

compiler/handle_options.m:
	Handle the default for --aditi-user.

compiler/hlds_pred.m:
compiler/prog_data.m:
compiler/prog_io_pragma.m:
compiler/make_hlds.m:
	Add some Aditi pragma declarations - `aditi', `supp_magic', `context',
	`naive', `psn' (predicate semi-naive), `aditi_memo', `aditi_no_memo',
	`base_relation', `owner' and `index'.
	Separate out code to parse a predicate name and arity.

compiler/hlds_pred.m:
	Add predicates to identify Aditi procedures.
	Added markers `generate_inline' and `aditi_interface', which
	are used internally for Aditi code generation.
	Add an `owner' field to pred_infos, which is used for database
	security checks.
	Add a field to pred_infos to hold the list of indexes for a base
	relation.

compiler/make_hlds.m:
	Some pragmas must be exported if the corresponding predicates
	are exported, check this.
	Make sure stratification of Aditi procedures is checked.
	Predicates with a mode declaration but no type declaration
	are no longer assumed to be local.
	Set the `do_aditi_compilation' field of the module_info if there
	are any local Aditi procedures or base relations.
	Check that `--aditi' is set if Aditi compilation is required.

compiler/post_typecheck.m:
	Check that every Aditi predicate has an `aditi__state' argument,
	which is used to ensure sequencing of updates and that Aditi
	procedures are only called within transactions.

compiler/dnf.m:
	Changed the definition of disjunctive normal form slightly
	so that a call followed by some atomic goals not including
	any database calls is considered atomic. magic.m can handle
	this kind of goal, and it results in more efficient RL code.

compiler/hlds_module.m:
compiler/dependency_graph.m:
	Added dependency_graph__get_scc_entry_points which finds
	the procedures in an SCC which could be called from outside.
	Added a new field to the dependency_info, the
	aditi_dependency_ordering. This contains all Aditi SCCs of
	the original program, with multiple SCCs merged where
	possible to improve the effectiveness of differential evaluation
	and the low level RL optimizations.

compiler/hlds_module.m:
	Add a field to record whether there are any local Aditi procedures
	in the current module.
	Added versions of module_info_pred_proc_info and
	module_info_set_pred_proc_info which take a pred_proc_id,
	not a separate pred_id and proc_id.

compiler/polymorphism.m:
compiler/lambda.m:
	Make sure that predicates created for closures in Aditi procedures
	have the correct markers.

compiler/goal_util.m:
	Added goal_util__switch_to_disjunction,
	goal_util__case_to_disjunct (factored out from simplify.m)
	and goal_util__if_then_else_to_disjunction. These are
	require because supplementary magic sets can't handle
	if-then-elses or switches.

compiler/type_util.m:
	Added type_is_aditi_state/1.

compiler/mode_util.m:
	Added partition_args/5 which partitions a list of arguments
	into inputs and others.

compiler/inlining.m:
	Don't inline memoed procedures.
	Don't inline Aditi procedures into non-Aditi procedures.

compiler/intermod.m:
	Handle Aditi markers.
	Clean up handling of markers which should not appear in `.opt' files.

compiler/simplify.m:
	Export a slightly different interface for use by magic.m.
	Remove explicit quantifications where possible.
	Merge multiple nested quantifications.
	Don't report infinite recursion warnings for Aditi procedures.

compiler/prog_out.m:
	Generalised the code to output a module list to write any list.

compiler/code_gen.m:
compiler/arg_info.m:
	Don't process Aditi procedures.

compiler/mercury_compile.m:
	Call magic.m and rl_gen.m.
	Don't perform the low-level annotation passes on Aditi procedures.
	Remove calls to constraint.m - sometime soon a rewritten version
	will be called directly from deforestation.

compiler/passes_aux.m:
	Add predicates to process only non-Aditi procedures.

compiler/llds.m:
compiler/llds_out.m:
	Added new `code_addr' enum members, do_{det,semidet,nondet}_aditi_call,
	which are defined in extras/aditi/aditi.m.

compiler/call_gen.m:
	Handle generation of do_*_aditi_call.

compiler/llds_out.m:
	Write the RL code for the module as a constant char array
	in the `.c' file.

compiler/term_errors.m:
compiler/error_util.m:
	Move code to describe predicates into error_util.m
	Allow the caller to explicitly add line breaks.
	Added error_util:list_to_pieces to format a list of
	strings.
	Reordered some arguments for currying.

compiler/hlds_out.m:
	Don't try to print clauses if there are none.

runtime/mercury_init.h:
util/mkinit.c:
scripts/c2init.in:
	Added a function `mercury__load_aditi_rl_code()' to the generated
	`<module>_init.c' file which throws all the RL code for the program
	at the database. This should be called at connection time by
	`aditi__connect'.
	Added an option `--aditi' which controls the output
	`mercury__load_aditi_rl_code()'.

compiler/notes/compiler_design.html:
	Document the new files.

Mmakefile:
bindist/Mmakefile:
	Don't distribute extras/aditi yet.

New files:

compiler/magic.m:
compiler/magic_util.m:
	Supplementary magic sets transformation. Report errors
	for constructs that Aditi can't handle.

compiler/context.m:
	Supplementary context transformation.

compiler/rl_gen.m:
compiler/rl_relops.m:
	Aditi code generation.

compiler/rl_info.m:
	Code generator state.

compiler/rl.m:
	Intermediate RL representation.

compiler/rl_util:
	Predicates to collect information about RL instructions.

compiler/rl_dump.m:
	Print out the representation in rl.m.

compiler/rl_opt.m:
	Control low-level RL optimizations.

compiler/rl_block.m:
	Break a procedure into basic blocks.

compiler/rl_analyse.m:
	Generic dataflow analysis for RL procedures.

compiler/rl_liveness.m:
	Make sure all relations are initialised before used, clear
	references to relations that are no longer required.

compiler/rl_loop.m:
	Loop invariant removal.

compiler/rl_block_opt.m:
	CSE and instruction merging on basic blocks.

compiler/rl_key.m:
	Detect upper/lower bounds for which a goal could succeed.

compiler/rl_sort.m:
	Use indexing for joins and projections.
	Optimize away unnecessary sorting and indexing.

compiler/rl_stream.m:
	Detect relations which don't need to be materialised.

compiler/rl_code.m:
	RL bytecode definitions. Automatically generated from the Aditi
	header files.

compiler/rl_out.m:
compiler/rl_file.m:
	Output the RL bytecodes in binary to <module>.rlo (for use by Aditi)
	and in text to <module>.rla (for use by the RL interpreter).
	Also output the schema information if --generate-schemas is set.

compiler/rl_exprn.m:
	Generate bytecodes for join conditions.

extras/aditi/Mmakefile:
extras/aditi/aditi.m:
	Definitions of some Aditi library predicates and the
	interfacing and transaction processing code.
1998-12-06 23:49:14 +00:00

316 lines
9.5 KiB
Plaintext

#-----------------------------------------------------------------------------#
# Copyright (C) 1996-1998 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.
#-----------------------------------------------------------------------------#
# Mmake.vars - variables for building Mercury programs
# This file gives the default values for certain variables.
# The values here can be overridden by individual Mmake files.
# Ensure that commands use /bin/sh not the user's shell
SHELL = /bin/sh
# Set the directory search path.
# (See the GNU Make manual for documentation about VPATH and GPATH.)
MMAKE_VPATH = $(MERCURY_INT_DIR)
VPATH = $(MMAKE_VPATH) # do not remove the `:' from this comment!!!
# the above comment works around a misfeature of
# autoconf which causes it to delete assignments to
# VPATH unless they contain a `:'
GPATH = $(VPATH)
DEFAULT_GRADE = $(MERCURY_DEFAULT_GRADE)
GRADE = $(DEFAULT_GRADE)
ALL_GRADEFLAGS = $(GRADEFLAGS) $(EXTRA_GRADEFLAGS) $(TARGET_GRADEFLAGS)
GRADEFLAGS = --grade $(GRADE)
EXTRA_GRADEFLAGS =
MC = mmc
ALL_MCFLAGS = $(MCFLAGS) $(EXTRA_MCFLAGS) $(TARGET_MCFLAGS)
MCFLAGS =
EXTRA_MCFLAGS =
MCS = $(MC) --split-c-files --compile-only
MCG = $(MC) --compile-to-c
MCD = $(MC) --generate-dependencies
MCI = $(MC) --make-interface
MCPI = $(MC) --make-private-interface
MCSI = $(MC) --make-short-interface
MCOI = $(MC) --make-optimization-interface
MCTOI = $(MC) --make-transitive-optimization-interface
ALL_MCIFLAGS = $(MCIFLAGS) $(EXTRA_MCIFLAGS) $(TARGET_MCFLAGS)
ALL_MCPIFLAGS = $(MCPIFLAGS) $(EXTRA_MCPIFLAGS) $(TARGET_MCFLAGS)
ALL_MCSIFLAGS = $(MCSIFLAGS) $(EXTRA_MCSIFLAGS) $(TARGET_MCFLAGS)
ALL_MCOIFLAGS = $(MCOIFLAGS) $(EXTRA_MCOIFLAGS) $(TARGET_MCFLAGS)
ALL_MCTOIFLAGS = $(MCTOIFLAGS) $(EXTRA_MCTOIFLAGS) $(TARGET_MCFLAGS)
ALL_MCDFLAGS = $(MCDFLAGS) $(EXTRA_MCDFLAGS) $(TARGET_MCFLAGS)
ALL_MCGFLAGS = $(MCGFLAGS) $(EXTRA_MCGFLAGS) $(TARGET_MCFLAGS)
ALL_MCSFLAGS = $(MCSFLAGS) $(EXTRA_MCSFLAGS) $(TARGET_MCFLAGS)
MCIFLAGS = $(MCFLAGS)
MCPIFLAGS = $(MCFLAGS)
MCSIFLAGS = $(MCFLAGS)
MCOIFLAGS = $(MCFLAGS)
MCTOIFLAGS = $(MCFLAGS)
MCDFLAGS = $(MCFLAGS)
MCGFLAGS = $(MCFLAGS)
MCSFLAGS = $(MCFLAGS)
EXTRA_MCIFLAGS = $(EXTRA_MCFLAGS)
EXTRA_MCPIFLAGS = $(EXTRA_MCFLAGS)
EXTRA_MCSIFLAGS = $(EXTRA_MCFLAGS)
EXTRA_MCOIFLAGS = $(EXTRA_MCFLAGS)
EXTRA_MCTOIFLAGS= $(EXTRA_MCFLAGS)
EXTRA_MCDFLAGS = $(EXTRA_MCFLAGS)
EXTRA_MCGFLAGS = $(EXTRA_MCFLAGS)
EXTRA_MCSFLAGS = $(EXTRA_MCFLAGS)
#
# The following variables hold the names of various programs and
# the options which should be passed to them.
#
C2INIT = c2init
ALL_C2INITFLAGS = $(C2INITFLAGS) $(EXTRA_C2INITFLAGS) $(TARGET_C2INITFLAGS)
C2INITFLAGS =
EXTRA_C2INITFLAGS =
MGNUC = mgnuc
ALL_MGNUCFLAGS = $(MGNUCFLAGS) $(EXTRA_MGNUCFLAGS) $(TARGET_MGNUCFLAGS) \
$(ALL_CFLAGS)
MGNUCFLAGS =
EXTRA_MGNUCFLAGS =
ALL_CFLAGS = $(CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CFLAGS)
CFLAGS =
EXTRA_CFLAGS =
ML = ml
ALL_MLFLAGS = $(MLFLAGS) $(EXTRA_MLFLAGS) $(TARGET_MLFLAGS)
MLFLAGS = $(EXTRA_MLFLAGS)
EXTRA_MLFLAGS =
MLOBJS =
MLPICOBJS = $(MLOBJS:.o=.$(EXT_FOR_PIC_OBJECTS))
ALL_MLLIBS = $(MLLIBS) $(EXTRA_MLLIBS) $(TARGET_MLLIBS)
MLLIBS =
EXTRA_MLLIBS =
MNC = mnc
ALL_MNCFLAGS = $(MNCFLAGS) $(EXTRA_MNCFLAGS) $(TARGET_MNCFLAGS)
MNCFLAGS =
EXTRA_MNCFLAGS =
MNL = mnl
ALL_MNLFLAGS = $(MNLFLAGS) $(EXTRA_MNLFLAGS) $(TARGET_MNLFLAGS)
MNLFLAGS =
EXTRA_MNLFLAGS =
MNP = mnp
ALL_MNPFLAGS = $(MNPFLAGS) $(EXTRA_MNPFLAGS) $(TARGET_MNPFLAGS)
MNPFLAGS =
EXTRA_MNPFLAGS =
MSC = msc
ALL_MSCFLAGS = $(MSCFLAGS) $(EXTRA_MSCFLAGS) $(TARGET_MSCFLAGS)
MSCFLAGS =
EXTRA_MSCFLAGS =
MSL = msl
ALL_MSLFLAGS = $(MSLFLAGS) $(EXTRA_MSLFLAGS) $(TARGET_MSLFLAGS)
MSLFLAGS =
EXTRA_MSLFLAGS =
MSP = msp
ALL_MSPFLAGS = $(MSPFLAGS) $(EXTRA_MSPFLAGS) $(TARGET_MSPFLAGS)
MSPFLAGS =
EXTRA_MSPFLAGS =
AR = ar
ALL_ARFLAGS = $(ARFLAGS) $(EXTRA_ARFLAGS) $(TARGET_ARFLAGS)
ARFLAGS = cr
EXTRA_ARFLAGS =
RANLIB = @RANLIB@
ALL_RANLIBFLAGS = $(RANLIBFLAGS) $(EXTRA_RANLIBFLAGS) $(TARGET_RANLIBFLAGS)
RANLIBFLAGS =
EXTRA_RANLIBFLAGS =
# $(CFLAGS_FOR_PIC) is passed to the C compiler when creating `.pic_o' files
# (We use `.pic_o' as the extension for `.o' files that must have
# position-independent code.)
CFLAGS_FOR_PIC = @CFLAGS_FOR_PIC@
# $(EXT_FOR_PIC_OBJECTS) will be either `.o', if $(CFLAGS_FOR_PIC) is empty,
# or `.pic_o', if special flags are required for compiling files that
# will be put in shared libraries.
EXT_FOR_PIC_OBJECTS = @EXT_FOR_PIC_OBJECTS@
# $(EXT_FOR_SHARED_LIB) will be the extension for shared libraries,
# if the system supports them (e.g. `.so'), or the extension used
# for non-shared libraries (e.g. `.a') if the system doesn't support
# shared libraries.
EXT_FOR_SHARED_LIB = @EXT_FOR_SHARED_LIB@
# Set `RM_C' to `:' if you want to keep the intermediate `.c' files,
# or to `rm' if you want Mmake to remove them. Beware that RM_C=rm
# causes some potential race conditions if you use parallel make.
RM_C = @DEFAULT_RM_C@
# lists of targets that depend on $(MLOBJS) and $(MLPICOBJS)
MLOBJS_DEPS =
MLPICOBJS_DEPS =
#-----------------------------------------------------------------------------#
# `TARGET_<prog>FLAGS' is used to pass different flags to <prog> for
# different targets. By setting MCFLAGS-foo, for example, you can add
# extra values to TARGET_MCFLAGS that will used only for compiling foo.m.
#
# For each program <prog>, `TARGET_<prog>FLAGS' expands to
# `$(<prog>FLAGS-$@)' and/or `$(<prog>FLAGS-$*)'.
# $@ and $* are the builtin variables that expand to the
# current target and (for pattern rules) the base name of the current target,
# respectively. So $* is used for flags variables used by pattern rules,
# whereas $@ is used for flags variables used by hard-coded rules,
# including the ones in the generated .dep files.
#
# The code below uses some tricky GNU Make hacks to avoid expanding
# <prog>FLAGS-$* and <prog>FLAGS-$@ if these vars are not defined,
# so that we can avoid spurious warnings if the warning about
# undefined variables is enabled.
TARGET_GRADEFLAGS = \
$(maybe-base-GRADEFLAGS-$(findstring undefined,$(origin GRADEFLAGS-$*))) \
$(maybe-target-GRADEFLAGS-$(findstring undefined,$(origin GRADEFLAGS-$@)))
maybe-base-GRADEFLAGS- = $(GRADEFLAGS-$*)
maybe-base-GRADEFLAGS-undefined =
maybe-target-GRADEFLAGS- = $(GRADEFLAGS-$@)
maybe-target-GRADEFLAGS-undefined =
TARGET_MCFLAGS = \
$(maybe-base-MCFLAGS-$(findstring undefined,$(origin MCFLAGS-$*)))
maybe-base-MCFLAGS- = $(MCFLAGS-$*)
maybe-base-MCFLAGS-undefined =
TARGET_C2INITFLAGS = \
$(maybe-target-C2INITFLAGS-$(findstring undefined,$(origin C2INITFLAGS-$@)))
maybe-target-C2INITFLAGS- = $(C2INITFLAGS-$@)
maybe-target-C2INITFLAGS-undefined =
TARGET_MGNUCFLAGS = \
$(maybe-base-MGNUCFLAGS-$(findstring undefined,$(origin MGNUCFLAGS-$*)))
maybe-base-MGNUCFLAGS- = $(MGNUCFLAGS-$*)
maybe-base-MGNUCFLAGS-undefined =
TARGET_CFLAGS = \
$(maybe-base-CFLAGS-$(findstring undefined,$(origin CFLAGS-$*))) \
$(maybe-target-CFLAGS-$(findstring undefined,$(origin CFLAGS-$@)))
maybe-base-CFLAGS- = $(CFLAGS-$*)
maybe-base-CFLAGS-undefined =
maybe-target-CFLAGS- = $(CFLAGS-$@)
maybe-target-CFLAGS-undefined =
TARGET_MLFLAGS = \
$(maybe-target-MLFLAGS-$(findstring undefined,$(origin MLFLAGS-$@)))
maybe-target-MLFLAGS- = $(MLFLAGS-$@)
maybe-target-MLFLAGS-undefined =
TARGET_MLLIBS = \
$(maybe-target-MLLIBS-$(findstring undefined,$(origin MLLIBS-$@)))
maybe-target-MLLIBS- = $(MLLIBS-$@)
maybe-target-MLLIBS-undefined =
TARGET_ARFLAGS = \
$(maybe-target-ARFLAGS-$(findstring undefined,$(origin ARFLAGS-$@)))
maybe-target-ARFLAGS- = $(ARFLAGS-$@)
maybe-target-ARFLAGS-undefined =
TARGET_RANLIBFLAGS = \
$(maybe-target-RANLIBFLAGS-$(findstring undefined,$(origin RANLIBFLAGS-$@)))
maybe-target-RANLIBFLAGS- = $(RANLIBFLAGS-$@)
maybe-target-RANLIBFLAGS-undefined =
# Support for compiling Mercury programs with Prolog will probably be
# dropped one of these days, so it's probably not worth bothering with these.
TARGET_MNCFLAGS =
TARGET_MNLFLAGS =
TARGET_MNPFLAGS =
TARGET_MSCFLAGS =
TARGET_MSLFLAGS =
TARGET_MSPFLAGS =
#-----------------------------------------------------------------------------#
#
# The following variables specify the names of the subdirectories used,
# so that you can write code which works both with and without the
# `--use-subdirs' option.
#
ifeq ($(MMAKE_USE_SUBDIRS),yes)
SUBDIR=Mercury/
nos_subdir=$(SUBDIR)nos/
qls_subdir=$(SUBDIR)qls/
deps_subdir=$(SUBDIR)deps/
ds_subdir=$(SUBDIR)ds/
int0s_subdir=$(SUBDIR)int0s/
ints_subdir=$(SUBDIR)ints/
int2s_subdir=$(SUBDIR)int2s/
int3s_subdir=$(SUBDIR)int3s/
opts_subdir=$(SUBDIR)opts/
trans_opts_subdir=$(SUBDIR)trans_opts/
date0s_subdir=$(SUBDIR)date0s/
dates_subdir=$(SUBDIR)dates/
date3s_subdir=$(SUBDIR)date3s/
optdates_subdir=$(SUBDIR)optdates/
trans_opt_dates_subdir=$(SUBDIR)trans_opt_dates/
cs_subdir=$(SUBDIR)cs/
os_subdir=$(SUBDIR)os/
rlos_subdir=$(SUBDIR)rlos/
dirs_subdir=$(SUBDIR)dirs/
else
SUBDIR=
nos_subdir=
qls_subdir=
deps_subdir=
ds_subdir=
int0s_subdir=
ints_subdir=
int2s_subdir=
int3s_subdir=
opts_subdir=
trans_opts_subdir=
date0s_subdir=
dates_subdir=
date3s_subdir=
optdates_subdir=
trans_opt_dates_subdir=
cs_subdir=
os_subdir=
rlos_subdir=
dirs_subdir=
endif
#-----------------------------------------------------------------------------#
# This needs to go here so that user Mmake files can add new suffixes.
.SUFFIXES: # reset sufix list to be empty
#-----------------------------------------------------------------------------#
MAIN_TARGET =
default_target: main_target
#-----------------------------------------------------------------------------#