Files
mercury/library/Mercury.options
Julien Fischer 2a366cf295 Deprecate --no-ansi and --no-ansi-c.
--no-ansi (mgnuc) and --no-ansi-c (mmc) have not actually done anything for
many years now. Deprecate these options and remove their "use" throughout most
of the Mercury system. (The remaining uses are in the Makefiles for the Boehm
GC, which need to be updated separately.)

Also deprecate the internal compiler option --cflags-for-ansi.

compiler/options.m:
    Document that --no-ansi-c is now deprecated.

    Document that the internal option --cflags-for-ansi is now
    deprecated.

compiler/compile_target_code.m:
    Do not pass the ANSI options to the C compiler.

scripts/mgnuc.in:
scripts/mgnuc_file_opts.sh-subr:
    Deprecate the --no-ansi option; delete code that no longer does
    anything useful.

configure.ac:
    Delete the configuration variable CFLAGS_FOR_ANSI; it is only ever
    set to be empty. (The comment talks about --no-ansi doing other things
    in the mgnuc script. It used to also cause some preprocessor macros
    to be defined for compatibility with the system headers on some
    platforms -- that has not been the case since 2013.)

doc/user_guide.texi:
    Document that --no-ansi-c is deprecated.

bytecode/Mmakefile:
compiler/Mercury.options:
library/Mercury.options:
extras/odbc/odbc.m:
runtime/Mmakefile:
scripts/Mercury.config.bootstrap.in:
scripts/Mercury.config.in:
tests/hard_coded/Mercury.options:
tests/valid/Mercury.options:
trace/Mmakefile:
util/Mmakefile:
    Conform to the above change.

NEWS.md:
    Announce the above.
2023-05-31 17:44:26 +10:00

78 lines
3.9 KiB
Plaintext

#-----------------------------------------------------------------------------#
# Copyright (C) 2002, 2004-2011 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.
#-----------------------------------------------------------------------------#
# 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-lexer += --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