GCC Middle and Back End API Reference
|
#include <diagnostic.h>
Data Structures | |
struct | diagnostic_classification_change_t |
Public Member Functions | |
void | init (int n_opts) |
void | fini () |
void | push () |
void | pop (location_t where) |
bool | option_unspecified_p (int opt) const |
diagnostic_t | get_current_override (int opt) const |
diagnostic_t | classify_diagnostic (const diagnostic_context *context, int option_index, diagnostic_t new_kind, location_t where) |
diagnostic_t | update_effective_level_from_pragmas (diagnostic_info *diagnostic) const |
Private Attributes | |
int | m_n_opts |
diagnostic_t * | m_classify_diagnostic |
diagnostic_classification_change_t * | m_classification_history |
int | m_n_classification_history |
int * | m_push_list |
int | m_n_push |
A stack of sets of classifications: each entry in the stack is a mapping from option index to diagnostic severity that can be changed via pragmas. The stack can be pushed and popped.
diagnostic_t diagnostic_option_classifier::classify_diagnostic | ( | const diagnostic_context * | context, |
int | option_index, | ||
diagnostic_t | new_kind, | ||
location_t | where ) |
Interface to specify diagnostic kind overrides. Returns the previous setting, or DK_UNSPECIFIED if the parameters are out of range. If OPTION_INDEX is zero, the new setting is for all the diagnostics.
References DK_ANY, DK_LAST_DIAGNOSTIC_KIND, ggc_alloc(), i, option(), diagnostic_context::option_enabled_p(), and UNKNOWN_LOCATION.
Referenced by diagnostic_context::classify_diagnostic().
void diagnostic_option_classifier::fini | ( | ) |
References free(), ggc_alloc(), m_classify_diagnostic, m_n_push, and m_push_list.
Referenced by diagnostic_context::finish().
|
inline |
References gcc_assert, m_classify_diagnostic, and m_n_opts.
Referenced by option_unspecified_p().
void diagnostic_option_classifier::init | ( | int | n_opts | ) |
References ggc_alloc(), i, m_classify_diagnostic, m_n_opts, m_n_push, and m_push_list.
Referenced by diagnostic_context::initialize().
|
inline |
References get_current_override(), and ggc_alloc().
Referenced by diagnostic_context::option_unspecified_p().
void diagnostic_option_classifier::pop | ( | location_t | where | ) |
Restore the topmost classification set off the stack. If the stack is empty, revert to the state based on command line parameters.
References DK_POP, ggc_alloc(), i, diagnostic_option_classifier::diagnostic_classification_change_t::kind, diagnostic_option_classifier::diagnostic_classification_change_t::location, m_classification_history, m_n_classification_history, m_n_push, m_push_list, and diagnostic_option_classifier::diagnostic_classification_change_t::option.
Referenced by diagnostic_context::pop_diagnostics().
void diagnostic_option_classifier::push | ( | ) |
Save all diagnostic classifications in a stack.
References ggc_alloc(), m_n_classification_history, m_n_push, and m_push_list.
Referenced by diagnostic_context::push_diagnostics().
diagnostic_t diagnostic_option_classifier::update_effective_level_from_pragmas | ( | diagnostic_info * | diagnostic | ) | const |
Update the kind of DIAGNOSTIC based on its location(s), including any of those in its inlining stack, relative to any #pragma GCC diagnostic directives recorded within this object. Return the new kind of DIAGNOSTIC if it was updated, or DK_UNSPECIFIED otherwise.
References DK_POP, ggc_alloc(), i, line_table, and option().
|
private |
Referenced by pop().
|
private |
Referenced by fini(), get_current_override(), and init().
|
private |
|
private |
Referenced by get_current_override(), and init().
|
private |