PR c++/3478
[official-gcc.git] / gcc / params.h
blob0a784454ccd1d638c90c7e7209433df152cfefbf
1 /* params.h - Run-time parameters.
2 Copyright (C) 2001, 2003 Free Software Foundation, Inc.
3 Written by Mark Mitchell <mark@codesourcery.com>.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA.
24 /* This module provides a means for setting integral parameters
25 dynamically. Instead of encoding magic numbers in various places,
26 use this module to organize all the magic numbers in a single
27 place. The values of the parameters can be set on the
28 command-line, thereby providing a way to control the amount of
29 effort spent on particular optimization passes, or otherwise tune
30 the behavior of the compiler.
32 Since their values can be set on the command-line, these parameters
33 should not be used for non-dynamic memory allocation. */
35 #ifndef GCC_PARAMS_H
36 #define GCC_PARAMS_H
38 /* No parameter shall have this value. */
40 #define INVALID_PARAM_VAL (-1)
42 /* The information associated with each parameter. */
44 typedef struct param_info
46 /* The name used with the `--param <name>=<value>' switch to set this
47 value. */
48 const char *const option;
49 /* The associated value. */
50 int value;
51 /* A short description of the option. */
52 const char *const help;
53 } param_info;
55 /* An array containing the compiler parameters and their current
56 values. */
58 extern param_info *compiler_params;
60 /* Add the N PARAMS to the current list of compiler parameters. */
62 extern void add_params (const param_info params[], size_t n);
64 /* Set the VALUE associated with the parameter given by NAME. */
66 extern void set_param_value (const char *name, int value);
69 /* The parameters in use by language-independent code. */
71 typedef enum compiler_param
73 #define DEFPARAM(enumerator, option, msgid, default) \
74 enumerator,
75 #include "params.def"
76 #undef DEFPARAM
77 LAST_PARAM
78 } compiler_param;
80 /* The value of the parameter given by ENUM. */
81 #define PARAM_VALUE(ENUM) \
82 (compiler_params[(int) ENUM].value)
84 /* Macros for the various parameters. */
85 #define MAX_INLINE_INSNS_SINGLE \
86 PARAM_VALUE (PARAM_MAX_INLINE_INSNS_SINGLE)
87 #define MAX_INLINE_INSNS \
88 PARAM_VALUE (PARAM_MAX_INLINE_INSNS)
89 #define MAX_INLINE_SLOPE \
90 PARAM_VALUE (PARAM_MAX_INLINE_SLOPE)
91 #define MIN_INLINE_INSNS \
92 PARAM_VALUE (PARAM_MIN_INLINE_INSNS)
93 #define MAX_INLINE_INSNS_AUTO \
94 PARAM_VALUE (PARAM_MAX_INLINE_INSNS_AUTO)
95 #define MAX_INLINE_INSNS_RTL \
96 PARAM_VALUE (PARAM_MAX_INLINE_INSNS_RTL)
97 #define MAX_DELAY_SLOT_INSN_SEARCH \
98 PARAM_VALUE (PARAM_MAX_DELAY_SLOT_INSN_SEARCH)
99 #define MAX_DELAY_SLOT_LIVE_SEARCH \
100 PARAM_VALUE (PARAM_MAX_DELAY_SLOT_LIVE_SEARCH)
101 #define MAX_PENDING_LIST_LENGTH \
102 PARAM_VALUE (PARAM_MAX_PENDING_LIST_LENGTH)
103 #define MAX_GCSE_MEMORY \
104 ((size_t) PARAM_VALUE (PARAM_MAX_GCSE_MEMORY))
105 #define MAX_GCSE_PASSES \
106 PARAM_VALUE (PARAM_MAX_GCSE_PASSES)
107 #define MAX_UNROLLED_INSNS \
108 PARAM_VALUE (PARAM_MAX_UNROLLED_INSNS)
109 #endif /* ! GCC_PARAMS_H */