Diagnostics: Use label_text in diagnostics::option_id_manager
Improves memory management in the diagnostics subsystem by using label_text for option IDs.
This commit improves memory management within the GCC diagnostics subsystem. It replaces manual memory management for option names and URLs with label_text, leveraging standard containers to manage the set of rule IDs in SARIF output, which simplifies the code and reduces the risk of memory leaks. This change impacts the generation of diagnostic messages and SARIF reports.
In Details
The commit modifies the diagnostics subsystem to use label_text for option names and URLs, replacing manual memory management. It also converts sarif_builder::m_rule_id_set from a hash_set <free_string_hash> to std::set<std::string>, removing manual memory management in SARIF report generation. This affects diagnostics/context.h, diagnostics/option-id-manager.h, diagnostics/sarif-sink.cc and other files.
For Context
This commit focuses on improving the diagnostics subsystem of GCC, which is responsible for generating warnings and errors during compilation. It replaces manual memory management with more modern C++ constructs like label_text and std::set. This reduces the risk of memory leaks and simplifies the code base, leading to a more robust and maintainable compiler.