CodeSonar C++ API
Static Public Member Functions | List of all members
cs::analysis Class Reference

Manages the warning classes (warningclass) and visitors (visitor) for the analysis. More...

Static Public Member Functions

static void add_cache_cleanup_visitor (visitor< project > *v)
 Add v as a cache-cleanup visitor.
 
static void add_compunit_drop_visitor (visitor< compunit > *v)
 Add v as a drop phase compilation unit (compunit) visitor.
 
template<size_t N>
static void add_compunit_finish_visitor (visitor< compunit > *v, const language(&langs)[N])
 Identical to add_compunit_finish_visitor(visitor<compunit> *, const std::vector<language> &) except for type of langs argument.
 
static void add_compunit_finish_visitor (visitor< compunit > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a serial depth-first phase finish visitor for compilation units (compunit) whose languages appear in langs.
 
template<size_t N>
static void add_compunit_parallel_finish_visitor (visitor< compunit > *v, const language(&langs)[N])
 Identical to add_compunit_parallel_finish_visitor(visitor<compunit> *, const std::vector<language> &) except for type of langs argument.
 
static void add_compunit_parallel_finish_visitor (visitor< compunit > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a parallel depth-first phase finish visitor for compilation units (compunit) whose languages appear in langs.
 
template<size_t N>
static void add_compunit_parallel_visitor (visitor< compunit > *v, const language(&langs)[N])
 Identical to add_compunit_parallel_visitor(visitor<compunit> *,const std::vector<language> &) except for type of langs argument.
 
static void add_compunit_parallel_visitor (visitor< compunit > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a parallel depth-first phase visitor for compilation units (compunit) whose languages appear in langs.
 
template<size_t N>
static void add_compunit_visitor (visitor< compunit > *v, const language(&langs)[N])
 Identical to add_compunit_visitor(visitor<compunit> *,const std::vector<language> &) except for type of langs argument.
 
static void add_compunit_visitor (visitor< compunit > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a serial depth-first phase visitor for compilation units (compunit) whose languages appear in langs.
 
static void add_global_symbol_drop_visitor (visitor< symbol > *v)
 Add v as a drop phase visitor for global symbols (symbol).
 
static void add_hub_rpc_handler (std::string message_name, rpc_handler *handler)
 Add handler as a hub remote procedure call (RPC) handler for the analysis, with name message_name.
 
template<size_t N>
static void add_point_bottom_up_visitor (visitor< point > *v, const language(&langs)[N])
 Identical to add_point_bottom_up_visitor(visitor<point> *, const std::vector<language> &) except for type of langs argument.
 
static void add_point_bottom_up_visitor (visitor< point > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a bottom-up phase visitor for points (point) in compilation units whose languages appear in langs.
 
template<size_t N>
static void add_point_parallel_visitor (visitor< point > *v, const language(&langs)[N])
 Identical to add_point_parallel_visitor(visitor<point> *, const std::vector<language> &) except for type of langs argument.
 
static void add_point_parallel_visitor (visitor< point > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a parallel depth-first phase visitor for points (point) in compilation units whose languages appear in langs.
 
template<size_t N>
static void add_point_visitor (visitor< point > *v, const language(&langs)[N])
 Identical to add_point_visitor(visitor<point> *, const std::vector<language> &) except for type of langs argument.
 
static void add_point_visitor (visitor< point > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a serial depth-first phase visitor for points (point) in compilation units whose languages appear in langs.
 
template<size_t N>
static void add_procedure_bottom_up_finish_visitor (visitor< procedure > *v, const language(&langs)[N])
 Identical to add_procedure_bottom_up_finish_visitor(visitor<procedure> *, const std::vector<language> &) except for type of langs argument.
 
static void add_procedure_bottom_up_finish_visitor (visitor< procedure > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a bottom-up phase finish visitor for procedures (procedure) in compilation units whose languages (language) appear in langs.
 
template<size_t N>
static void add_procedure_bottom_up_visitor (visitor< procedure > *v, const language(&langs)[N])
 Identical to add_procedure_bottom_up_visitor(visitor<procedure> *, const std::vector<language> &) except for type of langs argument.
 
static void add_procedure_bottom_up_visitor (visitor< procedure > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a bottom-up phase visitor for procedures (procedure) in compilation units whose languages appear in langs.
 
static void add_procedure_drop_visitor (visitor< procedure > *v)
 Add v as a drop phase procedure visitor.
 
template<size_t N>
static void add_procedure_finish_visitor (visitor< procedure > *v, const language(&langs)[N])
 Identical to add_procedure_finish_visitor(visitor<procedure> *, const std::vector<language> &) except for type of langs argument.
 
static void add_procedure_finish_visitor (visitor< procedure > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a serial depth-first phase finish visitor for procedures (procedure) in compilation units whose languages appear in langs.
 
template<size_t N>
static void add_procedure_parallel_finish_visitor (visitor< procedure > *v, const language(&langs)[N])
 Identical to add_procedure_parallel_finish_visitor(visitor<procedure> *, const std::vector<language> &) except for type of langs argument.
 
static void add_procedure_parallel_finish_visitor (visitor< procedure > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a parallel depth-first phase finish visitor for procedures (procedure) in compilation units whose languages appear in langs.
 
template<size_t N>
static void add_procedure_parallel_visitor (visitor< procedure > *v, const language(&langs)[N])
 Identical to add_procedure_parallel_visitor(visitor<procedure> *, const std::vector<language> &) except for type of langs argument.
 
static void add_procedure_parallel_visitor (visitor< procedure > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a parallel depth-first phase visitor for procedures in compilation units (compunit) whose languages appear in langs.
 
template<size_t N>
static void add_procedure_visitor (visitor< procedure > *v, const language(&langs)[N])
 Identical to add_procedure_visitor(visitor<procedure> *, const std::vector<language> &) except for type of langs argument.
 
static void add_procedure_visitor (visitor< procedure > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a serial depth-first phase visitor for procedures in compilation units (compunit) whose languages appear in langs.
 
template<size_t N>
static void add_project_bottom_up_finish_visitor (visitor< project > *v, const language(&langs)[N])
 Identical to add_project_bottom_up_finish_visitor(visitor<project> *, const std::vector<language> &) except for type of langs argument.
 
static void add_project_bottom_up_finish_visitor (visitor< project > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a bottom-up program finish visitor for programs (project) whose languages (language) appear in langs.
 
template<size_t N>
static void add_project_bottom_up_visitor (visitor< project > *v, const language(&langs)[N])
 Identical to add_project_bottom_up_visitor(visitor<project> *, const std::vector<language> &) except for type of langs argument.
 
static void add_project_bottom_up_visitor (visitor< project > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a bottom-up program visitor for programs (project) whose languages appear in langs.
 
static void add_project_drop_finish_visitor (visitor< project > *v)
 Add v to the list of program drop finish visitors, which are invoked at the end of the drop phase.
 
static void add_project_drop_visitor (visitor< project > *v)
 Add v to the list of program drop visitors, which are invoked at the beginning of the drop phase.
 
template<size_t N>
static void add_project_finish_visitor (visitor< project > *v, const language(&langs)[N])
 Identical to add_project_finish_visitor(visitor<project> *, const std::vector<language> &) except for type of langs argument.
 
static void add_project_finish_visitor (visitor< project > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a serial depth-first program finish visitor for programs (project) whose languages (language) appear in langs.
 
template<size_t N>
static void add_project_parallel_finish_visitor (visitor< project > *v, const language(&langs)[N])
 Identical to add_project_parallel_finish_visitor(visitor<project> *, const std::vector<language> &) except for type of langs argument.
 
static void add_project_parallel_finish_visitor (visitor< project > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a parallel depth-first program finish visitor for programs (project) whose languages (language) appear in langs.
 
template<size_t N>
static void add_project_parallel_visitor (visitor< project > *v, const language(&langs)[N])
 Identical to add_project_parallel_visitor(visitor<project> *,const std::vector<language> &) except for type of langs argument.
 
static void add_project_parallel_visitor (visitor< project > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a parallel depth-first program visitor for programs (project) whose languages appear in langs.
 
template<size_t N>
static void add_project_visitor (visitor< project > *v, const language(&langs)[N])
 Identical to add_project_visitor(visitor<project> *,const std::vector<language> &) except for type of langs argument.
 
static void add_project_visitor (visitor< project > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a serial depth-first program visitor for programs (project) whose languages appear in langs.
 
template<size_t N>
static void add_sfile_finish_visitor (visitor< sfileinst > *v, const language(&langs)[N])
 Identical to add_sfile_finish_visitor(visitor<sfileinst> *, const std::vector<language> &) except for type of langs argument.
 
static void add_sfile_finish_visitor (visitor< sfileinst > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a serial depth-first phase finish visitor for (representative instances of) files in compilation units whose languages appear in langs.
 
template<size_t N>
static void add_sfile_parallel_finish_visitor (visitor< sfileinst > *v, const language(&langs)[N])
 Identical to add_sfile_parallel_finish_visitor(visitor<sfileinst> *, const std::vector<language> &) except for type of langs argument.
 
static void add_sfile_parallel_finish_visitor (visitor< sfileinst > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a parallel depth-first phase finish visitor for (representative instances of) files in compilation units whose languages appear in langs.
 
template<size_t N>
static void add_sfile_parallel_visitor (visitor< sfileinst > *v, const language(&langs)[N])
 Identical to add_sfile_parallel_visitor(visitor<sfileinst> *, const std::vector<language> &) except for type of langs argument.
 
static void add_sfile_parallel_visitor (visitor< sfileinst > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a parallel depth-first phase visitor for (representative instances of) files in compilation units whose languages appear in langs.
 
template<size_t N>
static void add_sfile_visitor (visitor< sfileinst > *v, const language(&langs)[N])
 Identical to add_sfile_visitor(visitor<sfileinst> *, const std::vector<language> &) except for type of langs argument.
 
static void add_sfile_visitor (visitor< sfileinst > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a serial depth-first phase visitor for (representative instances of) files in compilation units whose languages appear in langs.
 
template<size_t N>
static void add_sfileinst_finish_visitor (visitor< sfileinst > *v, const language(&langs)[N])
 Identical to add_sfileinst_finish_visitor(visitor<sfileinst> *, const std::vector<language> &) except for type of langs argument.
 
static void add_sfileinst_finish_visitor (visitor< sfileinst > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a serial depth-first phase finish visitor for file instances (sfileinst) in compilation units whose languages appear in langs.
 
template<size_t N>
static void add_sfileinst_parallel_finish_visitor (visitor< sfileinst > *v, const language(&langs)[N])
 Identical to add_sfileinst_parallel_finish_visitor(visitor<sfileinst> *, const std::vector<language> &) except for type of langs argument.
 
static void add_sfileinst_parallel_finish_visitor (visitor< sfileinst > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a parallel depth-first phase visitor for file instances (sfileinst) in compilation units whose languages appear in langs.
 
template<size_t N>
static void add_sfileinst_parallel_visitor (visitor< sfileinst > *v, const language(&langs)[N])
 Identical to add_sfileinst_parallel_visitor(visitor<sfileinst> *, const std::vector<language> &) except for type of langs argument.
 
static void add_sfileinst_parallel_visitor (visitor< sfileinst > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a parallel depth-first phase visitor for file instances (sfileinst) in compilation units whose languages appear in langs.
 
template<size_t N>
static void add_sfileinst_visitor (visitor< sfileinst > *v, const language(&langs)[N])
 Identical to add_sfileinst_visitor(visitor<sfileinst> *, const std::vector<language> &) except for type of langs argument.
 
static void add_sfileinst_visitor (visitor< sfileinst > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a serial depth-first phase visitor for file instances (sfileinst) in compilation units whose languages appear in langs.
 
template<size_t N>
static void add_step_bottom_up_visitor (step_state *v, const language(&langs)[N])
 Identical to add_step_bottom_up_visitor(step_state *, const std::vector<language> &) except for type of langs argument.
 
static void add_step_bottom_up_visitor (step_state *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add a bottom-up phase step visitor.
 
template<size_t N>
static void add_symbol_parallel_visitor (visitor< symbol > *v, const language(&langs)[N])
 Identical to add_symbol_parallel_visitor(visitor<symbol> *, const std::vector<language> &) except for type of langs argument.
 
static void add_symbol_parallel_visitor (visitor< symbol > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a parallel depth-first phase visitor for symbols (symbol) in compilation units whose languages appear in langs.
 
template<size_t N>
static void add_symbol_visitor (visitor< symbol > *v, const language(&langs)[N])
 Identical to add_symbol_visitor(visitor<symbol> *, const std::vector<language> &) except for type of langs argument.
 
static void add_symbol_visitor (visitor< symbol > *v, const std::vector< language > &langs=std::vector< language >(1, language::WILDCARD))
 Add v as a serial depth-first phase visitor for symbols (symbol) in compilation units whose languages appear in langs.
 
static std::string binary_backend_option (const std::string &key)
 [CodeSonar for Binaries only] Get the value associated with the key in the BINARY_BACKEND_OPTIONS configuration file setting.
 
static warningclass create_warningclass (const std::string &_name, const std::string &categories="", double rank=10.0, warningclass_flags flags=warningclass_flags::NONE, warning_significance significance=warning_significance::UNSPECIFIED)
 Create and return a new warning class (warningclass).
 
static analysis_mode get_mode ()
 Get the analysis mode for the CodeSonar process in which the plug-in is running.
 
static multiprocess_mode get_multiprocess_mode ()
 Get the multiprocess mode for the CodeSonar process in which the plug-in is running.
 
static warningclass lookup_warningclass (const std::string &_name)
 Get the warningclass with the specified name.
 
static warningclass lookup_warningclass (csuint32 id)
 Get the warningclass with the specified ID.
 

Detailed Description

Manages the warning classes (warningclass) and visitors (visitor) for the analysis.

You do not need to instantiate this class: all members are static.

For more information, see the CodeSonar manual:

Member Function Documentation

◆ add_cache_cleanup_visitor()

static void cs::analysis::add_cache_cleanup_visitor ( visitor< project > *  v)
inlinestatic

Add v as a cache-cleanup visitor.

Parameters
[in]vThe visitor<project> to add to the list of cache-cleanup visitors.
Returns
void

Cache-cleanup visitors are invoked periodically as the analysis progresses.

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

◆ add_compunit_drop_visitor()

static void cs::analysis::add_compunit_drop_visitor ( visitor< compunit > *  v)
inlinestatic

Add v as a drop phase compilation unit (compunit) visitor.

Parameters
[in]vThe visitor<compunit> to add to the list of drop phase compilation unit visitors.
Returns
void

For incremental analyses, v will be applied during the drop phase to every compilation unit (compunit) U for which at least one of the following is true.

  • U has been dropped
  • a file static in U has been dropped
  • the include tree for U has changed

(No drop visitors are applied in base analyses, which do not have a drop phase.)

 program drop visitors         (incremental only)
     [drop traversal]          (incremental only)  <=======
 program drop finish visitors  (incremental only)
 program setup visitors
 [serial depth-first phase]
 [parallel depth-first phase]
 [pointer analysis]
 [bottom-up phase]
 

Use a compilation unit drop visitor to clean up any state you have saved for:

  • the compilation unit
  • any file instances in the compilation unit
  • any ASTs in the compilation unit
  • any component you can clean up with a procedure drop visitor: see add_procedure_drop_visitor().

You do not need to handle cleanup for the compunit object itself: CodeSonar will do that.

Restriction: v->() must not call any API functions other than the following: procedure::operator==, procedure::hash(), compunit::operator==, compunit::hash(), symbol::operator==, symbol::hash().

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

◆ add_compunit_finish_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_compunit_finish_visitor ( visitor< compunit > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_compunit_finish_visitor(visitor<compunit> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<compunit> to add to the serial bottom-up phase visitor list for compilation units.
[in]langsThe visitor will only be applied to files in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_compunit_finish_visitor() [2/2]

static void cs::analysis::add_compunit_finish_visitor ( visitor< compunit > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a serial depth-first phase finish visitor for compilation units (compunit) whose languages appear in langs.

Parameters
[in]vThe visitor<compunit> to add to the serial depth-first phase visitor list for compilation units.
[in]langsThe visitor will only be applied to files in compilation units whose language is one of these.
Returns
void

During the serial depth-first analysis phase, v->() will be applied to compilation units (compunit) whose language appears in langs.

  • In base analyses, it will be applied to every such compilation unit in the project.
  • In incremental analyses, it will be applied only to compilation units compiled in the increment.
 [drop phase]              (incremental only)
 program setup visitors
 program visitors
   (serial depth-first traversal)
      compunit visitors applied to cu1
          [visitors applied to elements contained in cu1]
      compunit finish visitors applied to cu1             <===========
      compunit visitors applied to cu2
          [visitors applied to elements contained in cu2]
      compunit finish visitors applied to cu2             <===========
      [remaining compunits]                               <-----------
 program finish visitors
 [parallel depth-first phase]
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_compunit_finish_visitor(visitor<compunit> *, const language (&)[N])

◆ add_compunit_parallel_finish_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_compunit_parallel_finish_visitor ( visitor< compunit > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_compunit_parallel_finish_visitor(visitor<compunit> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<compunit> to add to the parallel bottom-up phase visitor list for compilation units.
[in]langsThe visitor will only be applied to files in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_compunit_parallel_finish_visitor() [2/2]

static void cs::analysis::add_compunit_parallel_finish_visitor ( visitor< compunit > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a parallel depth-first phase finish visitor for compilation units (compunit) whose languages appear in langs.

Parameters
[in]vThe visitor<compunit> to add to the parallel depth-first phase finish visitor list for compilation units.
[in]langsThe visitor will only be applied to files in compilation units whose language is one of these.
Returns
void

During the parallel depth-first analysis phase, v->() will be applied to compilation units (compunit) whose language appears in langs.

  • In base analyses, it will be applied to every such compilation unit in the project.
  • In incremental analyses, it will be applied only to compilation units compiled in the increment.
 [drop phase]              (incremental only)
 program setup visitors
 [serial depth-first phase]
 program parallel visitors
   (parallel depth-first traversal: analysis slaves sA, sB,... may run in parallel)
     [sA] compunit parallel visitors applied to cu1
     [sA]     [parallel visitors applied to elements contained in cu1]
     [sA] compunit parallel finish visitors applied to cu1    <===========
     [sB] compunit parallel visitors applied to cu2
     [sB]     [parallel visitors applied to elements contained in cu2]
     [sB] compunit parallel finish visitors applied to cu2    <===========
     [remaining compunits]                                    <-----------
 program parallel finish visitors
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_compunit_parallel_finish_visitor(visitor<compunit> *, const language (&)[N])

◆ add_compunit_parallel_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_compunit_parallel_visitor ( visitor< compunit > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_compunit_parallel_visitor(visitor<compunit> *,const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<compunit> to add to the parallel depth-first phase visitor list for compilation units.
[in]langsThe visitor will only be applied to programs in these languages (language).
Returns
void
Template Parameters
NThe array length.

◆ add_compunit_parallel_visitor() [2/2]

static void cs::analysis::add_compunit_parallel_visitor ( visitor< compunit > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a parallel depth-first phase visitor for compilation units (compunit) whose languages appear in langs.

Parameters
[in]vThe visitor<compunit> to add to the parallel depth-first phase visitor list for compilation units.
[in]langsThe visitor will only be applied to programs in these languages (language).
Returns
void

During the parallel depth-first analysis phase, v->() will be applied to compilation units (compunit) whose language appears in langs.

  • In base analyses, it will be applied to every such compilation unit in the project.
  • In incremental analyses, it will be applied only to compilation units compiled in the increment.
 [drop phase]              (incremental only)
 program setup visitors
 [serial depth-first phase]
 program parallel visitors
   (parallel depth-first traversal: analysis slaves sA, sB,... may run in parallel)
     [sA] compunit parallel visitors applied to cu1           <===========
     [sA]    [parallel visitors applied to elements contained in cu1]
     [sA] compunit parallel finish visitors applied to cu1
     [sB] compunit parallel visitors applied to cu2           <===========
     [sB]    [parallel visitors applied to elements contained in cu2]
     [sB] compunit parallel finish visitors applied to cu2
     [remaining compunits]                                    <-----------
 program parallel finish visitors                               
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_compunit_parallel_visitor(visitor<compunit> *, const language (&)[N])

◆ add_compunit_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_compunit_visitor ( visitor< compunit > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_compunit_visitor(visitor<compunit> *,const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<compunit> to add to the serial depth-first phase visitor list for compilation units.
[in]langsThe visitor will only be applied to programs in these languages (language).
Returns
void
Template Parameters
NThe array length.

◆ add_compunit_visitor() [2/2]

static void cs::analysis::add_compunit_visitor ( visitor< compunit > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a serial depth-first phase visitor for compilation units (compunit) whose languages appear in langs.

Parameters
[in]vThe visitor<compunit> to add to the serial depth-first phase visitor list for compilation units.
[in]langsThe visitor will only be applied to programs in these languages (language).
Returns
void

During the serial depth-first analysis phase, v->() will be applied to compilation units (compunit) whose language appears in langs.

  • In base analyses, it will be applied to every such compilation unit in the project.
  • In incremental analyses, it will be applied only to compilation units compiled in the increment.
 [drop phase]              (incremental only)
 program setup visitors
 program visitors
   (serial depth-first traversal)
      compunit visitors applied to cu1                    <===========
          [visitors applied to elements contained in cu1]
      compunit finish visitors applied to cu1
      compunit visitors applied to cu2                    <===========
          [visitors applied to elements contained in cu2]
      compunit finish visitors applied to cu2
      [remaining compunits]                               <-----------
 program finish visitors
 [parallel depth-first phase]
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_compunit_visitor(visitor<compunit> *, const language (&)[N])

◆ add_global_symbol_drop_visitor()

static void cs::analysis::add_global_symbol_drop_visitor ( visitor< symbol > *  v)
inlinestatic

Add v as a drop phase visitor for global symbols (symbol).

Parameters
[in]vThe visitor<symbol> to add to the list of drop visitors for global symbols.
Returns
void

For incremental analyses, v will be applied during the drop phase to every global symbol that has been dropped. (No drop visitors are applied in base analyses, which do not have a drop phase.)

 program drop visitors         (incremental only)
     [drop traversal]          (incremental only)  <=======
 program drop finish visitors  (incremental only)
 program setup visitors
 [serial depth-first phase]
 [parallel depth-first phase]
 [pointer analysis]
 [bottom-up phase]
 

Use a global symbol drop visitor to clean up any state that you have saved for:

  • the symbol

You do not need to handle cleanup for the symbol object itself: CodeSonar will do that.

Restriction: v->() must not call any API functions other than the following: procedure::operator==, procedure::hash(), compunit::operator==, compunit::hash(), symbol::operator==, symbol::hash().

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

◆ add_hub_rpc_handler()

static void cs::analysis::add_hub_rpc_handler ( std::string  message_name,
rpc_handler handler 
)
inlinestatic

Add handler as a hub remote procedure call (RPC) handler for the analysis, with name message_name.

Parameters
[in]message_nameA unique name for the handler. This is the name that must be used to issue the RPC request from the hub.
[in]handlerThe RPC handler to add.
Returns
void

See the rpc_handler class documentation for a small example.

◆ add_point_bottom_up_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_point_bottom_up_visitor ( visitor< point > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_point_bottom_up_visitor(visitor<point> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<point> to add to the bottom-up phase visitor list for compilation units.
[in]langsThe visitor will only be applied to points in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_point_bottom_up_visitor() [2/2]

static void cs::analysis::add_point_bottom_up_visitor ( visitor< point > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a bottom-up phase visitor for points (point) in compilation units whose languages appear in langs.

Parameters
[in]vThe visitor<point> to add to the bottom-up phase visitor list for compilation units.
[in]langsThe visitor will only be applied to points in compilation units whose language is one of these.
Returns
void

During the bottom-up analysis phase, v->() will be applied to procedures (procedure) that are contained in compilation units whose language appears in langs.

  • In base analyses, it will be applied to every such procedure in the project.
  • In incremental analyses, it will be applied only to procedures F for which at least one of the following is true.
    • F is contained in a compilation unit that was compiled in the increment.
    • F's summary is needed for incremental analysis and had to be recomputed because it relied on elements that were deleted or modified by changes in the increment.
 [drop phase]              (incremental only)
 program setup visitors
 [serial depth-first phase]
 [parallel depth-first phase]
 [pointer analysis]
 program bottom-up visitors
   (bottom-up traversal)
     procedure bottom up visitors applied to proc1
         point bottom up visitors applied to proc1point1   <========
         point bottom up visitors applied to proc1point2   <========
         [remaining points in proc1]
         [step visitors applied to CFG edges in proc1]
     procedure bottom up finish visitors applied to proc1
     [remaining procedures]                                <--------
 program bottom-up finish visitors
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_point_bottom_up_visitor(visitor<point> *, const language (&)[N])

◆ add_point_parallel_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_point_parallel_visitor ( visitor< point > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_point_parallel_visitor(visitor<point> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<point> to add to the parallel depth-first phase visitor list for points.
[in]langsThe visitor will only be applied to points in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_point_parallel_visitor() [2/2]

static void cs::analysis::add_point_parallel_visitor ( visitor< point > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a parallel depth-first phase visitor for points (point) in compilation units whose languages appear in langs.

Parameters
[in]vThe visitor<point> to add to the parallel depth-first phase visitor list for points.
[in]langsThe visitor will only be applied to points in compilation units whose language is one of these.
Returns
void

During the parallel depth-first analysis phase, v->() will be applied points (point) in the project that are contained in a compilation unit whose language appears in langs.

  • In base analyses, it will be applied to every such point in the project.
  • In incremental analyses, it will be applied only to points contained in compilation units compiled in the increment.
 [drop phase]              (incremental only)
 program setup visitors
 [serial depth-first phase]
 program parallel visitors
   (parallel depth-first traversal: analysis slaves sA, sB,... may run in parallel)
     [sA] compunit parallel visitors applied to cu1
     [sA]     [parallel visitors applied to compunit-level symbols in cu1]
     [sA]     procedure parallel visitors applied to cu1proc1
     [sA]         [parallel visitors applied to symbols contained in cu1proc1]
     [sA]         point parallel visitor applied to cu1proc1point1                 <========
     [sA]         point parallel visitor applied to cu1proc1point2                 <========
     [sA]         [remaining points in cu1proc1]                                   <--------
     [sA]    procedure parallel finish visitors applied to cu1proc1
     [sA]    [remaining procedures in cu1]                                         <--------
     [sA]    [parallel visitors applied to source files and file instances in cu1]
     [sA] compunit parallel finish visitors applied to cu1
     [sB] [traverse compunit cu2, applying parallel visitors]                      <--------
     [remaining compunits]                                                         <--------
 program parallel finish visitors                               
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_point_parallel_visitor(visitor<point> *, const language (&)[N])

◆ add_point_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_point_visitor ( visitor< point > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_point_visitor(visitor<point> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<point> to add to the serial depth-first phase visitor list for points.
[in]langsThe visitor will only be applied to points in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_point_visitor() [2/2]

static void cs::analysis::add_point_visitor ( visitor< point > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a serial depth-first phase visitor for points (point) in compilation units whose languages appear in langs.

Parameters
[in]vThe visitor<point> to add to the serial depth-first phase visitor list for points.
[in]langsThe visitor will only be applied to points in compilation units whose language is one of these.
Returns
void

During the serial depth-first analysis phase, v->() will be applied points (point) in the project that are contained in a compilation unit whose language appears in langs.

  • In base analyses, it will be applied to every such point in the project.
  • In incremental analyses, it will be applied only to points contained in compilation units compiled in the increment.
 [drop phase]              (incremental only)
 program setup visitors
 program visitors
   (serial depth-first traversal)
      compunit visitors applied to cu1
          [visitors applied to compunit-level symbols in cu1]
          procedure visitors applied to cu1proc1
              [visitors applied to symbols contained in cu1proc1]
              point visitor applied to cu1proc1point1                                        <========
              point visitor applied to cu1proc1point2                                        <========
              [remaining points in cu1proc1]                                                 <--------
          procedure finish visitors applied to cu1proc1
          [remaining procedures in cu1]                                                      <--------
          [visitors applied to source files and file instances in cu1]
      compunit finish visitors applied to cu1
      [remaining compunits]                                                                  <--------
 program finish visitors
 [parallel depth-first phase]
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_point_visitor(visitor<point> *, const language (&)[N])

◆ add_procedure_bottom_up_finish_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_procedure_bottom_up_finish_visitor ( visitor< procedure > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_procedure_bottom_up_finish_visitor(visitor<procedure> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<procedure> to add to the bottom-up phase finish visitor list for procedures.
[in]langsThe visitor will only be applied to procedures in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_procedure_bottom_up_finish_visitor() [2/2]

static void cs::analysis::add_procedure_bottom_up_finish_visitor ( visitor< procedure > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a bottom-up phase finish visitor for procedures (procedure) in compilation units whose languages (language) appear in langs.

Parameters
[in]vThe visitor<procedure> to add to the bottom-up phase finish visitor list for procedures.
[in]langsThe visitor will only be applied to procedures in compilation units whose language is one of these.
Returns
void

During the bottom-up analysis phase, v->() will be applied to procedures (procedure) that are contained in compilation units whose language appears in langs.

  • In base analyses, it will be applied to every such procedure in the project.
  • In incremental analyses, it will be applied only to procedures F for which at least one of the following is true.
    • F is contained in a compilation unit that was compiled in the increment.
    • F's summary is needed for incremental analysis and had to be recomputed because it relied on elements that were deleted or modified by changes in the increment.
 [drop phase]              (incremental only)
 program setup visitors
 [serial depth-first phase]
 [parallel depth-first phase]
 [pointer analysis]
 program bottom-up visitors
   (bottom-up traversal)
     procedure bottom up visitors applied to proc1
         [point bottom up visitors applied to points in proc1]   
         [step visitors applied to CFG edges in proc1]        
     procedure bottom up finish visitors applied to proc1      <========
     procedure bottom up visitors applied to proc2           
         [point bottom up visitors applied to points in proc2] 
         [step visitors applied to CFG edges in proc2] 
     procedure bottom up finish visitors applied to proc2      <========
     [remaining procedures]                                    <--------
 program bottom-up finish visitors
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_procedure_bottom_up_finish_visitor(visitor<procedure> *, const language (&)[N])

◆ add_procedure_bottom_up_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_procedure_bottom_up_visitor ( visitor< procedure > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_procedure_bottom_up_visitor(visitor<procedure> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<procedure> to add to the bottom-up phase visitor list for compilation units.
[in]langsThe visitor will only be applied to procedures in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_procedure_bottom_up_visitor() [2/2]

static void cs::analysis::add_procedure_bottom_up_visitor ( visitor< procedure > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a bottom-up phase visitor for procedures (procedure) in compilation units whose languages appear in langs.

Parameters
[in]vThe visitor<procedure> to add to the bottom-up phase visitor list for compilation units.
[in]langsThe visitor will only be applied to procedures in compilation units whose language is one of these.
Returns
void

During the bottom-up analysis phase, v->() will be applied to procedures (procedure) that are contained in compilation units whose language appears in langs.

  • In base analyses, it will be applied to every such procedure in the project.
  • In incremental analyses, it will be applied only to procedures F for which at least one of the following is true.
    • F is contained in a compilation unit that was compiled in the increment.
    • F's summary is needed for incremental analysis and had to be recomputed because it relied on elements that were deleted or modified by changes in the increment.
 [drop phase]              (incremental only)
 program setup visitors
 [serial depth-first phase]
 [parallel depth-first phase]
 [pointer analysis]
 program bottom-up visitors
   (bottom-up traversal)
     procedure bottom up visitors applied to proc1             <========
         point bottom up visitors applied to points in proc1
         step visitors applied to CFG edges in proc1
     procedure bottom up finish visitors applied to proc1
     procedure bottom up visitors applied to proc2             <========
         point bottom up visitors applied to points in proc2
         step visitors applied to CFG edges in proc2
     procedure bottom up finish visitors applied to proc2
     [remaining procedures]                                    <--------
 program bottom-up finish visitors
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_procedure_bottom_up_visitor(visitor<procedure> *, const language (&)[N])

◆ add_procedure_drop_visitor()

static void cs::analysis::add_procedure_drop_visitor ( visitor< procedure > *  v)
inlinestatic

Add v as a drop phase procedure visitor.

Parameters
[in]vThe visitor<procedure> to add to the list of drop phase procedure visitors.
Returns
void

For incremental analyses, v will be applied during the drop phase to every procedure F for which at least one of the following is true.

  • F has been dropped
  • a function static variable in F has been dropped
  • a point in F has been dropped

(No drop visitors are applied in base analyses, which do not have a drop phase.)

 program drop visitors         (incremental only)
     [drop traversal]          (incremental only)  <=======
 program drop finish visitors  (incremental only)
 program setup visitors
 [serial depth-first phase]
 [parallel depth-first phase]
 [pointer analysis]
 [bottom-up phase]
 

Use a procedure drop visitor to clean up any state that you have saved for:

  • the procedure
  • any cfg_edge whose target is in the procedure
  • any point in the procedure
  • any symbol whose scope is restricted to the procedure

You do not need to handle cleanup for the procedure object itself: CodeSonar will do that.

Restriction: v->() must not call any API functions other than the following: procedure::operator==, procedure::hash(), compunit::operator==, compunit::hash(), symbol::operator==, symbol::hash().

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

◆ add_procedure_finish_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_procedure_finish_visitor ( visitor< procedure > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_procedure_finish_visitor(visitor<procedure> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<procedure> to add to the serial depth-first phase finish visitor list for procedures.
[in]langsThe visitor will only be applied to procedures in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_procedure_finish_visitor() [2/2]

static void cs::analysis::add_procedure_finish_visitor ( visitor< procedure > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a serial depth-first phase finish visitor for procedures (procedure) in compilation units whose languages appear in langs.

Parameters
[in]vThe visitor<procedure> to add to the serial depth-first phase finish visitor list for procedures.
[in]langsThe visitor will only be applied to procedures in compilation units whose language is one of these.
Returns
void

During the serial depth-first analysis phase, v->() will be applied to procedures (procedure) contained in compilation units whose language appears in langs.

  • In base analyses, it will be applied to every such procedure in the project.
  • In incremental analyses, it will be applied only to procedures contained in compilation units compiled in the increment.
 [drop phase]              (incremental only)
 program setup visitors
 program visitors
   (serial depth-first traversal)
      compunit visitors applied to cu1
          [visitors applied to compunit-level symbols in cu1]
          [visitors applied to source files and file instances in cu1]
          procedure visitors applied to cu1proc1
              [visitors applied to elements contained in cu1proc1]
          procedure finish visitors applied to cu1proc1            <========
          procedure visitors applied to cu1proc2
              [visitors applied to elements contained in cu1proc2]
          procedure finish visitors applied to cu1proc2            <========
          [remaining procedures in cu1]                            <--------
      compunit finish visitors applied to cu1
      [remaining compunits]                                        <--------
 program finish visitors
 [parallel depth-first phase]
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_procedure_finish_visitor(visitor<procedure> *, const language (&)[N])

◆ add_procedure_parallel_finish_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_procedure_parallel_finish_visitor ( visitor< procedure > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_procedure_parallel_finish_visitor(visitor<procedure> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<procedure> to add to the parallel depth-first phase finish visitor list for procedures.
[in]langsThe visitor will only be applied to procedures in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_procedure_parallel_finish_visitor() [2/2]

static void cs::analysis::add_procedure_parallel_finish_visitor ( visitor< procedure > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a parallel depth-first phase finish visitor for procedures (procedure) in compilation units whose languages appear in langs.

Parameters
[in]vThe visitor<procedure> to add to the parallel depth-first phase finish visitor list for procedures.
[in]langsThe visitor will only be applied to procedures in compilation units whose language is one of these.
Returns
void

During the parallel depth-first analysis phase, v->() will be applied to procedures (procedure) contained in compilation units whose language appears in langs.

  • In base analyses, it will be applied to every such procedure in the project.
  • In incremental analyses, it will be applied only to procedures contained in compilation units compiled in the increment.
 [drop phase]              (incremental only)
 program setup visitors
 [serial depth-first phase]
 program parallel visitors
   (parallel depth-first traversal: analysis slaves sA, sB,... may run in parallel)
     [sA] compunit parallel visitors applied to cu1
     [sA]     [parallel visitors applied to compunit-level symbols in cu1]
     [sA]     [parallel visitors applied to source files and file instances in cu1]
     [sA]     procedure parallel visitors applied to cu1proc1
     [sA]        [parallel visitors applied to elements contained in cu1proc1]
     [sA]     procedure parallel finish visitors applied to cu1proc1   <========
     [sA]     procedure parallel visitors applied to cu1proc2
     [sA]        [parallel visitors applied to elements contained in cu1proc2]
     [sA]     procedure parallel finish visitors applied to cu1proc2   <========
     [sA]     [remaining procedures in cu1]                            <--------
     [sA] compunit parallel finish visitors applied to cu1
     [sB] [traverse compunit cu2, applying parallel visitors]          <--------
     [remaining compunits]                                             <--------
 program parallel finish visitors                               
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_procedure_parallel_finish_visitor(visitor<procedure> *, const language (&)[N])

◆ add_procedure_parallel_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_procedure_parallel_visitor ( visitor< procedure > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_procedure_parallel_visitor(visitor<procedure> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<procedure> to add to the parallel depth-first phase visitor list for procedures.
[in]langsThe visitor will only be applied to procedures in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_procedure_parallel_visitor() [2/2]

static void cs::analysis::add_procedure_parallel_visitor ( visitor< procedure > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a parallel depth-first phase visitor for procedures in compilation units (compunit) whose languages appear in langs.

Parameters
[in]vThe visitor<procedure> to add to the parallel depth-first phase visitor list for procedures.
[in]langsThe visitor will only be applied to procedures in compilation units whose language is one of these.
Returns
void

During the parallel depth-first analysis phase, v->() will be applied to procedures (procedure) contained in compilation units whose language appears in langs.

  • In base analyses, it will be applied to every such procedure in the project.
  • In incremental analyses, it will be applied only to procedures contained in compilation units compiled in the increment.
 [drop phase]              (incremental only)
 program setup visitors
 [serial depth-first phase]
 program parallel visitors
   (parallel depth-first traversal: analysis slaves sA, sB,... may run in parallel)
     [sA] compunit parallel visitors applied to cu1
     [sA]    [parallel visitors applied to compunit-level symbols in cu1]
     [sA]    [parallel visitors applied to source files and file instances in cu1]
     [sA]    procedure parallel visitors applied to cu1proc1            <========
     [sA]         [parallel visitors applied to elements contained in cu1proc1]
     [sA]    procedure parallel finish visitors applied to cu1proc1
     [sA]    procedure parallel visitors applied to cu1proc2            <========
     [sA]         [parallel visitors applied to elements contained in cu1proc2]
     [sA]    procedure parallel finish visitors applied to cu1proc2
     [sA]    [remaining procedures in cu1]                              <--------
     [sA] compunit parallel finish visitors applied to cu1
     [sB] [traverse compunit cu2, applying parallel visitors]           <--------
     [remaining compunits]                                              <--------
 program parallel finish visitors                               
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_procedure_parallel_visitor(visitor<procedure> *, const language (&)[N])

◆ add_procedure_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_procedure_visitor ( visitor< procedure > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_procedure_visitor(visitor<procedure> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<procedure> to add to the serial depth-first phase visitor list for procedures.
[in]langsThe visitor will only be applied to procedures in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_procedure_visitor() [2/2]

static void cs::analysis::add_procedure_visitor ( visitor< procedure > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a serial depth-first phase visitor for procedures in compilation units (compunit) whose languages appear in langs.

Parameters
[in]vThe visitor<procedure> to add to the serial depth-first phase visitor list for procedures.
[in]langsThe visitor will only be applied to procedures in compilation units whose language is one of these.
Returns
void

During the serial depth-first analysis phase, v->() will be applied to procedures (procedure) contained in compilation units whose language appears in langs.

  • In base analyses, it will be applied to every such procedure in the project.
  • In incremental analyses, it will be applied only to procedures contained in compilation units compiled in the increment.
 [drop phase]              (incremental only)
 program setup visitors
 program visitors
   (serial depth-first traversal)
      compunit visitors applied to cu1
          [visitors applied to compunit-level symbols in cu1]
          [visitors applied to source files and file instances in cu1]
          procedure visitors applied to cu1proc1                   <========
              [visitors applied to elements contained in cu1proc1]
          procedure finish visitors applied to cu1proc1
          procedure visitors applied to cu1proc2                   <========
              [visitors applied to elements contained in cu1proc2]
          procedure finish visitors applied to cu1proc2
          [remaining procedures in cu1]                            <--------
      compunit finish visitors applied to cu1
      [remaining compunits]                                        <--------
 program finish visitors
 [parallel depth-first phase]
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_procedure_visitor(visitor<procedure> *, const language (&)[N])

◆ add_project_bottom_up_finish_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_project_bottom_up_finish_visitor ( visitor< project > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_project_bottom_up_finish_visitor(visitor<project> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<project> to add to the list of program finish visitors.
[in]langsThe visitor will only be applied to programs in these languages (language).
Template Parameters
NThe array length.

◆ add_project_bottom_up_finish_visitor() [2/2]

static void cs::analysis::add_project_bottom_up_finish_visitor ( visitor< project > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a bottom-up program finish visitor for programs (project) whose languages (language) appear in langs.

Parameters
[in]vThe visitor<project> to add to the list of program bottom-up finish visitors.
[in]langsThe visitor will only be applied to programs in these languages (language).
Template Parameters
NThe array length.

v will be applied to the project at the end of the bottom-up analysis phase, after the bottom-up traversal has finished. Note that at this point, all traversal has finished.

 [drop phase]              (incremental only)
 program setup visitors
 [serial depth-first phase]
 [parallel depth-first phase]
 [pointer analysis]
 program bottom-up visitors
     [bottom-up traversal]
 program bottom-up finish visitors                <=======
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_project_bottom_up_finish_visitor(visitor<project> *, const language (&)[N])

◆ add_project_bottom_up_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_project_bottom_up_visitor ( visitor< project > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_project_bottom_up_visitor(visitor<project> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<project> to add to the bottom-up phase visitor list for programs.
[in]langsThe visitor will only be applied to programs in these languages (language).
Returns
void
Template Parameters
NThe array length.

◆ add_project_bottom_up_visitor() [2/2]

static void cs::analysis::add_project_bottom_up_visitor ( visitor< project > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a bottom-up program visitor for programs (project) whose languages appear in langs.

Parameters
[in]vThe visitor<project> to add to the bottom-up phase visitor list for programs.
[in]langsThe visitor will only be applied to programs in these languages (language).
Returns
void

v will be applied to the project at the beginning of the bottom-up phase, before the bottom-up traversal begins.

 [drop phase]              (incremental only)
 program setup visitors
 [serial depth-first phase]
 [parallel depth-first phase]
 [pointer analysis]
 program bottom-up visitors                          <=======
     [bottom-up traversal]
 program bottom-up finish visitors
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_project_bottom_up_visitor(visitor<project> *, const language (&)[N])

◆ add_project_drop_finish_visitor()

static void cs::analysis::add_project_drop_finish_visitor ( visitor< project > *  v)
inlinestatic

Add v to the list of program drop finish visitors, which are invoked at the end of the drop phase.

Parameters
[in]vThe visitor<project> to add to the list of program drop finish visitors.
Returns
void

For incremental analyses, v->() will be applied to the project at the end of the drop phase if anything in the project has been dropped. (No drop visitors are applied in base analyses, which do not have a drop phase.)

 program drop visitors         (incremental only)
     [drop traversal]              (incremental only)
 program drop finish visitors  (incremental only)  <=======
 program setup visitors
 [serial depth-first phase]
 [parallel depth-first phase]
 [pointer analysis]
 [bottom-up phase]
 

Use a program drop finish visitor when you need to clean up state that you have saved for dropped project components and cannot handle the cleanup with one of the smaller-scope drop visitors.

Restriction: v->() must not call any API functions other than the following: procedure::operator==, procedure::hash(), compunit::operator==, compunit::hash(), symbol::operator==, symbol::hash().

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

◆ add_project_drop_visitor()

static void cs::analysis::add_project_drop_visitor ( visitor< project > *  v)
inlinestatic

Add v to the list of program drop visitors, which are invoked at the beginning of the drop phase.

Parameters
[in]vThe visitor<project> to add to the list of program drop visitors.
Returns
void

For incremental analyses, v will be applied to the project at the beginning of the drop phase if anything in the project has been dropped. (No drop visitors are applied in base analyses, which do not have a drop phase.)

 program drop visitors         (incremental only)  <=======
     [drop traversal]          (incremental only)
 program drop finish visitors  (incremental only)
 program setup visitors
 [serial depth-first phase]
 [parallel depth-first phase]
 [pointer analysis]
 [bottom-up phase]
 

Use a program drop visitor when you need to clean up state that you have saved for dropped project components and cannot handle the cleanup with one of the smaller-scope drop visitors. You do not need to handle cleanup for the project itself: CodeSonar will do that.

Restriction: v->() must not call any API functions other than the following: procedure::operator==, procedure::hash(), compunit::operator==, compunit::hash(), symbol::operator==, symbol::hash().

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

◆ add_project_finish_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_project_finish_visitor ( visitor< project > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_project_finish_visitor(visitor<project> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<project> to add to the list of program finish visitors.
[in]langsThe visitor will only be applied to programs in these languages (language).
Template Parameters
NThe array length.

◆ add_project_finish_visitor() [2/2]

static void cs::analysis::add_project_finish_visitor ( visitor< project > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a serial depth-first program finish visitor for programs (project) whose languages (language) appear in langs.

Parameters
[in]vThe visitor<project> to add to the list of program finish visitors.
[in]langsThe visitor will only be applied to programs in these languages (language).
Template Parameters
NThe array length.

v will be applied to the project at the end of the serial depth-first phase, after the serial depth-first traversal has finished.

 [drop phase]              (incremental only)
 program setup visitors
 program visitors
     [serial depth-first traversal]
 program finish visitors                             <=======
 [parallel depth-first phase]
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_project_finish_visitor(visitor<project> *, const language (&)[N])

◆ add_project_parallel_finish_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_project_parallel_finish_visitor ( visitor< project > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_project_parallel_finish_visitor(visitor<project> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<project> to add to the list of program finish visitors.
[in]langsThe visitor will only be applied to programs in these languages (language).
Template Parameters
NThe array length.

◆ add_project_parallel_finish_visitor() [2/2]

static void cs::analysis::add_project_parallel_finish_visitor ( visitor< project > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a parallel depth-first program finish visitor for programs (project) whose languages (language) appear in langs.

Parameters
[in]vThe visitor<project> to add to the list of program parallel finish visitors.
[in]langsThe visitor will only be applied to programs in these languages (language).
Template Parameters
NThe array length.

v will be applied to the project at the end of the parallel depth-first phase, after the parallel depth-first traversal has finished.

 [drop phase]              (incremental only)
 program setup visitors
 [serial depth-first phase]
 program parallel visitors
   [parallel depth-first traversal]
 program parallel finish visitors           <=======
 [pointer analysis]
 program bottom-up visitors
 [bottom-up phase]
 program bottom-up finish visitors 
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_project_parallel_finish_visitor(visitor<project> *, const language (&)[N])

◆ add_project_parallel_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_project_parallel_visitor ( visitor< project > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_project_parallel_visitor(visitor<project> *,const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<project> to add to the program visitor list.
[in]langsThe visitor will only be applied to programs in these languages (language).
Template Parameters
NThe array length.
Returns
void

◆ add_project_parallel_visitor() [2/2]

static void cs::analysis::add_project_parallel_visitor ( visitor< project > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a parallel depth-first program visitor for programs (project) whose languages appear in langs.

Parameters
[in]vThe visitor<project> to add to the program visitor list.
[in]langsThe visitor will only be applied to programs in these languages (language).
Returns
void

During analysis, v->() will be applied to the project at the beginning of the parallel depth-first analysis phase, before the parallel depth-first traversal begins.

 [drop phase]              (incremental only)
 program setup visitors
 [serial depth-first phase]
 program parallel visitors                       <=======
     [parallel depth-first traversal]
 program parallel finish visitors
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_project_parallel_visitor(visitor<project> *,const language (&)[N])

◆ add_project_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_project_visitor ( visitor< project > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_project_visitor(visitor<project> *,const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<project> to add to the program visitor list.
[in]langsThe visitor will only be applied to programs in these languages (language).
Template Parameters
NThe array length.
Returns
void

◆ add_project_visitor() [2/2]

static void cs::analysis::add_project_visitor ( visitor< project > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a serial depth-first program visitor for programs (project) whose languages appear in langs.

Parameters
[in]vThe visitor<project> to add to the program visitor list.
[in]langsThe visitor will only be applied to programs in these languages (language).
Returns
void

During analysis, v->() will be applied to the project at the beginning of the serial depth-first analysis phase, before the serial depth-first traversal begins.

 [drop phase]              (incremental only)
 program setup visitors
 program visitors                                 <=======
     [serial depth-first traversal]
 program finish visitors
 [parallel depth-first phase]
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_project_visitor(visitor<project> *,const language (&)[N])

◆ add_sfile_finish_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_sfile_finish_visitor ( visitor< sfileinst > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_sfile_finish_visitor(visitor<sfileinst> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<sfileinst> to add to the depth-first phase finish visitor list for files.
[in]langsThe visitor will only be applied to files in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_sfile_finish_visitor() [2/2]

static void cs::analysis::add_sfile_finish_visitor ( visitor< sfileinst > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a serial depth-first phase finish visitor for (representative instances of) files in compilation units whose languages appear in langs.

Parameters
[in]vThe visitor<sfileinst> to add to the serial depth-first phase finish visitor list for files.
[in]langsThe visitor will only be applied to files in compilation units whose language is one of these.
Returns
void

During the serial depth-first analysis phase, v->() will be applied to the representative instances (sfileinst) of source files contained in compilation units whose language appears in langs.

  • In base analyses, it will be applied to the representative instance of every such source file in the project.
  • In incremental analyses, it will be applied only to the representative instances of source files for which all remaining instances are contained in compilation units compiled in the increment.

Note that the visitor is applied to a sfileinst (not a sfile).

 [drop phase]              (incremental only)
 program setup visitors
 program visitors
   (serial depth-first traversal)
      compunit visitors applied to cu1
          [visitors applied to compunit-level symbols in cu1]
          sfile visitors applied to representative instance of top-level source file f1 in cu1...
            ...IF AND ONLY IF this is first time f1 is encountered
          sfileinst visitors applied to f1 instance (always)
              sfile visitors applied to representative instance of file f1inc1 included in f1...
                ...IF AND ONLY IF this is first time f1inc1 is encountered
              sfileinst visitors applied to f1inc1 instance (always)
                  sfile visitors applied to representative instance of file f1inc1inc1 included in f1inc1...
                    ...IF AND ONLY IF this is first time f1inc1inc1 is encountered
                  sfileinst visitors applied to f1inc1inc1 instance (always)
                      [traverse f1inc1inc1 include tree]                                    <--------
                  sfileinst finish visitors applied to f1inc1inc1 instance (always)
                  sfile finish visitors applied to representative instance of f1inc1inc1... <========
                    ...IF AND ONLY IF this is first time f1inc1inc1 is encountered
                  [traverse remainder of f1inc1 include tree]                               <--------
              sfileinst finish visitors applied to f1inc1 instance (always)
              sfile finish visitors applied to representative instance of f1inc1...         <========
                ...IF AND ONLY IF this is first time f1inc1 is encountered
              [traverse remainder of f1 include tree]                                       <--------
          sfileinst finishvisitors applied to f1 instance (always)
          sfile finish visitors applied to representative instance of f1...                 <========
            ...IF AND ONLY IF this is first time f1 is encountered
          [visitors applied to procedures,points,symbols in cu1]
      compunit finish visitors applied to cu1
      [remaining compunits]                                                                 <--------
 program finish visitors
 [parallel depth-first phase]
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_sfile_finish_visitor(visitor<sfileinst> *, const language (&)[N])

◆ add_sfile_parallel_finish_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_sfile_parallel_finish_visitor ( visitor< sfileinst > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_sfile_parallel_finish_visitor(visitor<sfileinst> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<sfileinst> to add to the parallel depth-first phase finish visitor list for files.
[in]langsThe visitor will only be applied to files in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_sfile_parallel_finish_visitor() [2/2]

static void cs::analysis::add_sfile_parallel_finish_visitor ( visitor< sfileinst > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a parallel depth-first phase finish visitor for (representative instances of) files in compilation units whose languages appear in langs.

Parameters
[in]vThe visitor<sfileinst> to add to the parallel depth-first phase finish visitor list for files.
[in]langsThe visitor will only be applied to files in compilation units whose language is one of these.
Returns
void

During the parallel depth-first analysis phase, v->() will be applied to the representative instances (sfileinst) of source files contained in compilation units whose language appears in langs.

  • In base analyses, it will be applied to the representative instance of every such source file in the project.
  • In incremental analyses, it will be applied only to the representative instances of source files for which all remaining instances are contained in compilation units compiled in the increment.

Note that the visitor is applied to a sfileinst (not a sfile).

 [drop phase]              (incremental only)
 program setup visitors
 [serial depth-first phase]
 program parallel visitors
   (parallel depth-first traversal: analysis slaves sA, sB,... may run in parallel)
     [sA] compunit parallel visitors applied to cu1
     [sA]     [parallel visitors applied to compunit-level symbols in cu1]
     [sA]     sfile parallel visitors applied to representative instance of top-level source file f1 in cu1...
                ...IF AND ONLY IF this is first time f1 is encountered
     [sA]     sfileinst parallel visitors applied to f1 instance (always)
     [sA]         sfile parallel visitors applied to representative instance of file f1inc1 included in f1...
                    ...IF AND ONLY IF this is first time f1inc1 is encountered
     [sA]         sfileinst parallel visitors applied to f1inc1 instance (always)
     [sA]             sfile parallel visitors applied to representative instance of file f1inc1inc1 included in f1inc1...
                        ...IF AND ONLY IF this is first time f1inc1inc1 is encountered
     [sA]             sfileinst parallel visitors applied to f1inc1inc1 instance (always)
     [sA]                 [traverse f1inc1inc1 include tree]                                             <--------
     [sA]             sfileinst parallel finish visitors applied to f1inc1inc1 instance (always)
     [sA]             sfile parallel finish visitors applied to representative instance of f1inc1inc1... <========
                         ...IF AND ONLY IF this is first time f1inc1inc1 is encountered
     [sA]             [traverse remainder of f1inc1 include tree]                                        <--------
     [sA]         sfileinst parallel finish visitors applied to f1inc1 instance (always)
     [sA]         sfile parallel finish visitors applied to representative instance of f1inc1...         <========
                    ...IF AND ONLY IF this is first time f1inc1 is encountered
     [sA]         [traverse remainder of f1 include tree]                                                <--------
     [sA]     sfileinst parallel finish visitors applied to f1 instance (always)
     [sA]     sfile parallel finish visitors applied to representative instance of f1...                 <========
                ...IF AND ONLY IF this is first time f1 is encountered
     [sA]     [parallel visitors applied to procedures,points,symbols in cu1]
     [sA] compunit parallel finish visitors applied to cu1
     [sB] [traverse compunit cu2, applying parallel visitors]                                            <--------
     [remaining compunits]                                                                               <--------
 program parallel finish visitors
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_sfile_parallel_finish_visitor(visitor<sfileinst> *, const language (&)[N])

◆ add_sfile_parallel_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_sfile_parallel_visitor ( visitor< sfileinst > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_sfile_parallel_visitor(visitor<sfileinst> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<sfileinst> to add to the parallel depth-first phase visitor list for files.
[in]langsThe visitor will only be applied to files in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_sfile_parallel_visitor() [2/2]

static void cs::analysis::add_sfile_parallel_visitor ( visitor< sfileinst > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a parallel depth-first phase visitor for (representative instances of) files in compilation units whose languages appear in langs.

Parameters
[in]vThe visitor<sfileinst> to add to the parallel depth-first phase visitor list for files.
[in]langsThe visitor will only be applied to files in compilation units whose language is one of these.
Returns
void

During the parallel depth-first analysis phase, v->() will be applied to the representative instances (sfileinst) of source files contained in compilation units whose language appears in langs.

  • In base analyses, it will be applied to the representative instance of every such source file in the project.
  • In incremental analyses, it will be applied only to representative instances of source files for which all remaining instances are contained in compilation units compiled in the increment.

Note that the visitor is applied to a sfileinst (not a sfile).

 [drop phase]              (incremental only)
 program setup visitors
 [serial depth-first phase]
 program parallel visitors
   (parallel depth-first traversal: analysis slaves sA, sB,... may run in parallel)
     [sA] compunit parallel visitors applied to cu1
     [sA]     [parallel visitors applied to compunit-level symbols in cu1]
     [sA]     sfile parallel visitors applied to representative instance of top-level source file f1 in cu1...            <========
                ...IF AND ONLY IF this is first time f1 is encountered
     [sA]     sfileinst parallel visitors applied to f1 instance (always)
     [sA]         sfile parallel visitors applied to representative instance of file f1inc1 included in f1...             <========
                    ...IF AND ONLY IF this is first time f1inc1 is encountered
     [sA]         sfileinst parallel visitors applied to f1inc1 instance (always)
     [sA]             sfile parallel visitors applied to representative instance of file f1inc1inc1 included in f1inc1... <========
                        ...IF AND ONLY IF this is first time f1inc1inc1 is encountered
     [sA]             sfileinst parallel visitors applied to f1inc1inc1 instance (always)
     [sA]                 [traverse f1inc1inc1 include tree]                                                              <--------
     [sA]             sfileinst parallel finish visitors applied to f1inc1inc1 instance (always)
     [sA]             sfile parallel finish visitors applied to representative instance of f1inc1inc1...
                        ...IF AND ONLY IF this is first time f1inc1inc1 is encountered
     [sA]             [traverse remainder of f1inc1 include tree]                                                         <--------
     [sA]         sfileinst parallel finish visitors applied to f1inc1 instance (always)
     [sA]         sfile parallel finish visitors applied to f1inc1...
                    ...IF AND ONLY IF this is first time f1inc1 is encountered
     [sA]         [traverse remainder of f1 include tree]                                                                 <--------
     [sA]     sfileinst parallel finish visitors applied to f1 instance (always)
     [sA]     sfile parallel finish visitors applied to representative instance of f1...
                ...IF AND ONLY IF this is first time f1 is encountered
     [sA]     [parallel visitors applied to procedures,points,symbols in cu1]
     [sA] compunit parallel finish visitors applied to cu1
     [sB] [traverse compunit cu2, applying parallel visitors]                                                             <--------
     [remaining compunits]                                                                                                <--------
 program parallel finish visitors
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_sfile_parallel_visitor(visitor<sfileinst> *, const language (&)[N])

◆ add_sfile_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_sfile_visitor ( visitor< sfileinst > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_sfile_visitor(visitor<sfileinst> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<sfileinst> to add to the serial depth-first phase visitor list for files.
[in]langsThe visitor will only be applied to files in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_sfile_visitor() [2/2]

static void cs::analysis::add_sfile_visitor ( visitor< sfileinst > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a serial depth-first phase visitor for (representative instances of) files in compilation units whose languages appear in langs.

Parameters
[in]vThe visitor<sfileinst> to add to the serial depth-first phase visitor list for files.
[in]langsThe visitor will only be applied to files in compilation units whose language is one of these.
Returns
void

During the serial depth-first analysis phase, v->() will be applied to the representative instances (sfileinst) of source files contained in compilation units whose language appears in langs.

  • In base analyses, it will be applied to the representative instance of every such source file in the project.
  • In incremental analyses, it will be applied only to representative instances of source files for which all remaining instances are contained in compilation units compiled in the increment.

Note that the visitor is applied to a sfileinst (not a sfile).

 [drop phase]              (incremental only)
 program setup visitors
 program visitors
   (serial depth-first traversal)
      compunit visitors applied to cu1
          [visitors applied to compunit-level symbols in cu1]
          sfile visitors applied to representative instance of top-level source file f1 in cu1...             <========
            ...IF AND ONLY IF this is first time f1 is encountered
          sfileinst visitors applied to f1 instance (always)
              sfile visitors applied to representative instance of file f1inc1 included in f1...              <========
                ...IF AND ONLY IF this is first time f1inc1 is encountered
              sfileinst visitors applied to f1inc1 instance (always)
                  sfile visitors applied to representative instance of file f1inc1inc1 included in f1inc1...  <========
                    ...IF AND ONLY IF this is first time f1inc1inc1 is encountered
                  sfileinst visitors applied to f1inc1inc1 instance (always)
                      [traverse f1inc1inc1 include tree]                                                      <--------
                  sfileinst finish visitors applied to f1inc1inc1 instance (always)
                  sfile finish visitors applied to representative instance of f1inc1inc1...
                    ...IF AND ONLY IF this is first time f1inc1inc1 is encountered
                  [traverse remainder of f1inc1 include tree]                                                 <--------
              sfileinst finish visitors applied to f1inc1 instance (always)
              sfile finish visitors applied to f1inc1 
                ...IF AND ONLY IF this is first time f1inc1 is encountered
              [traverse remainder of f1 include tree]                                                         <--------
          sfileinst finish visitors applied to f1 instance (always)
          sfile finish visitors applied to representative instance of f1...
            ...IF AND ONLY IF this is first time f1 is encountered
          [visitors applied to procedures,points,symbols in cu1]
      compunit finish visitors applied to cu1
      [remaining compunits]                                                                                    <--------
 program finish visitors
 [parallel depth-first phase]
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_sfile_visitor(visitor<sfileinst> *, const language (&)[N])

◆ add_sfileinst_finish_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_sfileinst_finish_visitor ( visitor< sfileinst > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_sfileinst_finish_visitor(visitor<sfileinst> *, const std::vector<language> &) except for type of langs argument.

Add v as a serial depth-first phase finish visitor for file instances (sfileinst) in compilation units whose languages appear in langs.

Parameters
[in]vThe visitor<sfileinst> to add to the serial depth-first phase visitor list for file instances.
[in]langsThe visitor will only be applied to file instances in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_sfileinst_finish_visitor() [2/2]

static void cs::analysis::add_sfileinst_finish_visitor ( visitor< sfileinst > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a serial depth-first phase finish visitor for file instances (sfileinst) in compilation units whose languages appear in langs.

Parameters
[in]vThe visitor<sfileinst> to add to the serial depth-first phase visitor list for file instances.
[in]langsThe visitor will only be applied to file instances in compilation units whose language is one of these.
Returns
void

During the serial depth-first analysis phase, v->() will be applied to source file instances (sfile) contained in compilation units whose language appears in langs.

  • In base analyses, it will be applied to every such source file instance in the project.
  • In incremental analyses, it will be applied only to source file instances contained in compilation units compiled in the increment.
 [drop phase]              (incremental only)
 program setup visitors
 program visitors
   (serial depth-first traversal)
      compunit visitors applied to cu1
          [visitors applied to compunit-level symbols in cu1]
          sfile visitors applied to representative instance of top-level source file f1 in cu1...
             ...IF AND ONLY IF this is first time f1 is encountered
          sfileinst visitors applied to f1 instance (always)
              sfile visitors applied to representative instance of file f1inc1 included in f1...
                 ...IF AND ONLY IF this is first time f1inc1 is encountered
              sfileinst visitors applied to f1inc1 instance (always)
                  sfile visitors applied to representative instance of file f1inc1inc1 included in f1inc1...
                    ...IF AND ONLY IF this is first time f1inc1inc1 is encountered
                  sfileinst visitors applied to f1inc1inc1 instance (always)
                      [traverse f1inc1inc1 include tree]                                     <--------
                  sfileinst finish visitors applied to f1inc1inc1 instance (always)          <========
                  sfile finish visitors applied to representative instance of f1inc1inc1 
                    ...IF AND ONLY IF this is first time f1inc1inc1 is encountered
                  [traverse remainder of f1inc1 include tree]                                <--------
              sfileinst finish visitors applied to f1inc1 instance (always)                  <========
              sfile finish visitors applied to representative instance of f1inc1 
                ...IF AND ONLY IF this is first time f1inc1 is encountered
              [traverse remainder of f1 include tree]                                        <--------
          sfileinst finish visitors applied to f1 instance (always)                          <========
          sfile finish visitors applied to representative instance of f1
                  IF AND ONLY IF this is first time f1 is encountered
          [visitors applied to procedures,points,symbols in cu1]
      compunit finish visitors applied to cu1
      [remaining compunits]                                                                  <--------
 program finish visitors
 [parallel depth-first phase]
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_sfileinst_finish_visitor(visitor<sfileinst> *, const language (&)[N])

◆ add_sfileinst_parallel_finish_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_sfileinst_parallel_finish_visitor ( visitor< sfileinst > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_sfileinst_parallel_finish_visitor(visitor<sfileinst> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<sfileinst> to add to the depth-first phase visitor list for file instances.
[in]langsThe visitor will only be applied to file instances in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_sfileinst_parallel_finish_visitor() [2/2]

static void cs::analysis::add_sfileinst_parallel_finish_visitor ( visitor< sfileinst > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a parallel depth-first phase visitor for file instances (sfileinst) in compilation units whose languages appear in langs.

Parameters
[in]vThe visitor<sfileinst> to add to the parallel depth-first phase visitor list for file instances.
[in]langsThe visitor will only be applied to file instances in compilation units whose language is one of these.
Returns
void

During the parallel depth-first analysis phase, v->() will be applied to source file instances (sfile) contained in compilation units whose language appears in langs.

  • In base analyses, it will be applied to every such source file instance in the project.
  • In incremental analyses, it will be applied only to source file instances contained in compilation units compiled in the increment.
 [drop phase]              (incremental only)
 program setup visitors
 [serial depth-first phase]
 program parallel visitors
   (parallel depth-first traversal: analysis slaves sA, sB,... may run in parallel)
     [sA] compunit parallel visitors applied to cu1
     [sA]     [parallel visitors applied to compunit-level symbols in cu1]
     [sA]     sfile parallel visitors applied to representative instance of top-level source file f1 in cu1...
                ...IF AND ONLY IF this is first time f1 is encountered
     [sA]     sfileinst parallel visitors applied to f1 instance (always)
     [sA]         sfile parallel visitors applied to representative instance of file f1inc1 included in f1...
                    ...IF AND ONLY IF this is first time f1inc1 is encountered
     [sA]         sfileinst parallel visitors applied to f1inc1 instance (always)
     [sA]             sfile parallel visitors applied to representative instance of file f1inc1inc1 included in f1inc1...
                        ...IF AND ONLY IF this is first time f1inc1inc1 is encountered
     [sA]             sfileinst parallel visitors applied to f1inc1inc1 instance (always)
     [sA]                 [traverse f1inc1inc1 include tree]                                                      <--------
     [sA]             sfileinst parallel finish visitors applied to f1inc1inc1 instance (always)                  <========
     [sA]             sfile parallel finish visitors applied to representative instance of f1inc1inc1...
                        ...IF AND ONLY IF this is first time f1inc1inc1 is encountered
     [sA]            [traverse remainder of f1inc1 include tree]                                                  <--------
     [sA]        sfileinst parallel finish visitors applied to f1inc1 instance (always)                           <========
     [sA]        sfile parallel finish visitors applied to representative instance of f1inc1...
                   ...IF AND ONLY IF this is first time f1inc1 is encountered
     [sA]        [traverse remainder of f1 include tree]                                                          <--------
     [sA]     sfileinst parallel finish visitors applied to f1 instance (always)                                  <========
     [sA]     sfile parallel finish visitors applied to representative instance of f1...
                ...IF AND ONLY IF this is first time f1 is encountered
     [sA]     [parallel visitors applied to procedures,points,symbols in cu1]
     [sA] compunit parallel finish visitors applied to cu1
     [sB] [traverse compunit cu2, applying parallel visitors]                                                     <--------
     [remaining compunits]                                                                                        <--------
 program parallel finish visitors
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_sfileinst_parallel_finish_visitor(visitor<sfileinst> *, const language (&)[N])

◆ add_sfileinst_parallel_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_sfileinst_parallel_visitor ( visitor< sfileinst > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_sfileinst_parallel_visitor(visitor<sfileinst> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<sfileinst> to add to the parallel depth-first phase visitor list for file instances.
[in]langsThe visitor will only be applied to file instances in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_sfileinst_parallel_visitor() [2/2]

static void cs::analysis::add_sfileinst_parallel_visitor ( visitor< sfileinst > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a parallel depth-first phase visitor for file instances (sfileinst) in compilation units whose languages appear in langs.

Parameters
[in]vThe visitor<sfileinst> to add to the parallel depth-first phase visitor list for file instances.
[in]langsThe visitor will only be applied to file instances in compilation units whose language is one of these.
Returns
void

During the parallel depth-first analysis phase, v->() will be applied to source file instances (sfile) contained in compilation units whose language appears in langs.

  • In base analyses, it will be applied to every such source file instance in the project.
  • In incremental analyses, it will be applied only to source file instances contained in compilation units compiled in the increment.
 [drop phase]              (incremental only)
 program setup visitors
 [serial depth-first phase]
 program parallel visitors
   (parallel depth-first traversal: analysis slaves sA, sB,... may run in parallel)
     [sA] compunit parallel visitors applied to cu1
     [sA]     [parallel visitors applied to compunit-level symbols in cu1]
     [sA]     sfile parallel visitors applied to representative instance of top-level source file f1 in cu1...
                ...IF AND ONLY IF this is first time f1 is encountered
     [sA]     sfileinst parallel visitors applied to f1 instance (always)                                              <========
     [sA]         sfile parallel visitors applied to representative instance of file f1inc1 included in f1...
                    ...IF AND ONLY IF this is first time f1inc1 is encountered
     [sA]         sfileinst parallel visitors applied to f1inc1 instance (always)                                      <========
     [sA]             sfile parallel visitors applied to representative instance of file f1inc1inc1 included in f1inc1...
                        ...IF AND ONLY IF this is first time f1inc1inc1 is encountered
     [sA]             sfileinst parallel visitors applied to f1inc1inc1 instance (always)                              <========
     [sA]                 [traverse f1inc1inc1 include tree]                                                           <--------
     [sA]             sfileinst parallel finish visitors applied to f1inc1inc1 instance (always)
     [sA]             sfile parallel finish visitors applied to representative instance of f1inc1inc1...
                        ...IF AND ONLY IF this is first time f1inc1inc1 is encountered
     [sA]             [traverse remainder of f1inc1 include tree]                                                      <--------
     [sA]         sfileinst parallel finish visitors applied to f1inc1 instance (always)
     [sA]         sfile parallel finish visitors applied to representative instance of f1inc1...
                    ...IF AND ONLY IF this is first time f1inc1 is encountered
     [sA]         [traverse remainder of f1 include tree]                                                              <--------
     [sA]     sfileinst parallel finish visitors applied to f1 instance (always)
     [sA]     sfile parallel finish visitors applied to representative instance of f1...
                ...IF AND ONLY IF this is first time f1 is encountered
     [sA]     [parallel visitors applied to procedures,points,symbols in cu1]
     [sA] compunit parallel finish visitors applied to cu1
     [sB] [traverse compunit cu2, applying parallel visitors]                                                          <--------
     [remaining compunits]                                                                                             <--------
 program parallel finish visitors
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_sfileinst_parallel_visitor(visitor<sfileinst> *, const language (&)[N])

◆ add_sfileinst_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_sfileinst_visitor ( visitor< sfileinst > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_sfileinst_visitor(visitor<sfileinst> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<sfileinst> to add to the serial depth-first phase visitor list for file instances.
[in]langsThe visitor will only be applied to file instances in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_sfileinst_visitor() [2/2]

static void cs::analysis::add_sfileinst_visitor ( visitor< sfileinst > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a serial depth-first phase visitor for file instances (sfileinst) in compilation units whose languages appear in langs.

Parameters
[in]vThe visitor<sfileinst> to add to the serial depth-first phase visitor list for file instances.
[in]langsThe visitor will only be applied to file instances in compilation units whose language is one of these.
Returns
void

During the serial depth-first analysis phase, v->() will be applied to source file instances (sfile) contained in compilation units whose language appears in langs.

  • In base analyses, it will be applied to every such source file instance in the project.
  • In incremental analyses, it will be applied only to source file instances contained in compilation units compiled in the increment.
 [drop phase]              (incremental only)
 program setup visitors
 program visitors
   (serial depth-first traversal)
      compunit visitors applied to cu1
          [visitors applied to compunit-level symbols in cu1]
          sfile visitors applied to representative instance of top-level source file f1 in cu1...
            ...IF AND ONLY IF this is first time f1 is encountered
          sfileinst visitors applied to f1 instance (always)                                          <========
              sfile visitors applied to representative instance of file f1inc1 included in f1...
                ...IF AND ONLY IF this is first time f1inc1 is encountered
              sfileinst visitors applied to f1inc1 instance (always)                                  <========
                  sfile visitors applied to representative instance of file f1inc1inc1 included in f1inc1...
                    ...IF AND ONLY IF this is first time f1inc1inc1 is encountered
                  sfileinst visitors applied to f1inc1inc1 instance (always)                          <========
                      [traverse f1inc1inc1 include tree]                                              <--------
                  sfileinst finish visitors applied to f1inc1inc1 instance (always)
                  sfile finish visitors applied to representative instance of f1inc1inc1...
                    ...IF AND ONLY IF this is first time f1inc1inc1 is encountered
                  [traverse remainder of f1inc1 include tree]                                         <--------
              sfileinst finish visitors applied to f1inc1 instance (always)
              sfile finish visitors applied to representative instance of f1inc1...
                ...IF AND ONLY IF this is first time f1inc1 is encountered
              [traverse remainder of f1 include tree]                                                 <--------
          sfileinst finish visitors applied to f1 instance (always)
          sfile finish visitors applied to representative instance of f1...
             ...IF AND ONLY IF this is first time f1 is encountered
          [visitors applied to procedures,points,symbols in cu1]
      compunit finish visitors applied to cu1
      [remaining compunits]                                                                           <--------
 program finish visitors
 [parallel depth-first phase]
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_sfileinst_visitor(visitor<sfileinst> *, const language (&)[N])

◆ add_step_bottom_up_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_step_bottom_up_visitor ( step_state v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_step_bottom_up_visitor(step_state *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe step_state describing the visitor
[in]langsThe visitor will be applied to CFG edges in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_step_bottom_up_visitor() [2/2]

static void cs::analysis::add_step_bottom_up_visitor ( step_state v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add a bottom-up phase step visitor.

Parameters
[in]vAn object of a concrete step_state subclass.
  • The subclass must define all required step_state methods.
  • The member data values in v must be appropriately initialized: CodeSonar will invoke v->copy() to create a fresh step_state (subclass) object every time the step traversal enters a function.
[in]langsThe visitor will be applied to CFG edges in compilation units whose language is one of these.
Returns
void

During the bottom-up analysis phase, the visitor will be applied to CFG edges contained in compilation units whose language appears in langs.

  • In base analyses, it will be applied to every such CFG edge in the project.
  • In incremental analyses, it will be applied only to CFG edges contained in procedures F for which at least one of the following is true.
    • F is contained in a compilation unit that was compiled in the increment.
    • F's summary is needed for incremental analysis and had to be recomputed because it relied on elements that were deleted or modified by changes in the increment.

For more information about step visitors, see the step_state class documentation and the Visitors manual page.

 [drop phase]              (incremental only)
 program setup visitors
 [serial depth-first phase]
 [parallel depth-first phase]
 [pointer analysis]
 program bottom-up visitors
   (bottom-up traversal)
     procedure bottom up visitors applied to proc1
         [point bottom up visitors applied to points in proc1]
         step visitors applied to proc1cfgedge1            <========
         step visitors applied to proc1cfgedge2            <========
         [remaining CFG edges in proc1]                    <--------
     procedure bottom up finish visitors applied to proc1
     [remaining procedures]                                <--------
 program bottom-up finish visitors
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the step state object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_step_bottom_up_visitor(step_state *, const language (&)[N])

◆ add_symbol_parallel_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_symbol_parallel_visitor ( visitor< symbol > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_symbol_parallel_visitor(visitor<symbol> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<symbol> to add to the parallel depth-first phase visitor list for symbols.
[in]langsThe visitor will only be applied to symbols in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_symbol_parallel_visitor() [2/2]

static void cs::analysis::add_symbol_parallel_visitor ( visitor< symbol > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a parallel depth-first phase visitor for symbols (symbol) in compilation units whose languages appear in langs.

Parameters
[in]vThe visitor<symbol> to add to the parallel depth-first phase visitor list for symbols.
[in]langsThe visitor will only be applied to symbols in compilation units whose language is one of these.
Returns
void

During the parallel depth-first analysis phase, v->() will be applied to symbols (symbol) in the project that are contained in a compilation unit whose language appears in langs.

  • In base analyses, it will be applied to every such symbol in the project.
  • In incremental analyses, it will be applied only to symbols contained in compilation units compiled in the increment.
 [drop phase]              (incremental only)
 program setup visitors
 [serial depth-first phase]
 program parallel visitors
   (parallel depth-first traversal: analysis slaves sA, sB,... may run in parallel)
     [sA] compunit parallel visitors applied to cu1
     [sA]     symbol parallel visitor applied to symbol cu1proc1fsym (function symbol for cu1proc1) <========
     [sA]     [parallel visitors applied to source files and file instances in cu1]
     [sA]     procedure parallel visitors applied to cu1proc1
     [sA]         symbol parallel visitor applied to cu1proc1vsym1                                  <========
     [sA]         symbol parallel visitor applied to cu1proc1vsym2                                  <========
     [sA]         [remaining symbols in cu1proc1]                                                   <--------
     [sA]         [parallel visitors applied to points contained in cu1proc1
     [sA]     procedure parallel finish visitors applied to cu1proc1
     [sA]     [remaining procedures in cu1]                                                         <--------
     [sA] compunit parallel finish visitors applied to cu1
     [sB] [traverse compunit cu2, applying parallel visitors]                                       <--------
     [remaining compunits]                                                                          <--------
 program parallel finish visitors                               
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_symbol_parallel_visitor(visitor<symbol> *, const language (&)[N])

◆ add_symbol_visitor() [1/2]

template<size_t N>
static void cs::analysis::add_symbol_visitor ( visitor< symbol > *  v,
const language(&)  langs[N] 
)
inlinestatic

Identical to add_symbol_visitor(visitor<symbol> *, const std::vector<language> &) except for type of langs argument.

Parameters
[in]vThe visitor<symbol> to add to the serial depth-first phase visitor list for symbols.
[in]langsThe visitor will only be applied to symbols in compilation units whose language is one of these.
Returns
void
Template Parameters
NThe array length.

◆ add_symbol_visitor() [2/2]

static void cs::analysis::add_symbol_visitor ( visitor< symbol > *  v,
const std::vector< language > &  langs = std::vector<language>(1, language::WILDCARD) 
)
inlinestatic

Add v as a serial depth-first phase visitor for symbols (symbol) in compilation units whose languages appear in langs.

Parameters
[in]vThe visitor<symbol> to add to the serial depth-first phase visitor list for symbols.
[in]langsThe visitor will only be applied to symbols in compilation units whose language is one of these.
Returns
void

During the serial depth-first analysis phase, v->() will be applied to symbols (symbol) in the project that are contained in a compilation unit whose language appears in langs.

  • In base analyses, it will be applied to every such symbol in the project.
  • In incremental analyses, it will be applied only to symbols contained in compilation units compiled in the increment.
 [drop phase]              (incremental only)
 program setup visitors
 program visitors
   (serial depth-first traversal)
      compunit visitors applied to cu1 
          symbol visitor applied to symbol cu1proc1fsym (function symbol for cu1proc1) <========
          [visitors applied to source files and file instances in cu1]
          procedure visitors applied to cu1proc1
              symbol visitor applied to cu1proc1vsym1                                  <========
              symbol visitor applied to cu1proc1vsym2                                  <========
              [remaining symbols in cu1proc1]                                          <--------
              [visitors applied to points contained in cu1proc1
          procedure finish visitors applied to cu1proc1
          [remaining procedures in cu1]                                                <--------
      compunit finish visitors applied to cu1
      [remaining compunits]                                                            <--------
 program finish visitors
 [parallel depth-first phase]
 [pointer analysis]
 [bottom-up phase]
 

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

Do not subsequently delete the visitor object *v: CodeSonar may continue to use it indefinitely.

See the simple plug-in example in the Getting Started section.

See also
add_symbol_visitor(visitor<symbol> *, const language (&)[N])

◆ binary_backend_option()

static std::string cs::analysis::binary_backend_option ( const std::string &  key)
inlinestatic

[CodeSonar for Binaries only] Get the value associated with the key in the BINARY_BACKEND_OPTIONS configuration file setting.

Parameters
[in]keyThe key whose associated value is to be obtained.
Returns
A string containing the associated value.
Exceptions
result::ELEMENT_NOT_PRESENTif key doesn't exist.
result::NOT_IMPLEMENTEDif binary analysis is not available.

◆ create_warningclass()

static warningclass cs::analysis::create_warningclass ( const std::string &  _name,
const std::string &  categories = "",
double  rank = 10.0,
warningclass_flags  flags = warningclass_flags::NONE,
warning_significance  significance = warning_significance::UNSPECIFIED 
)
inlinestatic

Create and return a new warning class (warningclass).

Parameters
[in]_nameThe name for the new warning class. Do not specify a name containing the '$' character: behavior is undefined in this case.
[in]categoriesThe categories for the class, as a semicolon-separated list of items, such as: "CWE:124;LANG.MEM.BO". Can be empty.
[in]rankThe warning class "base rank": a value that will be used as a starting point for calculating the rank for warnings of this class, which in turn will determine where those warnings appear in the recommended review order. Warnings from built in warning classes have ranks in the range 1 (most important) to 100 (least important).
[in]flagsThe desired properties of the new warning class.
[in]significanceThe significance setting for the class.
Returns
The new warning class, as a warningclass.

This method is only suitable for use in your plug-in's top-level scope or cs_plug_main() function. Do not call it inside visitors.

If there are multiple calls to create_warningclass() with the same _name, the second and subsequent calls will ignore all other parameters and just return the warningclass created for the first call.

Exceptions
result::ERROR_INVALID_PHASE_FOR_OPERATIONif called from a visitor.
result::ERROR_PARAMETER_TOO_LARGEif_name has more than 1024 characters.
result::ERROR_IMMUTABLE_DATA_STRUCTUREif this is a slave process and the master has not already created a warning class with the same name. Slaves cannot create warning classes unless they are first created in the master process.

◆ get_mode()

static analysis_mode cs::analysis::get_mode ( )
inlinestatic

Get the analysis mode for the CodeSonar process in which the plug-in is running.

Returns
The analysis_mode corresponding to the current mode of the CodeSonar process.

◆ get_multiprocess_mode()

static multiprocess_mode cs::analysis::get_multiprocess_mode ( )
inlinestatic

Get the multiprocess mode for the CodeSonar process in which the plug-in is running.

Returns
The multiprocess_mode corresponding to the current mode of the CodeSonar process.

See Parallelism in CodeSonar: Analysis for more information.

◆ lookup_warningclass() [1/2]

static warningclass cs::analysis::lookup_warningclass ( const std::string &  _name)
inlinestatic

Get the warningclass with the specified name.

Parameters
[in]_nameThe name of the desired warning class.
Returns
The warningclass whose name is _name.
Exceptions
result::ELEMENT_NOT_PRESENTif there is no warningclass named _name.
result::ERROR_INVALID_PHASE_FOR_OPERATIONif called from a drop visitor, cs_plug_main(), or your plug-in's top-level scope.

◆ lookup_warningclass() [2/2]

static warningclass cs::analysis::lookup_warningclass ( csuint32  id)
inlinestatic

Get the warningclass with the specified ID.

Parameters
[in]idThe ID of the desired warning class.
Returns
The warningclass whose ID is id.

To get the ID of a warningclass, use warningclass::id(). Note that a single warning class may have different ID values in different analyses.

Exceptions
result::ELEMENT_NOT_PRESENTif there is no warningclass with the specified id.
result::ERROR_INVALID_PHASE_FOR_OPERATIONif called from a drop visitor, cs_plug_main(), or your plug-in's top-level scope.
result::ERROR_INVALID_ARGUMENTif id is 0.

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