]>
Commit | Line | Data |
---|---|---|
c6d9a88c MM |
1 | /* params.h - Run-time parameters. |
2 | Copyright (C) 2001 Free Software Foundation, Inc. | |
3 | Written by Mark Mitchell <mark@codesourcery.com>. | |
4 | ||
1322177d | 5 | This file is part of GCC. |
c6d9a88c | 6 | |
1322177d LB |
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. | |
c6d9a88c | 11 | |
1322177d LB |
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. | |
c6d9a88c MM |
16 | |
17 | You should have received a copy of the GNU General Public License | |
1322177d LB |
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. | |
c6d9a88c MM |
21 | |
22 | */ | |
23 | ||
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 | |
0443f602 JO |
30 | the behavior of the compiler. |
31 | ||
32 | Since their values can be set on the command-line, these parameters | |
33 | should not be used for non-dynamic memory allocation. */ | |
c6d9a88c | 34 | |
88657302 RH |
35 | #ifndef GCC_PARAMS_H |
36 | #define GCC_PARAMS_H | |
c6d9a88c MM |
37 | |
38 | /* No parameter shall have this value. */ | |
39 | ||
40 | #define INVALID_PARAM_VAL (-1) | |
41 | ||
42 | /* The information associated with each parameter. */ | |
43 | ||
44 | typedef struct param_info | |
45 | { | |
46 | /* The name used with the `--param <name>=<value>' switch to set this | |
47 | value. */ | |
48 | const char *option; | |
49 | /* The associated value. */ | |
50 | int value; | |
1c4c47db JO |
51 | /* A short description of the option. */ |
52 | const char *help; | |
c6d9a88c MM |
53 | } param_info; |
54 | ||
55 | /* An array containing the compiler parameters and their current | |
56 | values. */ | |
57 | ||
58 | extern param_info *compiler_params; | |
59 | ||
60 | /* Add the N PARAMS to the current list of compiler parameters. */ | |
61 | ||
62 | extern void add_params | |
63 | PARAMS ((const param_info params[], size_t n)); | |
64 | ||
65 | /* Set the VALUE associated with the parameter given by NAME. */ | |
66 | ||
67 | extern void set_param_value | |
68 | PARAMS ((const char *name, int value)); | |
69 | ||
70 | \f | |
71 | /* The parameters in use by language-independent code. */ | |
72 | ||
73 | typedef enum compiler_param | |
74 | { | |
75 | #define DEFPARAM(ENUM, OPTION, HELP, DEFAULT) \ | |
76 | ENUM, | |
77 | #include "params.def" | |
78 | #undef DEFPARAM | |
79 | LAST_PARAM | |
80 | } compiler_param; | |
81 | ||
82 | /* The value of the parameter given by ENUM. */ | |
83 | #define PARAM_VALUE(ENUM) \ | |
84 | (compiler_params[(int) ENUM].value) | |
85 | ||
86 | /* Macros for the various parameters. */ | |
87 | #define MAX_INLINE_INSNS \ | |
88 | PARAM_VALUE (PARAM_MAX_INLINE_INSNS) | |
0443f602 JO |
89 | #define MAX_DELAY_SLOT_INSN_SEARCH \ |
90 | PARAM_VALUE (PARAM_MAX_DELAY_SLOT_INSN_SEARCH) | |
d5d063d7 JO |
91 | #define MAX_DELAY_SLOT_LIVE_SEARCH \ |
92 | PARAM_VALUE (PARAM_MAX_DELAY_SLOT_LIVE_SEARCH) | |
4a121cc3 AM |
93 | #define MAX_PENDING_LIST_LENGTH \ |
94 | PARAM_VALUE (PARAM_MAX_PENDING_LIST_LENGTH) | |
f1fa37ff MM |
95 | #define MAX_GCSE_MEMORY \ |
96 | ((size_t) PARAM_VALUE (PARAM_MAX_GCSE_MEMORY)) | |
740f35a0 DB |
97 | #define MAX_GCSE_PASSES \ |
98 | PARAM_VALUE (PARAM_MAX_GCSE_PASSES) | |
88657302 | 99 | #endif /* ! GCC_PARAMS_H */ |