]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
diagnostics: move diagnostic_metadata to diagnostics::metadata
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 25 Jul 2025 19:13:35 +0000 (15:13 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Fri, 25 Jul 2025 19:13:35 +0000 (15:13 -0400)
renamed: gcc/diagnostic-metadata.h -> gcc/diagnostics/metadata.h

No functional change intended.

gcc/analyzer/ChangeLog:
* diagnostic-manager.cc: Update for move of diagnostic_metadata to
diagnostics::metadata.
* kf.cc: Likewise.
* pending-diagnostic.h: Likewise; also, update #include for move
of "diagnostic-metadata.h" to "diagnostics/metadata.h".

gcc/cobol/ChangeLog:
* util.cc: Remove redundant #includes

gcc/ChangeLog:
* diagnostic-core.h: Update for move of diagnostic_metadata to
diagnostics::metadata.
* diagnostic-format-html.cc: Likewise; also, update #include for
move of "diagnostic-metadata.h" to "diagnostics/metadata.h".
* diagnostic-format-sarif.cc: Likewise.
* diagnostic-format-text.cc: Likewise.
* diagnostic-global-context.cc: Likewise.
* diagnostic.cc: Likewise.
* diagnostic.h: Likewise.
* diagnostic-metadata.h: Move to...
* diagnostics/metadata.h: ...here, updating header guard.
(class diagnostic_metadata): Move to...
(class diagnostics::metadata): ...here.  Drop redundant
"diagnostics::" qualifiers.
* libgdiagnostics.cc: : Update #include for move of
"diagnostic-metadata.h" to "diagnostics/metadata.h", and update
for move of diagnostic_metadata to diagnostics::metadata.
* selftest-diagnostic.cc: Update for move of diagnostic_metadata
to diagnostics::metadata.
* selftest-diagnostic.h: Likewise.

gcc/rust/ChangeLog:
* rust-diagnostics.cc: Update #include for move of
"diagnostic-metadata.h" to "diagnostics/metadata.h", and update
for move of diagnostic_metadata to diagnostics::metadata.

gcc/testsuite/ChangeLog:
* gcc.dg/plugin/analyzer_cpython_plugin.cc: : Update #include for
move of "diagnostic-metadata.h" to "diagnostics/metadata.h"
* gcc.dg/plugin/analyzer_kernel_plugin.cc: Likewise.
* gcc.dg/plugin/analyzer_known_fns_plugin.cc: Likewise.
* gcc.dg/plugin/diagnostic_plugin_test_graphs.cc: Likewise.  Also
update for move of diagnostic_metadata to diagnostics::metadata.
* gcc.dg/plugin/diagnostic_plugin_test_metadata.cc: Likewise.
* gcc.dg/plugin/diagnostic_plugin_test_paths.cc: Likewise.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
22 files changed:
gcc/analyzer/diagnostic-manager.cc
gcc/analyzer/kf.cc
gcc/analyzer/pending-diagnostic.h
gcc/cobol/util.cc
gcc/diagnostic-core.h
gcc/diagnostic-format-html.cc
gcc/diagnostic-format-sarif.cc
gcc/diagnostic-format-text.cc
gcc/diagnostic-global-context.cc
gcc/diagnostic.cc
gcc/diagnostic.h
gcc/diagnostics/metadata.h [moved from gcc/diagnostic-metadata.h with 86% similarity]
gcc/libgdiagnostics.cc
gcc/rust/rust-diagnostics.cc
gcc/selftest-diagnostic.cc
gcc/selftest-diagnostic.h
gcc/testsuite/gcc.dg/plugin/analyzer_cpython_plugin.cc
gcc/testsuite/gcc.dg/plugin/analyzer_kernel_plugin.cc
gcc/testsuite/gcc.dg/plugin/analyzer_known_fns_plugin.cc
gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_test_graphs.cc
gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_test_metadata.cc
gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_test_paths.cc

index a3bec727c8b9b8697cc45baa4c696c16e9c12217..9258ffa2bcc070a5b346be5c5a00cf54e765095f 100644 (file)
@@ -1541,12 +1541,12 @@ diagnostic_manager::emit_saved_diagnostics (const exploded_graph &eg)
   best_candidates.emit_best (this, eg);
 }
 
-/* Custom subclass of diagnostic_metadata which, for SARIF output,
+/* Custom subclass of diagnostics::metadata which, for SARIF output,
    populates the property bag of the diagnostic's "result" object
    with information from the saved_diagnostic and the
    pending_diagnostic.  */
 
-class pending_diagnostic_metadata : public diagnostic_metadata
+class pending_diagnostic_metadata : public diagnostics::metadata
 {
 public:
   pending_diagnostic_metadata (const saved_diagnostic &sd)
index fe25520fde6f5f9fcbdf0b603d88829309c191f3..2a7c3570315337643e267ab4f5d415e48babedf7 100644 (file)
@@ -783,7 +783,7 @@ public:
 
     /* SEI CERT C Coding Standard: "POS34-C. Do not call putenv() with a
        pointer to an automatic variable as the argument".  */
-    diagnostic_metadata::precanned_rule
+    diagnostics::metadata::precanned_rule
       rule ("POS34-C", "https://wiki.sei.cmu.edu/confluence/x/6NYxBQ");
     ctxt.add_rule (rule);
 
index 469513c726bd4cf77ab098d68b9cec63e40188ac..e703e80fdfbc8e66068b0e20388f1cc5fe0f7a25 100644 (file)
@@ -21,7 +21,7 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_ANALYZER_PENDING_DIAGNOSTIC_H
 #define GCC_ANALYZER_PENDING_DIAGNOSTIC_H
 
-#include "diagnostic-metadata.h"
+#include "diagnostics/metadata.h"
 #include "diagnostic-path.h"
 #include "analyzer/sm.h"
 
@@ -138,7 +138,7 @@ class diagnostic_emission_context
 public:
   diagnostic_emission_context (const saved_diagnostic &sd,
                               rich_location &rich_loc,
-                              diagnostic_metadata &metadata,
+                              diagnostics::metadata &metadata,
                               logger *logger)
   : m_sd (sd),
     m_rich_loc (rich_loc),
@@ -156,7 +156,7 @@ public:
   logger *get_logger () const { return m_logger; }
 
   void add_cwe (int cwe) { m_metadata.add_cwe (cwe); }
-  void add_rule (const diagnostic_metadata::rule &r)
+  void add_rule (const diagnostics::metadata::rule &r)
   {
     m_metadata.add_rule (r);
   }
@@ -164,7 +164,7 @@ public:
 private:
   const saved_diagnostic &m_sd;
   rich_location &m_rich_loc;
-  diagnostic_metadata &m_metadata;
+  diagnostics::metadata &m_metadata;
   logger *m_logger;
 };
 
index 69b758a01b3ab67dff81acc37e2750a5a4d9a37b..ca53b26268974aa0ee188181b3b6397cd4ee1526 100644 (file)
 #include <intl.h>
 #include <backtrace.h>
 #include <diagnostic.h>
-#include <diagnostic-color.h>
-#include <diagnostic-url.h>
-#include <diagnostic-metadata.h>
-#include <diagnostic-path.h>
-#include <edit-context.h>
-#include <selftest.h>
-#include <selftest-diagnostic.h>
 #include <opts.h>
-
 #include "util.h"
 
 #include "cbldiag.h"
index 1e89c9fac5e6646147eddf53ce683d740e249fc7..0132e955e061958a874c19f6e7c72ab9735a0893 100644 (file)
@@ -61,7 +61,9 @@ class auto_diagnostic_nesting_level
 };
 
 /* Forward decl.  */
-class diagnostic_metadata; /* See diagnostic-metadata.h.  */
+namespace diagnostics {
+   class metadata; /* See diagnostics/metadata.h.  */
+} // namespace diagnostics
 
 /* A class to use for the ID of an option that controls
    a particular diagnostic.
@@ -130,7 +132,7 @@ extern bool warning_at (rich_location *,
                        const char *, ...)
     ATTRIBUTE_GCC_DIAG(3,4);
 extern bool warning_meta (rich_location *,
-                         const diagnostic_metadata &,
+                         const diagnostics::metadata &,
                          diagnostic_option_id,
                          const char *, ...)
     ATTRIBUTE_GCC_DIAG(4,5);
@@ -141,7 +143,7 @@ extern void error_n (location_t, unsigned HOST_WIDE_INT, const char *,
 extern void error_at (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
 extern void error_at (rich_location *, const char *, ...)
   ATTRIBUTE_GCC_DIAG(2,3);
-extern void error_meta (rich_location *, const diagnostic_metadata &,
+extern void error_meta (rich_location *, const diagnostics::metadata &,
                        const char *, ...)
   ATTRIBUTE_GCC_DIAG(3,4);
 extern void fatal_error (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3)
@@ -189,7 +191,7 @@ extern bool emit_diagnostic_valist (diagnostic_t,
   ATTRIBUTE_GCC_DIAG (4,0);
 extern bool emit_diagnostic_valist_meta (diagnostic_t,
                                         rich_location *,
-                                        const diagnostic_metadata *,
+                                        const diagnostics::metadata *,
                                         diagnostic_option_id,
                                         const char *,
                                         va_list *) ATTRIBUTE_GCC_DIAG (5,0);
index 945be3e08a872c769d7e041edecc7641abff16b4..ceca1612fd61eb58a221a67d4a3bfda3e651b7c6 100644 (file)
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "diagnostic.h"
-#include "diagnostic-metadata.h"
+#include "diagnostics/metadata.h"
 #include "diagnostic-format.h"
 #include "diagnostic-format-html.h"
 #include "diagnostic-format-text.h"
@@ -142,7 +142,7 @@ public:
   }
 
   std::unique_ptr<xml::element>
-  make_element_for_metadata (const diagnostic_metadata &metadata);
+  make_element_for_metadata (const metadata &);
 
   std::unique_ptr<xml::element>
   make_element_for_patch (const diagnostic_info &diagnostic);
@@ -1209,11 +1209,11 @@ html_builder::make_metadata_element (label_text label,
 }
 
 std::unique_ptr<xml::element>
-html_builder::make_element_for_metadata (const diagnostic_metadata &metadata)
+html_builder::make_element_for_metadata (const metadata &m)
 {
   auto span_metadata = make_span ("gcc-metadata");
 
-  int cwe = metadata.get_cwe ();
+  int cwe = m.get_cwe ();
   if (cwe)
     {
       pretty_printer pp;
@@ -1224,9 +1224,9 @@ html_builder::make_element_for_metadata (const diagnostic_metadata &metadata)
        (make_metadata_element (std::move (label), std::move (url)));
     }
 
-  for (unsigned idx = 0; idx < metadata.get_num_rules (); ++idx)
+  for (unsigned idx = 0; idx < m.get_num_rules (); ++idx)
     {
-      auto &rule = metadata.get_rule (idx);
+      auto &rule = m.get_rule (idx);
       label_text label = label_text::take (rule.make_description ());
       label_text url = label_text::take (rule.make_url ());
       span_metadata->add_child
@@ -1652,9 +1652,9 @@ test_metadata ()
   html_builder &b = dc.get_builder ();
 
   {
-    diagnostic_metadata metadata;
-    metadata.add_cwe (415);
-    auto element = b.make_element_for_metadata (metadata);
+    metadata m;
+    m.add_cwe (415);
+    auto element = b.make_element_for_metadata (m);
     ASSERT_XML_PRINT_EQ
       (*element,
        "<span class=\"gcc-metadata\">"
@@ -1669,11 +1669,11 @@ test_metadata ()
   }
 
   {
-    diagnostic_metadata metadata;
-    diagnostic_metadata::precanned_rule rule ("MISC-42",
-                                             "http://example.com");
-    metadata.add_rule (rule);
-    auto element = b.make_element_for_metadata (metadata);
+    metadata m;
+    metadata::precanned_rule rule ("MISC-42",
+                                  "http://example.com");
+    m.add_rule (rule);
+    auto element = b.make_element_for_metadata (m);
     ASSERT_XML_PRINT_EQ
       (*element,
        "<span class=\"gcc-metadata\">"
index 2a9956ba91a30cb01e8806e933f106cf15ea87ee..44d94c758836a8b0f2afe137b0d75c3897487e4b 100644 (file)
@@ -27,7 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "diagnostic.h"
-#include "diagnostic-metadata.h"
+#include "diagnostics/metadata.h"
 #include "diagnostics/digraphs.h"
 #include "diagnostics/state-graphs.h"
 #include "diagnostic-path.h"
@@ -745,7 +745,7 @@ sarif_serialization_format_json::write_to_file (FILE *outf,
    - doesn't capture -Werror cleanly
    - doesn't capture inlining information (can SARIF handle this?)
    - doesn't capture macro expansion information (can SARIF handle this?).
-   - doesn't capture any diagnostic_metadata::rules associated with
+   - doesn't capture any diagnostics::metadata::rules associated with
      a diagnostic.  */
 
 class sarif_builder
@@ -2039,7 +2039,7 @@ sarif_builder::make_result_object (const diagnostic_info &diagnostic,
 
       diagnostic.metadata->maybe_add_sarif_properties (*result_obj);
 
-      /* We don't yet support diagnostic_metadata::rule.  */
+      /* We don't yet support diagnostics::metadata::rule.  */
     }
 
   /* "level" property (SARIF v2.1.0 section 3.27.10).  */
index 7ecbe5f9563c7a52c7f255b5fa46b8f0f31aade3..0696a349b51cd6466fb515bcf57fb8adfe3fb290 100644 (file)
@@ -27,7 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "diagnostic.h"
 #include "diagnostic-color.h"
 #include "diagnostic-url.h"
-#include "diagnostic-metadata.h"
+#include "diagnostics/metadata.h"
 #include "diagnostic-path.h"
 #include "diagnostic-client-data-hooks.h"
 #include "diagnostic-diagram.h"
@@ -512,7 +512,7 @@ print_any_rules (const diagnostic_info &diagnostic)
 
   for (unsigned idx = 0; idx < diagnostic.metadata->get_num_rules (); idx++)
     {
-      const diagnostic_metadata::rule &rule
+      const diagnostics::metadata::rule &rule
        = diagnostic.metadata->get_rule (idx);
       if (char *desc = rule.make_description ())
        {
index 1165915fabcd620d4c4280f8104cc3cbe0530fd9..5eba3aa894aa4adba1f4ae132eb32dc7f62035c1 100644 (file)
@@ -103,7 +103,7 @@ emit_diagnostic_valist (diagnostic_t kind,
 bool
 emit_diagnostic_valist_meta (diagnostic_t kind,
                             rich_location *richloc,
-                            const diagnostic_metadata *metadata,
+                            const diagnostics::metadata *metadata,
                             diagnostic_option_id option_id,
                             const char *gmsgid, va_list *ap)
 {
@@ -210,7 +210,7 @@ warning_at (rich_location *richloc,
 
 bool
 warning_meta (rich_location *richloc,
-             const diagnostic_metadata &metadata,
+             const diagnostics::metadata &metadata,
              diagnostic_option_id option_id,
              const char *gmsgid, ...)
 {
@@ -443,7 +443,7 @@ error_at (rich_location *richloc, const char *gmsgid, ...)
 /* Same as above, but with metadata.  */
 
 void
-error_meta (rich_location *richloc, const diagnostic_metadata &metadata,
+error_meta (rich_location *richloc, const diagnostics::metadata &metadata,
            const char *gmsgid, ...)
 {
   gcc_assert (richloc);
index 9eab7bacebcdbeb4b71b575f3083d2c9505a00a1..86bf4e3180a2a11df5c71ff55aa8f18fbfd1cdc8 100644 (file)
@@ -33,7 +33,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "diagnostic.h"
 #include "diagnostic-color.h"
 #include "diagnostic-url.h"
-#include "diagnostic-metadata.h"
+#include "diagnostics/metadata.h"
 #include "diagnostic-path.h"
 #include "diagnostic-client-data-hooks.h"
 #include "diagnostic-diagram.h"
@@ -1372,7 +1372,7 @@ bool
 diagnostic_context::
 emit_diagnostic_with_group (diagnostic_t kind,
                            rich_location &richloc,
-                           const diagnostic_metadata *metadata,
+                           const diagnostics::metadata *metadata,
                            diagnostic_option_id option_id,
                            const char *gmsgid, ...)
 {
@@ -1395,7 +1395,7 @@ bool
 diagnostic_context::
 emit_diagnostic_with_group_va (diagnostic_t kind,
                               rich_location &richloc,
-                              const diagnostic_metadata *metadata,
+                              const diagnostics::metadata *metadata,
                               diagnostic_option_id option_id,
                               const char *gmsgid, va_list *ap)
 {
@@ -1688,7 +1688,7 @@ trim_filename (const char *name)
    and internal_error_no_backtrace, as documented and defined below.  */
 bool
 diagnostic_context::diagnostic_impl (rich_location *richloc,
-                                    const diagnostic_metadata *metadata,
+                                    const diagnostics::metadata *metadata,
                                     diagnostic_option_id option_id,
                                     const char *gmsgid,
                                     va_list *ap, diagnostic_t kind)
@@ -1714,7 +1714,7 @@ diagnostic_context::diagnostic_impl (rich_location *richloc,
    defined below.  */
 bool
 diagnostic_context::diagnostic_n_impl (rich_location *richloc,
-                                      const diagnostic_metadata *metadata,
+                                      const diagnostics::metadata *metadata,
                                       diagnostic_option_id option_id,
                                       unsigned HOST_WIDE_INT n,
                                       const char *singular_gmsgid,
index 5ccf30ca0295b97cd08e5cf427eee0ac47c7eac3..70156fed236a58da43fd237ab70b818cd214dcd2 100644 (file)
@@ -161,7 +161,7 @@ struct diagnostic_info
 
   /* An optional bundle of metadata associated with the diagnostic
      (or NULL).  */
-  const diagnostic_metadata *metadata;
+  const diagnostics::metadata *metadata;
 
   /* Auxiliary data for client.  */
   void *x_data;
@@ -615,13 +615,13 @@ public:
 
   bool emit_diagnostic_with_group (diagnostic_t kind,
                                   rich_location &richloc,
-                                  const diagnostic_metadata *metadata,
+                                  const diagnostics::metadata *metadata,
                                   diagnostic_option_id option_id,
                                   const char *gmsgid, ...)
     ATTRIBUTE_GCC_DIAG(6,7);
   bool emit_diagnostic_with_group_va (diagnostic_t kind,
                                      rich_location &richloc,
-                                     const diagnostic_metadata *metadata,
+                                     const diagnostics::metadata *metadata,
                                      diagnostic_option_id option_id,
                                      const char *gmsgid, va_list *ap)
     ATTRIBUTE_GCC_DIAG(6,0);
@@ -785,10 +785,10 @@ public:
     return m_lang_mask;
   }
 
-  bool diagnostic_impl (rich_location *, const diagnostic_metadata *,
+  bool diagnostic_impl (rich_location *, const diagnostics::metadata *,
                        diagnostic_option_id, const char *,
                        va_list *, diagnostic_t) ATTRIBUTE_GCC_DIAG(5,0);
-  bool diagnostic_n_impl (rich_location *, const diagnostic_metadata *,
+  bool diagnostic_n_impl (rich_location *, const diagnostics::metadata *,
                          diagnostic_option_id, unsigned HOST_WIDE_INT,
                          const char *, const char *, va_list *,
                          diagnostic_t) ATTRIBUTE_GCC_DIAG(7,0);
similarity index 86%
rename from gcc/diagnostic-metadata.h
rename to gcc/diagnostics/metadata.h
index f6ea7dc16c880a03336f952a7783b76f508407ed..d0b4220c90593c44cd6c0ecc414d50d214c972f9 100644 (file)
@@ -18,16 +18,16 @@ You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
-#ifndef GCC_DIAGNOSTIC_METADATA_H
-#define GCC_DIAGNOSTIC_METADATA_H
+#ifndef GCC_DIAGNOSTICS_METADATA_H
+#define GCC_DIAGNOSTICS_METADATA_H
 
 class sarif_object;
 
 namespace diagnostics {
+
   namespace digraphs {
     class lazy_digraphs;
   } // namespace digraphs
-} // namespace diagnostics
 
 /* A bundle of additional metadata that can be associated with a
    diagnostic.
@@ -38,7 +38,7 @@ namespace diagnostics {
    Additionally, this provides a place to associate a diagnostic
    with zero or more directed graphs.  */
 
-class diagnostic_metadata
+class metadata
 {
  public:
   /* Abstract base class for referencing a rule that has been violated,
@@ -73,8 +73,8 @@ class diagnostic_metadata
     const char *m_url;
   };
 
-  diagnostic_metadata () : m_cwe (0), m_lazy_digraphs (nullptr) {}
-  virtual ~diagnostic_metadata () {}
+  metadata () : m_cwe (0), m_lazy_digraphs (nullptr) {}
+  virtual ~metadata () {}
 
   /* Hook for SARIF output to allow for adding diagnostic-specific
      properties to  the result object's property bag.  */
@@ -97,12 +97,12 @@ class diagnostic_metadata
   const rule &get_rule (unsigned idx) const { return *(m_rules[idx]); }
 
   void
-  set_lazy_digraphs (const diagnostics::digraphs::lazy_digraphs *lazy_digraphs)
+  set_lazy_digraphs (const digraphs::lazy_digraphs *lazy_digraphs)
   {
     m_lazy_digraphs = lazy_digraphs;
   }
 
-  const diagnostics::digraphs::lazy_digraphs *
+  const digraphs::lazy_digraphs *
   get_lazy_digraphs () const
   {
     return m_lazy_digraphs;
@@ -114,7 +114,9 @@ class diagnostic_metadata
 
   /* An optional way to create directed graphs associated with the
      diagnostic, for the sinks that support this (e.g. SARIF).  */
-  const diagnostics::digraphs::lazy_digraphs *m_lazy_digraphs;
+  const digraphs::lazy_digraphs *m_lazy_digraphs;
 };
 
-#endif /* ! GCC_DIAGNOSTIC_METADATA_H */
+} // namespace diagnostics
+
+#endif /* ! GCC_DIAGNOSTICS_METADATA_H */
index 8ccb278995863ee550e3b55b8780f6cee1202f74..7e93593da2a9a696c116755c073f4077c56201e4 100644 (file)
@@ -27,7 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "diagnostic.h"
 #include "diagnostic-color.h"
 #include "diagnostic-url.h"
-#include "diagnostic-metadata.h"
+#include "diagnostics/metadata.h"
 #include "diagnostic-path.h"
 #include "diagnostic-client-data-hooks.h"
 #include "diagnostic-format-sarif.h"
@@ -930,7 +930,7 @@ private:
   char *m_text;
 };
 
-class impl_rule : public diagnostic_metadata::rule
+class impl_rule : public diagnostics::metadata::rule
 {
 public:
   impl_rule (const char *title, const char *url)
@@ -1226,7 +1226,7 @@ public:
   enum diagnostic_level get_level () const { return m_level; }
 
   rich_location *get_rich_location () { return &m_rich_loc; }
-  const diagnostic_metadata *get_metadata () { return &m_metadata; }
+  const diagnostics::metadata *get_metadata () { return &m_metadata; }
 
   void set_cwe (unsigned cwe_id)
   {
@@ -1322,7 +1322,7 @@ private:
   enum diagnostic_level m_level;
   impl_rich_location m_rich_loc;
   const diagnostic_logical_location *m_logical_loc;
-  diagnostic_metadata m_metadata;
+  diagnostics::metadata m_metadata;
   prebuilt_digraphs m_graphs;
   std::vector<std::unique_ptr<range_label>> m_labels;
   std::vector<std::unique_ptr<impl_rule>> m_rules;
index 0c0ef6ed7e23a9936ee334685f9f2027a20771c8..702da718df94602d2f60bfcc44a3a29e92771c16 100644 (file)
@@ -22,7 +22,7 @@
 #include "rust-diagnostics.h"
 
 #include "options.h"
-#include "diagnostic-metadata.h"
+#include "diagnostics/metadata.h"
 
 static std::string
 mformat_value ()
@@ -192,7 +192,7 @@ rust_error_at (const location_t location, const char *fmt, ...)
   va_end (ap);
 }
 
-class rust_error_code_rule : public diagnostic_metadata::rule
+class rust_error_code_rule : public diagnostics::metadata::rule
 {
 public:
   rust_error_code_rule (const ErrorCode code) : m_code (code) {}
@@ -237,7 +237,7 @@ rust_be_error_at (const location_t location, const ErrorCode code,
                  const std::string &errmsg)
 {
   rich_location gcc_loc (line_table, location);
-  diagnostic_metadata m;
+  diagnostics::metadata m;
   rust_error_code_rule rule (code);
   m.add_rule (rule);
   error_meta (&gcc_loc, m, "%s", errmsg.c_str ());
@@ -260,7 +260,7 @@ rust_be_error_at (const rich_location &location, const ErrorCode code,
 {
   /* TODO: 'error_at' would like a non-'const' 'rich_location *'.  */
   rich_location &gcc_loc = const_cast<rich_location &> (location);
-  diagnostic_metadata m;
+  diagnostics::metadata m;
   rust_error_code_rule rule (code);
   m.add_rule (rule);
   error_meta (&gcc_loc, m, "%s", errmsg.c_str ());
@@ -281,7 +281,7 @@ void
 rust_be_error_at (rich_location *richloc, const ErrorCode code,
                  const std::string &errmsg)
 {
-  diagnostic_metadata m;
+  diagnostics::metadata m;
   rust_error_code_rule rule (code);
   m.add_rule (rule);
   error_meta (richloc, m, "%s", errmsg.c_str ());
index eeee2eb8fe317b90048ba555fcb1dd8aa8dd750d..3687d603941ffa0448e927056699baebbb1c77fc 100644 (file)
@@ -68,7 +68,7 @@ start_span_cb (const diagnostic_location_print_policy &loc_policy,
 bool
 test_diagnostic_context::report (diagnostic_t kind,
                                 rich_location &richloc,
-                                const diagnostic_metadata *metadata,
+                                const diagnostics::metadata *metadata,
                                 diagnostic_option_id option,
                                 const char * fmt, ...)
 {
index 4a4331016e2ba8c7fb4c281603da39a0e7b8ff93..53a78f87f02305e91be57ea2151296fba12fc211 100644 (file)
@@ -49,7 +49,7 @@ class test_diagnostic_context : public diagnostic_context
   bool
   report (diagnostic_t kind,
          rich_location &richloc,
-         const diagnostic_metadata *metadata,
+         const diagnostics::metadata *metadata,
          diagnostic_option_id option,
          const char * fmt, ...) ATTRIBUTE_GCC_DIAG(6,7);
 
index 1fe5b5c7a69ee4c93da65c1666dc84bf47b2df46..fe59b72db0c213042917994f6fd9a0b2bf1ca1c0 100644 (file)
@@ -24,7 +24,7 @@
 #include "fold-const.h"
 #include "tree-pretty-print.h"
 #include "diagnostic-color.h"
-#include "diagnostic-metadata.h"
+#include "diagnostics/metadata.h"
 #include "tristate.h"
 #include "bitmap.h"
 #include "selftest.h"
index 18e054b5dd65b594cc37d76fd851af99f04d5017..bbcdb7ae089f46dff5f8cffdd9495fdef946d26f 100644 (file)
@@ -24,7 +24,7 @@
 #include "fold-const.h"
 #include "tree-pretty-print.h"
 #include "diagnostic-color.h"
-#include "diagnostic-metadata.h"
+#include "diagnostics/metadata.h"
 #include "tristate.h"
 #include "bitmap.h"
 #include "selftest.h"
index 5a6e0759b4fe2a91b52449a5435c13abf6b52dad..1c0cc60db730349e6fbffdaaf7925c2f5f887e7f 100644 (file)
@@ -24,7 +24,7 @@
 #include "fold-const.h"
 #include "tree-pretty-print.h"
 #include "diagnostic-color.h"
-#include "diagnostic-metadata.h"
+#include "diagnostics/metadata.h"
 #include "tristate.h"
 #include "bitmap.h"
 #include "selftest.h"
index cfaffbf346178b40fae54bc58c8ee4f839f243c1..fe54fe90c90c2457c694f10c3a0e9acdae080584 100644 (file)
@@ -33,7 +33,7 @@
 #include "diagnostic.h"
 #include "context.h"
 #include "gcc-rich-location.h"
-#include "diagnostic-metadata.h"
+#include "diagnostics/metadata.h"
 #include "diagnostics/digraphs.h"
 #include "pass_manager.h"
 
@@ -230,7 +230,7 @@ report_diag_with_graphs (location_t loc)
   };
 
   gcc_rich_location rich_loc (loc);
-  diagnostic_metadata meta;
+  diagnostics::metadata meta;
   my_lazy_digraphs ldg;
   meta.set_lazy_digraphs (&ldg);
   error_meta (&rich_loc, meta,
index b86a8b3650ef82bb69b52a576285abb96922baa8..a1d003e53664a293ead461527a69bf3913a22015 100644 (file)
@@ -1,4 +1,4 @@
-/* This plugin exercises diagnostic_metadata.  */
+/* This plugin exercises diagnostics::metadata.  */
 
 #include "gcc-plugin.h"
 #include "config.h"
@@ -28,7 +28,7 @@
 #include "diagnostic.h"
 #include "context.h"
 #include "gcc-rich-location.h"
-#include "diagnostic-metadata.h"
+#include "diagnostics/metadata.h"
 
 int plugin_is_GPL_compatible;
 
@@ -89,7 +89,7 @@ check_for_named_call (gimple *stmt,
   return call;
 }
 
-/* Exercise diagnostic_metadata.  */
+/* Exercise diagnostics::metadata.  */
 
 unsigned int
 pass_test_metadata::execute (function *fun)
@@ -106,13 +106,13 @@ pass_test_metadata::execute (function *fun)
        if (gcall *call = check_for_named_call (stmt, "gets", 1))
          {
            gcc_rich_location richloc (gimple_location (call));
-           diagnostic_metadata m;
+           diagnostics::metadata m;
 
            /* CWE-242: Use of Inherently Dangerous Function.  */
            m.add_cwe (242);
 
-           /* Example of a diagnostic_metadata::rule.  */
-           diagnostic_metadata::precanned_rule
+           /* Example of a diagnostics::metadata::rule.  */
+           diagnostics::metadata::precanned_rule
              test_rule ("STR34-C", "https://example.com/");
            m.add_rule (test_rule);
 
index a7963fae6baa067cdb525118afdaa2fff02f735b..babfc3b158bcb0a5ebe362427b367631cf18d467 100644 (file)
@@ -33,7 +33,7 @@
 #include "plugin-version.h"
 #include "diagnostic.h"
 #include "diagnostic-path.h"
-#include "diagnostic-metadata.h"
+#include "diagnostics/metadata.h"
 #include "context.h"
 #include "print-tree.h"
 #include "gcc-rich-location.h"
@@ -363,7 +363,7 @@ example_2 ()
 
       richloc.set_path (&path);
 
-      diagnostic_metadata m;
+      diagnostics::metadata m;
       m.add_cwe (415); /* CWE-415: Double Free.  */
 
       warning_meta (&richloc, m, 0,
@@ -441,7 +441,7 @@ example_3 ()
 
       richloc.set_path (&path);
 
-      diagnostic_metadata m;
+      diagnostics::metadata m;
       /* CWE-479: Signal Handler Use of a Non-reentrant Function.  */
       m.add_cwe (479);
 
@@ -524,7 +524,7 @@ example_4 ()
         thread_2, event_a_acquired);
       richloc.set_path (&path);
 
-      diagnostic_metadata m;
+      diagnostics::metadata m;
       warning_meta (&richloc, m, 0,
                    "deadlock due to inconsistent lock acquisition order");
     }