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