diff options
Diffstat (limited to 'gcc/pretty-print.h')
-rw-r--r-- | gcc/pretty-print.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gcc/pretty-print.h b/gcc/pretty-print.h index e443098..6143423 100644 --- a/gcc/pretty-print.h +++ b/gcc/pretty-print.h @@ -28,6 +28,11 @@ along with GCC; see the file COPYING3. If not see /* Maximum number of format string arguments. */ #define PP_NL_ARGMAX 30 +/* Maximum number of locations associated to each message. If + location 'i' is UNKNOWN_LOCATION, then location 'i+1' is not + valid. */ +#define MAX_LOCATIONS_PER_MESSAGE 2 + /* The type of a text to be formatted according a format specification along with a list of things. */ struct text_info @@ -35,8 +40,22 @@ struct text_info const char *format_spec; va_list *args_ptr; int err_no; /* for %m */ - location_t *locus; void **x_data; + + inline void set_location (unsigned int index_of_location, location_t loc) + { + gcc_checking_assert (index_of_location < MAX_LOCATIONS_PER_MESSAGE); + this->locations[index_of_location] = loc; + } + + inline location_t get_location (unsigned int index_of_location) const + { + gcc_checking_assert (index_of_location < MAX_LOCATIONS_PER_MESSAGE); + return this->locations[index_of_location]; + } + +private: + location_t locations[MAX_LOCATIONS_PER_MESSAGE]; }; /* How often diagnostics are prefixed by their locations: |