GCC Middle and Back End API Reference
diagnostic_metadata Class Reference

#include <diagnostic-metadata.h>

Collaboration diagram for diagnostic_metadata:

Data Structures

class  precanned_rule
 
class  rule
 

Public Member Functions

 diagnostic_metadata ()
 
virtual ~diagnostic_metadata ()
 
virtual void maybe_add_sarif_properties (sarif_object &) const
 
void add_cwe (int cwe)
 
int get_cwe () const
 
void add_rule (const rule &r)
 
unsigned get_num_rules () const
 
const ruleget_rule (unsigned idx) const
 

Private Attributes

int m_cwe
 
auto_vec< const rule * > m_rules
 

Detailed Description

A bundle of additional metadata that can be associated with a
diagnostic.

This supports an optional CWE identifier, and zero or more
"rules".   

Constructor & Destructor Documentation

◆ diagnostic_metadata()

diagnostic_metadata::diagnostic_metadata ( )
inline

◆ ~diagnostic_metadata()

virtual diagnostic_metadata::~diagnostic_metadata ( )
inlinevirtual

Member Function Documentation

◆ add_cwe()

void diagnostic_metadata::add_cwe ( int cwe)
inline

References m_cwe.

◆ add_rule()

void diagnostic_metadata::add_rule ( const rule & r)
inline

References m_rules, and r.

◆ get_cwe()

int diagnostic_metadata::get_cwe ( ) const
inline

◆ get_num_rules()

unsigned diagnostic_metadata::get_num_rules ( ) const
inline

References m_rules.

Referenced by diagnostic_context::print_any_rules().

◆ get_rule()

const rule & diagnostic_metadata::get_rule ( unsigned idx) const
inline

References m_rules.

Referenced by diagnostic_context::print_any_rules().

◆ maybe_add_sarif_properties()

virtual void diagnostic_metadata::maybe_add_sarif_properties ( sarif_object & ) const
inlinevirtual

Field Documentation

◆ m_cwe

int diagnostic_metadata::m_cwe
private

Referenced by add_cwe(), and get_cwe().

◆ m_rules

auto_vec<const rule *> diagnostic_metadata::m_rules
private

Referenced by add_rule(), get_num_rules(), and get_rule().


The documentation for this class was generated from the following file: