mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-23 13:23:47 +00:00
where switch detection was getting confused by explicit existential quantifications. compiler/switch_detection.m: When detecting switches, traverse through some/2 goals. Also simplify the code a bit. tests/valid/Mmakefile: tests/valid/some_switch.m: Regression test for the above change.
172 lines
3.8 KiB
Plaintext
172 lines
3.8 KiB
Plaintext
#-----------------------------------------------------------------------------#
|
|
|
|
main_target: all
|
|
|
|
include ../Mmake.common
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
# please keep this list sorted
|
|
AGC_SOURCES= \
|
|
agc_graph.m \
|
|
agc_ho_pred.m \
|
|
agc_ite.m \
|
|
agc_unbound_typevars.m \
|
|
agc_unbound_typevars2.m \
|
|
agc_unused_in.m
|
|
|
|
OTHER_SOURCES= \
|
|
compl_unify_bug.m \
|
|
complicated_unify.m \
|
|
constructor_arg_names.m \
|
|
dcg_test.m \
|
|
det_condition.m \
|
|
det_inference.m \
|
|
det_switch.m \
|
|
double_vn.m \
|
|
easy_nondet_test.m \
|
|
easy_nondet_test_2.m \
|
|
empty_bound_inst_list.m \
|
|
empty_switch.m \
|
|
error.m \
|
|
explicit_quant.m \
|
|
fail_ite.m \
|
|
followcode_det_problem.m \
|
|
func_int_bug_main.m \
|
|
headvar_not_found.m \
|
|
higher_order.m \
|
|
higher_order2.m \
|
|
higher_order3.m \
|
|
higher_order_implied_mode.m \
|
|
ho_func_call.m \
|
|
ho_inst.m \
|
|
implied_mode.m \
|
|
indexing.m \
|
|
inhibit_warn_test.m \
|
|
inlining_bug.m \
|
|
intermod_lambda.m \
|
|
intermod_test.m \
|
|
lambda_inference.m\
|
|
lambda_instmap_bug.m \
|
|
lambda_quant.m \
|
|
lambda_quant_bug.m \
|
|
lambda_recompute.m \
|
|
lambda_struct_bug.m \
|
|
lambda_switch.m \
|
|
lambda_type.m \
|
|
lazy_list.m \
|
|
liveness_nonlocals.m \
|
|
livevals_seq.m \
|
|
loop.m \
|
|
loop_in_disj.m \
|
|
middle_rec_labels.m \
|
|
modes_bug.m \
|
|
module_a.m \
|
|
module_b.m \
|
|
module_c.m \
|
|
module_d.m \
|
|
module_e.m \
|
|
mostly_uniq_mode_inf.m \
|
|
multidet_prune1.m \
|
|
multidet_test.m \
|
|
nasty_func_test.m \
|
|
nondet_live.m \
|
|
pred_with_no_modes.m \
|
|
qualified_cons_id.m \
|
|
same_length_2.m \
|
|
semidet_disj.m \
|
|
shape_type.m \
|
|
simplify_bug.m \
|
|
soln_context.m \
|
|
some_switch.m \
|
|
stack_alloc.m \
|
|
subtype_switch.m \
|
|
switches.m \
|
|
switch_detection_bug.m \
|
|
tricky_ite.m \
|
|
two_pragma_c_codes.m \
|
|
two_way_unif.m \
|
|
type_inf_ambig_test.m \
|
|
undead_proc.m \
|
|
uniq_unify.m \
|
|
unbound_tvar_in_lambda.m \
|
|
unreachable_code.m \
|
|
unused_args_test2.m \
|
|
vn_float.m
|
|
|
|
# The mode system can't handle the following test cases yet:
|
|
# assoc_list.m
|
|
# determinism.m
|
|
# mode_merge_insts.m
|
|
|
|
|
|
# Not all grades can be used with accurate GC
|
|
|
|
ifeq ($(GRADE),jump)
|
|
SOURCES=$(OTHER_SOURCES)
|
|
else
|
|
ifeq ($(GRADE),fast)
|
|
SOURCES=$(OTHER_SOURCES)
|
|
else
|
|
SOURCES=$(AGC_SOURCES) $(OTHER_SOURCES)
|
|
endif
|
|
endif
|
|
|
|
DEPS = $(SOURCES:%.m=%.depend)
|
|
OBJS = $(SOURCES:%.m=$(os_subdir)%.o)
|
|
PROGS = $(SOURCES:%.m=%)
|
|
|
|
all: objs
|
|
|
|
# some regression tests only failed with particular options enabled
|
|
# (please keep this list sorted)
|
|
GRADEFLAGS-agc_graph = --gc accurate
|
|
GRADEFLAGS-agc_ho_pred = --gc accurate
|
|
GRADEFLAGS-agc_ite = --gc accurate
|
|
GRADEFLAGS-agc_unbound_typevars = --gc accurate
|
|
GRADEFLAGS-agc_unbound_typevars2 = --gc accurate
|
|
GRADEFLAGS-agc_unused_in = --gc accurate
|
|
MCFLAGS-compl_unify_bug = -O3
|
|
MCFLAGS-double_vn = -O4
|
|
MCFLAGS-explicit_quant = --halt-at-warn
|
|
MCFLAGS-higher_order_implied_mode = -O-1
|
|
MCFLAGS-inhibit_warn_test = --inhibit-warnings --halt-at-warn
|
|
MCFLAGS-livevals_seq = -O5 --opt-space
|
|
MCFLAGS-middle_rec_labels = --middle-rec --no-follow-vars
|
|
MCFLAGS-mostly_uniq_mode_inf = --infer-all
|
|
MCFLAGS-pred_with_no_modes = --infer-all
|
|
MCFLAGS-simplify_bug = -O-1
|
|
MCFLAGS-two_way_unif = -O-1
|
|
MCFLAGS-type_inf_ambig_test = --infer-all
|
|
MCFLAGS-vn_float = -O5
|
|
|
|
# intermod_lambda.m needs inter-module optimization
|
|
intermod_lambda.c:
|
|
$(MCI) $(GRADEFLAGS) $(MCIFLAGS) intermod_lambda2.m
|
|
$(MCOI) $(GRADEFLAGS) $(MCOIFLAGS) intermod_lambda2.m
|
|
$(MCG) $(GRADEFLAGS) $(MCGFLAGS) --intermodule-optimization \
|
|
intermod_lambda.m
|
|
|
|
intermod_test.c:
|
|
$(MCI) $(GRADEFLAGS) $(MCIFLAGS) intermod_test2.m
|
|
$(MCOI) $(GRADEFLAGS) $(MCOIFLAGS) intermod_test2.m
|
|
$(MCG) $(GRADEFLAGS) $(MCGFLAGS) --intermodule-optimization \
|
|
intermod_test.m
|
|
|
|
check: objs
|
|
|
|
objs: $(OBJS)
|
|
|
|
depend: $(DEPS)
|
|
|
|
printtests:
|
|
@echo $(PROGS)
|
|
|
|
printobjs:
|
|
@echo $(OBJS)
|
|
|
|
clean:
|
|
rm -f *.err *.h
|
|
|
|
#-----------------------------------------------------------------------------#
|