Files
mercury/library/Mercury.options
Zoltan Somogyi 2a1f376c5d Use spaces in all Mercury.options files.
Use consistent indentation.

Sort many blocks of module-specific MCFLAGS settings by module name.

Add XXXs about some questionable options.
2025-12-06 10:39:04 +11:00

115 lines
6.1 KiB
Bash

#---------------------------------------------------------------------------#
# vim: ts=4 sw=4 expandtab ft=sh
#---------------------------------------------------------------------------#
# Copyright (C) 2002, 2004-2011 The University of Melbourne.
# Copyright (C) 2015, 2018-2020, 2022-2025 The Mercury team
# This file may only be copied under the terms of the GNU General
# Public License - see the file COPYING in the Mercury distribution.
#---------------------------------------------------------------------------#
# Mercury.options - module-specific flags for Mmake and `mmc --make'.
#---------------------------------------------------------------------------#
# Modules which use user-guided type specialization need to be compiled with
# $(TYPE_SPEC_FLAGS) flags to make sure all calls to the builtin comparison
# routines are inlined.
TYPE_SPEC_FLAGS = --inline-vars-threshold 10000
MCFLAGS-list += $(TYPE_SPEC_FLAGS)
MCFLAGS-map += $(TYPE_SPEC_FLAGS)
MCFLAGS-tree234 += $(TYPE_SPEC_FLAGS)
MCFLAGS-set += $(TYPE_SPEC_FLAGS)
MCFLAGS-set_ordlist += $(TYPE_SPEC_FLAGS)
MCFLAGS-mercury_term_lexer += --optimize-constructor-last-call
MCFLAGS-list += --optimize-constructor-last-call
MCFLAGS-sparse_bitset += --use-atomic-cells --optimize-constant-propagation
MCFLAGS-tree_bitset += --use-atomic-cells --optimize-constant-propagation
MCFLAGS-version_hash_table += --optimize-unused-args
# Speed up structure sharing analysis.
MCFLAGS-set_ctree234 += --structure-sharing-widening 1
MCFLAGS-set_tree234 += --structure-sharing-widening 1
MCFLAGS-tree234 += --structure-sharing-widening 1
# Bug workarounds.
MCFLAGS-std_util += --no-halt-at-warn
MCFLAGS-dir += --no-halt-at-warn
MCFLAGS-exception += --no-halt-at-warn
# This is needed to avoid errors on the calls that implement e.g. io.format/3
# in terms of io.format/4, and string.format/2 in terms of string.format/3.
# varset.trans_opt includes the relevant part of string.opt.
#
# We have obsoleted the predicates that get and set the globals field
# in the I/O state. However, until we delete that field, the initialization
# of the I/O state must still initialize the globals, which unavoidably
# calls a now-obsolete predicate.
MCFLAGS-io += --no-warn-obsolete
MCFLAGS-mer_std += --no-warn-nothing-exported
# Avoid warnings about insts with non-existent function symbols in their
# bound lists. The non-existent function symbols are used here to represent
# insts for foreign types.
MCFLAGS-array += --no-warn-insts-without-matching-type
MCFLAGS-bitmap += --no-warn-insts-without-matching-type
MCFLAGS-io.text_read += --no-warn-insts-without-matching-type
# Avoid warnings about unused imports.
MCFLAGS-builtin += --no-warn-unused-imports
MCFLAGS-construct += --no-warn-unused-imports
MCFLAGS-deconstruct += --no-warn-unused-imports
MCFLAGS-int32 += --no-warn-unused-imports
MCFLAGS-int64 += --no-warn-unused-imports
MCFLAGS-library += --no-warn-unused-imports
MCFLAGS-mer_std += --no-warn-unused-imports
MCFLAGS-term_size_prof_builtin += --no-warn-unused-imports
MCFLAGS-uint64 += --no-warn-unused-imports
# In parallel, low level C grades that don't reserve a machine register for
# the engine base (i.e. don't use gcc global registers) don't generate code
# that assumes we cache the engine base address into a local variable
# MR_local_thread_engine_base. This module contains handwritten code
# that jumps about a bit, and maintaining MR_local_thread_engine_base in all
# the right places is tricky (i.e. I gave up).
MCFLAGS-thread += --no-local-thread-engine-base
MCFLAGS-thread.semaphore += --no-local-thread-engine-base
# Work around a warning for termination analysis of the user defined equality
# and comparison code for lazy values.
MCFLAGS-lazy += --no-warn-non-term-special-preds
MCFLAGS-benchmarking += --no-warn-implicit-stream-calls
MCFLAGS-io += --no-warn-implicit-stream-calls
MCFLAGS-pprint += --no-warn-implicit-stream-calls
MCFLAGS-prolog += --no-warn-implicit-stream-calls
MCFLAGS-term_io += --no-warn-implicit-stream-calls
MCFLAGS-benchmarking += --no-warn-inferred-erroneous
MCFLAGS-deconstruct += --no-warn-inferred-erroneous
MCFLAGS-io.error_util += --no-warn-inferred-erroneous
MCFLAGS-io += --no-warn-inferred-erroneous
MCFLAGS-profiling_builtin += --no-warn-inferred-erroneous
MCFLAGS-table_builtin += --no-warn-inferred-erroneous
MCFLAGS-benchmarking += --no-warn-unneeded-final-statevars
MCFLAGS-exception += --no-warn-unneeded-final-statevars
MCFLAGS-gc += --no-warn-unneeded-final-statevars
MCFLAGS-io += --no-warn-unneeded-final-statevars
MCFLAGS-io.environment += --no-warn-unneeded-final-statevars
MCFLAGS-io.stream_ops += --no-warn-unneeded-final-statevars
MCFLAGS-random += --no-warn-unneeded-final-statevars
MCFLAGS-stm_builtin += --no-warn-unneeded-final-statevars
MCFLAGS-thread += --no-warn-unneeded-final-statevars
MCFLAGS-thread.future += --no-warn-unneeded-final-statevars
MCFLAGS-thread.mvar += --no-warn-unneeded-final-statevars
MCFLAGS-thread.semaphore += --no-warn-unneeded-final-statevars
MCFLAGS-bit_buffer += --no-warn-include-and-non-include
MCFLAGS-io += --no-warn-include-and-non-include
MCFLAGS-random += --no-warn-include-and-non-include
MCFLAGS-stream += --no-warn-include-and-non-include
MCFLAGS-string += --no-warn-include-and-non-include
MCFLAGS-thread += --no-warn-include-and-non-include