/* params.h - Run-time parameters. Copyright (C) 2001-2017 Free Software Foundation, Inc. Written by Mark Mitchell . This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ /* This module provides a means for setting integral parameters dynamically. Instead of encoding magic numbers in various places, use this module to organize all the magic numbers in a single place. The values of the parameters can be set on the command-line, thereby providing a way to control the amount of effort spent on particular optimization passes, or otherwise tune the behavior of the compiler. Since their values can be set on the command-line, these parameters should not be used for non-dynamic memory allocation. */ #ifndef GCC_PARAMS_H #define GCC_PARAMS_H /* No parameter shall have this value. */ #define INVALID_PARAM_VAL (-1) /* The information associated with each parameter. */ struct param_info { /* The name used with the `--param =' switch to set this value. */ const char *const option; /* The default value. */ int default_value; /* Minimum acceptable value. */ int min_value; /* Maximum acceptable value, if greater than minimum */ int max_value; /* A short description of the option. */ const char *const help; /* The optional names corresponding to the values. */ const char **value_names; }; /* An array containing the compiler parameters and their current values. */ extern param_info *compiler_params; /* Returns the number of entries in the table, for the use by plugins. */ extern size_t get_num_compiler_params (void); /* Add the N PARAMS to the current list of compiler parameters. */ extern void add_params (const param_info params[], size_t n); /* Set the VALUE associated with the parameter given by NAME in the table PARAMS using PARAMS_SET to indicate which have been explicitly set. */ extern void set_param_value (const char *name, int value, int *params, int *params_set);