From patchwork Mon Nov 6 19:49:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 162154 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2890726vqu; Mon, 6 Nov 2023 11:50:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IGXE7IG20/D3f1y5YqiM5fArAcm9QTh2BJSOj+H9HkC/KH6XkVVJ8/mdeyQ4NIMT4IE0dtl X-Received: by 2002:a05:6214:dad:b0:66d:9edf:45f8 with SMTP id h13-20020a0562140dad00b0066d9edf45f8mr41212144qvh.11.1699300237715; Mon, 06 Nov 2023 11:50:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699300237; cv=pass; d=google.com; s=arc-20160816; b=OHHKr/jN3gJ2rdU/EtRJOlhpX20dym9J9nILYSOPyBNHG/FMiqkFIWIS/snJdktqqI LVHLaNsHo0PH3v+daWhL2Vwd/iA4Xfuwb80Enq8Br9S1w6XLdB7CadwgHr+OroOsIer4 d4VHNVMJ0AXb6ZqvqkJdCcqCUkVYj+/d+QEmMe30/yi8FA7gj7xldIcLtrMDOZprcZmG 3SF1JYb6umFWCS+6Caomlipcvz44CPxDgJ5wDDaqUxQfpmWRIwoT4UG0hPjrvMq023v+ 9dzivLB6e31WuNXDJr3qeiMzWOkd9nbKdCghHL31xJLjvQm2QJe/zSgv7tl1yGKYcoX5 6JtQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=k/oIvjMNhCXdZVhCIj9zObkfVXXgf4CyjTxu3dF03l0=; fh=NXemEfxTRbZtBxUkxR2ehQUaYlcDfMdzPkO8MChVQE4=; b=OZh4u3pVQgK5EpPxjbyCiGJav+Vol7LuIFXgqPqF/uDU6hmA7UIGvLxIu7x1zy5gNU DL6RzGySW6aKsKAjU/VZ92QfKuTB2V/tOCuIflu3RYrAh0xiwCTT33VUy5TJwm0oeVun nNgwLRiHtbYpd2gc7mUcJVXmJPB59NQKf0zoWE1WqRuutVS6jdJVvJGw8mNlP+vDnpON NVYiXNS3+ErYY61yZRmyAGLQrAJMU/Dqrn1fnFu0qLYHALYnnB6LDwZ3el7/f8ICdw5h Zi2QWcMcwkGPVyWhXIlYzEYt9rsX93F+a2OX5bXyZ4Ku6EEG6k7tlophSQNGZdOxE9Vs t5dg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UYnXOWAR; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id da4-20020a05621408c400b00670c78f44dasi5741673qvb.447.2023.11.06.11.50.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 11:50:37 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UYnXOWAR; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 79AB63857009 for ; Mon, 6 Nov 2023 19:50:37 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 631443858C50 for ; Mon, 6 Nov 2023 19:49:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 631443858C50 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 631443858C50 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699300182; cv=none; b=QcQZlKgRdVXRdJRLn30+oKC4kHMOY4repDC5Z55mAxTMZZjPMd0n5vL6HdVCKP5UwWA2LpZW5LDL4bs/Hm/8B2rGzCsNiWsfV4Exy1eyG7wTBnfrzXGIcmUL5xTGnu4OACFhNblW8dY7LdM/gXwqQtCSQ9S4hvcw8leVcQkBkKU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699300182; c=relaxed/simple; bh=6R3Df3kbSyX2/X9FynPGSUHstzSYmlTltfoQ613seFw=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=o0+S4LxPtrckVQBl722iQxH479LSRTJJ5mzfcpxwyZ/bF6TkHqR3AQ6R8v9/iQUOhY31y5TsuBoRoY1YpFSVGHCbUv23cgNduKICqocUGucTr8l2RqnyfQMOmiI6e1xPsAYi+hOBUlneBJRtahurzHLitw9Q6v0rBJTXocUsWoU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699300180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k/oIvjMNhCXdZVhCIj9zObkfVXXgf4CyjTxu3dF03l0=; b=UYnXOWAR5RJEsZhaZZnqmECwXqBqqxR6kQxxFFj5Dz1m6V6Pnn9bHwPmOJC5Bg+v5G2FUU AGoyd9Oh4hGXwtbmicyWxDK/URABk1flH70Ty5C9oIDlWhhp0OLK3DzDD2ACgbd3qmYHrO RT5esJqiI7cOaD7TrgmOcgYy4HJ2iJI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-588-2xK9c7NxNlq7W5LtOKSWzQ-1; Mon, 06 Nov 2023 14:49:38 -0500 X-MC-Unique: 2xK9c7NxNlq7W5LtOKSWzQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 820E6101A529 for ; Mon, 6 Nov 2023 19:49:38 +0000 (UTC) Received: from t14s.localdomain.com (unknown [10.22.8.62]) by smtp.corp.redhat.com (Postfix) with ESMTP id 59E9825C0; Mon, 6 Nov 2023 19:49:38 +0000 (UTC) From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [pushed 3/4] diagnostics: introduce class diagnostic_option_classifier Date: Mon, 6 Nov 2023 14:49:34 -0500 Message-Id: <20231106194935.2693735-3-dmalcolm@redhat.com> In-Reply-To: <20231106194935.2693735-1-dmalcolm@redhat.com> References: <20231106194935.2693735-1-dmalcolm@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781845446073575351 X-GMAIL-MSGID: 1781845446073575351 This patch gathers the 6 fields in diagnostic_context relating to keeping track of overriding the severity of warnings, and pushing/popping those severities, moving them all into a new class diagnostic_option_classifier. No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-5168-g38763e2c188fa9. gcc/ChangeLog: * diagnostic.cc (diagnostic_context::push_diagnostics): Convert to... (diagnostic_option_classifier::push): ...this. (diagnostic_context::pop_diagnostics): Convert to... (diagnostic_option_classifier::pop): ...this. (diagnostic_context::initialize): Move code to... (diagnostic_option_classifier::init): ...this new function. (diagnostic_context::finish): Move code to... (diagnostic_option_classifier::fini): ...this new function. (diagnostic_context::classify_diagnostic): Convert to... (diagnostic_option_classifier::classify_diagnostic): ...this. (diagnostic_context::update_effective_level_from_pragmas): Convert to... (diagnostic_option_classifier::update_effective_level_from_pragmas): ...this. (diagnostic_context::diagnostic_enabled): Update for refactoring. * diagnostic.h (struct diagnostic_classification_change_t): Move into... (class diagnostic_option_classifier): ...this new class. (diagnostic_context::option_unspecified_p): Update for move of fields into m_option_classifier. (diagnostic_context::classify_diagnostic): Likewise. (diagnostic_context::push_diagnostics): Likewise. (diagnostic_context::pop_diagnostics): Likewise. (diagnostic_context::update_effective_level_from_pragmas): Delete. (diagnostic_context::m_classify_diagnostic): Move into class diagnostic_option_classifier. (diagnostic_context::m_option_classifier): Likewise. (diagnostic_context::m_classification_history): Likewise. (diagnostic_context::m_n_classification_history): Likewise. (diagnostic_context::m_push_list): Likewise. (diagnostic_context::m_n_push): Likewise. (diagnostic_context::m_option_classifier): New. --- gcc/diagnostic.cc | 124 ++++++++++++++++++++++++------------------- gcc/diagnostic.h | 131 ++++++++++++++++++++++++++++++++-------------- 2 files changed, 163 insertions(+), 92 deletions(-) diff --git a/gcc/diagnostic.cc b/gcc/diagnostic.cc index c617b34f02b..addd6606eaa 100644 --- a/gcc/diagnostic.cc +++ b/gcc/diagnostic.cc @@ -149,13 +149,63 @@ diagnostic_set_caret_max_width (diagnostic_context *context, int value) context->m_source_printing.max_width = value; } +void +diagnostic_option_classifier::init (int n_opts) +{ + m_n_opts = n_opts; + m_classify_diagnostic = XNEWVEC (diagnostic_t, n_opts); + for (int i = 0; i < n_opts; i++) + m_classify_diagnostic[i] = DK_UNSPECIFIED; + m_push_list = nullptr; + m_n_push = 0; +} + +void +diagnostic_option_classifier::fini () +{ + XDELETEVEC (m_classify_diagnostic); + m_classify_diagnostic = nullptr; + free (m_push_list); + m_n_push = 0; +} + +/* Save all diagnostic classifications in a stack. */ + +void +diagnostic_option_classifier::push () +{ + m_push_list = (int *) xrealloc (m_push_list, (m_n_push + 1) * sizeof (int)); + m_push_list[m_n_push ++] = m_n_classification_history; +} + +/* Restore the topmost classification set off the stack. If the stack + is empty, revert to the state based on command line parameters. */ + +void +diagnostic_option_classifier::pop (location_t where) +{ + int jump_to; + + if (m_n_push) + jump_to = m_push_list [-- m_n_push]; + else + jump_to = 0; + + const int i = m_n_classification_history; + m_classification_history = + (diagnostic_classification_change_t *) xrealloc (m_classification_history, (i + 1) + * sizeof (diagnostic_classification_change_t)); + m_classification_history[i].location = where; + m_classification_history[i].option = jump_to; + m_classification_history[i].kind = DK_POP; + m_n_classification_history ++; +} + /* Initialize the diagnostic message outputting machinery. */ void diagnostic_context::initialize (int n_opts) { - int i; - /* Allocate a basic pretty-printer. Clients will replace this a much more elaborated pretty-printer if they wish. */ this->printer = XNEW (pretty_printer); @@ -165,12 +215,10 @@ diagnostic_context::initialize (int n_opts) memset (m_diagnostic_count, 0, sizeof m_diagnostic_count); m_warning_as_error_requested = false; m_n_opts = n_opts; - m_classify_diagnostic = XNEWVEC (diagnostic_t, n_opts); - for (i = 0; i < n_opts; i++) - m_classify_diagnostic[i] = DK_UNSPECIFIED; + m_option_classifier.init (n_opts); m_source_printing.enabled = false; diagnostic_set_caret_max_width (this, pp_line_cutoff (this->printer)); - for (i = 0; i < rich_location::STATICALLY_ALLOCATED_RANGES; i++) + for (int i = 0; i < rich_location::STATICALLY_ALLOCATED_RANGES; i++) m_source_printing.caret_chars[i] = '^'; m_show_cwe = false; m_show_rules = false; @@ -326,8 +374,7 @@ diagnostic_context::finish () delete m_file_cache; m_file_cache = nullptr; - XDELETEVEC (m_classify_diagnostic); - m_classify_diagnostic = nullptr; + m_option_classifier.fini (); /* diagnostic_context::initialize allocates this->printer using XNEW and placement-new. */ @@ -1052,9 +1099,11 @@ default_diagnostic_finalizer (diagnostic_context *context, range. If OPTION_INDEX is zero, the new setting is for all the diagnostics. */ diagnostic_t -diagnostic_context::classify_diagnostic (int option_index, - diagnostic_t new_kind, - location_t where) +diagnostic_option_classifier:: +classify_diagnostic (const diagnostic_context *context, + int option_index, + diagnostic_t new_kind, + location_t where) { diagnostic_t old_kind; @@ -1074,10 +1123,10 @@ diagnostic_context::classify_diagnostic (int option_index, /* Record the command-line status, so we can reset it back on DK_POP. */ if (old_kind == DK_UNSPECIFIED) { - old_kind = !m_option_enabled (option_index, - m_lang_mask, - m_option_state) - ? DK_IGNORED : (m_warning_as_error_requested + old_kind = !context->m_option_enabled (option_index, + context->m_lang_mask, + context->m_option_state) + ? DK_IGNORED : (context->warning_as_error_requested_p () ? DK_ERROR : DK_WARNING); m_classify_diagnostic[option_index] = old_kind; } @@ -1104,37 +1153,6 @@ diagnostic_context::classify_diagnostic (int option_index, return old_kind; } -/* Save all diagnostic classifications in a stack. */ -void -diagnostic_context::push_diagnostics (location_t where ATTRIBUTE_UNUSED) -{ - m_push_list = (int *) xrealloc (m_push_list, (m_n_push + 1) * sizeof (int)); - m_push_list[m_n_push ++] = m_n_classification_history; -} - -/* Restore the topmost classification set off the stack. If the stack - is empty, revert to the state based on command line parameters. */ -void -diagnostic_context::pop_diagnostics (location_t where) -{ - int jump_to; - int i; - - if (m_n_push) - jump_to = m_push_list [-- m_n_push]; - else - jump_to = 0; - - i = m_n_classification_history; - m_classification_history = - (diagnostic_classification_change_t *) xrealloc (m_classification_history, (i + 1) - * sizeof (diagnostic_classification_change_t)); - m_classification_history[i].location = where; - m_classification_history[i].option = jump_to; - m_classification_history[i].kind = DK_POP; - m_n_classification_history ++; -} - /* Helper function for print_parseable_fixits. Print TEXT to PP, obeying the escaping rules for -fdiagnostics-parseable-fixits. */ @@ -1246,14 +1264,14 @@ diagnostic_context::get_any_inlining_info (diagnostic_info *diagnostic) /* 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 CONTEXT. + directives recorded within this object. Return the new kind of DIAGNOSTIC if it was updated, or DK_UNSPECIFIED otherwise. */ diagnostic_t -diagnostic_context:: -update_effective_level_from_pragmas (diagnostic_info *diagnostic) +diagnostic_option_classifier:: +update_effective_level_from_pragmas (diagnostic_info *diagnostic) const { if (m_n_classification_history <= 0) return DK_UNSPECIFIED; @@ -1444,14 +1462,14 @@ diagnostic_context::diagnostic_enabled (diagnostic_info *diagnostic) return false; /* This tests for #pragma diagnostic changes. */ - diagnostic_t diag_class = update_effective_level_from_pragmas (diagnostic); + diagnostic_t diag_class + = m_option_classifier.update_effective_level_from_pragmas (diagnostic); /* This tests if the user provided the appropriate -Werror=foo option. */ if (diag_class == DK_UNSPECIFIED - && (m_classify_diagnostic[diagnostic->option_index] - != DK_UNSPECIFIED)) - diagnostic->kind = m_classify_diagnostic[diagnostic->option_index]; + && !option_unspecified_p (diagnostic->option_index)) + diagnostic->kind = m_option_classifier.get_current_override (diagnostic->option_index); /* This allows for future extensions, like temporarily disabling warnings for ranges of source code. */ diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h index f9950ec2cf8..b83cdeb35c1 100644 --- a/gcc/diagnostic.h +++ b/gcc/diagnostic.h @@ -168,16 +168,6 @@ struct diagnostic_info } m_iinfo; }; -/* Each time a diagnostic's classification is changed with a pragma, - we record the change and the location of the change in an array of - these structs. */ -struct diagnostic_classification_change_t -{ - location_t location; - int option; - diagnostic_t kind; -}; - /* Forward declarations. */ typedef void (*diagnostic_starter_fn) (diagnostic_context *, diagnostic_info *); @@ -240,6 +230,79 @@ public: void on_diagram (const diagnostic_diagram &diagram) override; }; +/* 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. */ + +class diagnostic_option_classifier +{ +public: + void init (int n_opts); + void fini (); + + /* Save all diagnostic classifications in a stack. */ + void push (); + + /* Restore the topmost classification set off the stack. If the stack + is empty, revert to the state based on command line parameters. */ + void pop (location_t where); + + bool option_unspecified_p (int opt) const + { + return get_current_override (opt) == DK_UNSPECIFIED; + } + + diagnostic_t get_current_override (int opt) const + { + gcc_assert (opt < m_n_opts); + return m_classify_diagnostic[opt]; + } + + 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: + /* Each time a diagnostic's classification is changed with a pragma, + we record the change and the location of the change in an array of + these structs. */ + struct diagnostic_classification_change_t + { + location_t location; + int option; + diagnostic_t kind; + }; + + int m_n_opts; + + /* For each option index that can be passed to warning() et al + (OPT_* from options.h when using this code with the core GCC + options), this array may contain a new kind that the diagnostic + should be changed to before reporting, or DK_UNSPECIFIED to leave + it as the reported kind, or DK_IGNORED to not report it at + all. */ + diagnostic_t *m_classify_diagnostic; + + /* History of all changes to the classifications above. This list + is stored in location-order, so we can search it, either + binary-wise or end-to-front, to find the most recent + classification for a given diagnostic, given the location of the + diagnostic. */ + diagnostic_classification_change_t *m_classification_history; + + /* The size of the above array. */ + int m_n_classification_history; + + /* For pragma push/pop. */ + int *m_push_list; + int m_n_push; +}; + /* This data structure bundles altogether any information relevant to the context of a diagnostic message. */ class diagnostic_context @@ -273,8 +336,7 @@ public: bool option_unspecified_p (int opt) const { - gcc_assert (opt < m_n_opts); - return m_classify_diagnostic[opt] == DK_UNSPECIFIED; + return m_option_classifier.option_unspecified_p (opt); } bool report_diagnostic (diagnostic_info *); @@ -287,9 +349,22 @@ public: diagnostic_t classify_diagnostic (int option_index, diagnostic_t new_kind, - location_t where); - void push_diagnostics (location_t where ATTRIBUTE_UNUSED); - void pop_diagnostics (location_t where); + location_t where) + { + return m_option_classifier.classify_diagnostic (this, + option_index, + new_kind, + where); + } + + void push_diagnostics (location_t where ATTRIBUTE_UNUSED) + { + m_option_classifier.push (); + } + void pop_diagnostics (location_t where) + { + m_option_classifier.pop (where); + } void emit_diagram (const diagnostic_diagram &diagram); @@ -376,9 +451,6 @@ private: bool diagnostic_enabled (diagnostic_info *diagnostic); void get_any_inlining_info (diagnostic_info *diagnostic); - diagnostic_t - update_effective_level_from_pragmas (diagnostic_info *diagnostic); - /* Data members. Ideally, all of these would be private and have "m_" prefixes. */ @@ -401,27 +473,8 @@ private: al. */ int m_n_opts; - /* For each option index that can be passed to warning() et al - (OPT_* from options.h when using this code with the core GCC - options), this array may contain a new kind that the diagnostic - should be changed to before reporting, or DK_UNSPECIFIED to leave - it as the reported kind, or DK_IGNORED to not report it at - all. */ - diagnostic_t *m_classify_diagnostic; - - /* History of all changes to the classifications above. This list - is stored in location-order, so we can search it, either - binary-wise or end-to-front, to find the most recent - classification for a given diagnostic, given the location of the - diagnostic. */ - diagnostic_classification_change_t *m_classification_history; - - /* The size of the above array. */ - int m_n_classification_history; - - /* For pragma push/pop. */ - int *m_push_list; - int m_n_push; + /* The stack of sets of overridden diagnostic option severities. */ + diagnostic_option_classifier m_option_classifier; /* True if we should print any CWE identifiers associated with diagnostics. */