diff options
Diffstat (limited to 'gcc/analyzer/diagnostic-manager.cc')
-rw-r--r-- | gcc/analyzer/diagnostic-manager.cc | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/gcc/analyzer/diagnostic-manager.cc b/gcc/analyzer/diagnostic-manager.cc index c083b8c..88f72d1 100644 --- a/gcc/analyzer/diagnostic-manager.cc +++ b/gcc/analyzer/diagnostic-manager.cc @@ -29,7 +29,7 @@ along with GCC; see the file COPYING3. If not see #include "cgraph.h" #include "digraph.h" #include "gcc-rich-location.h" -#include "diagnostic-format-sarif.h" +#include "diagnostics/sarif-sink.h" #include "analyzer/analyzer-logging.h" #include "analyzer/sm.h" @@ -1017,9 +1017,10 @@ saved_diagnostic::emit_any_notes () const This extra data is intended for use when debugging the analyzer. */ void -saved_diagnostic::maybe_add_sarif_properties (sarif_object &result_obj) const +saved_diagnostic:: +maybe_add_sarif_properties (diagnostics::sarif_object &result_obj) const { - sarif_property_bag &props = result_obj.get_or_create_properties (); + auto &props = result_obj.get_or_create_properties (); #define PROPERTY_PREFIX "gcc/analyzer/saved_diagnostic/" if (m_sm) props.set_string (PROPERTY_PREFIX "sm", m_sm->get_name ()); @@ -1044,7 +1045,7 @@ saved_diagnostic::maybe_add_sarif_properties (sarif_object &result_obj) const auto duplicates_arr = std::make_unique<json::array> (); for (auto iter : m_duplicates) { - auto sd_obj = std::make_unique<sarif_object> (); + auto sd_obj = std::make_unique<diagnostics::sarif_object> (); iter->maybe_add_sarif_properties (*sd_obj); duplicates_arr->append (std::move (sd_obj)); } @@ -1541,12 +1542,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) @@ -1555,7 +1556,8 @@ public: } void - maybe_add_sarif_properties (sarif_object &result_obj) const override + maybe_add_sarif_properties (diagnostics::sarif_object &result_obj) + const override { m_sd.maybe_add_sarif_properties (result_obj); } @@ -1583,7 +1585,7 @@ diagnostic_manager::emit_saved_diagnostic (const exploded_graph &eg, /* Precompute all enodes from which the diagnostic is reachable. */ path_builder pb (eg, *epath, sd.get_feasibility_problem (), sd); - /* This is the diagnostic_path subclass that will be built for + /* This is the diagnostics::paths::path subclass that will be built for the diagnostic. */ checker_path emission_path (get_logical_location_manager (), eg.get_ext_state (), @@ -1663,7 +1665,7 @@ diagnostic_manager::emit_saved_diagnostic (const exploded_graph &eg, } } -const logical_location_manager & +const diagnostics::logical_locations::manager & diagnostic_manager::get_logical_location_manager () const { gcc_assert (global_dc); |