CodeSonar C++ API
[For improved navigation, enable JavaScript.]
cs_symbol.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023, an unpublished work by CodeSecure, Inc.
3  * ALL RIGHTS RESERVED
4  *
5  * Copyright (c) 2013-2023, an unpublished work by GrammaTech, Inc.
6  * ALL RIGHTS RESERVED
7  *
8  * This software is furnished under a license and may be used and
9  * copied only in accordance with the terms of such license and the
10  * inclusion of the above copyright notice. This software or any
11  * other copies thereof may not be provided or otherwise made
12  * available to any other person. Title to and ownership of the
13  * software is retained by CodeSecure, Inc.
14  */
15 
16 #ifndef CS_SYMBOL_HPP
17 #define CS_SYMBOL_HPP
18 
19 #include "cs_symbol_decl.hpp"
20 #include "cs_procedure_decl.hpp"
21 
24 namespace cs{
26  {
27  cs_pdg rv;
28  check(cs_abs_loc_function_to_pdg(unwrap(), &rv));
29  return procedure::;
30  }
31 
33  inline point_set symbol::declarations() const
34  {
35  cs_const_pdg_vertex_set rv;
36  check(cs_abs_loc_declarations(unwrap(), &rv));
37  return cglue<point_set>::wrap(rv, true);
38  }
39 
40  inline point symbol::primary_declaration() const
41  {
42  cs_pdg_vertex rv;
43  check(cs_abs_loc_primary_declaration(unwrap(), &rv));
44  return point::;
45  }
49  {
50  cs_pdg rv;
51  check(cs_abs_loc_pdg(unwrap(), &rv));
52  return procedure::;
53  }
54 
56  inline symbol cglue<symbol>::wrap(const cs_abs_loc &c)
57  { return symbol(c); }
58 
59  inline cs_abs_loc cglue<symbol>::unwrap(const symbol &c)
60  { return c.unwrap(); }
62 }
63 
64 #endif /* CS_SYMBOL_HPP */
Namespace for CodeSonar/CodeSurfer API.
Definition: cs_ast.hpp:33
procedure as_procedure() const
Get the procedure corresponding to a function symbol.
Definition: cs_symbol.hpp:25
A function or variable.
Definition: cs_symbol_decl.hpp:243
A single procedure/function/method.
Definition: cs_procedure_decl.hpp:173
A set of points (point).
Definition: cs_tplt_instantiations.hpp:214
procedure get_procedure() const
Get the procedure to which a local or local-static symbol is scoped.
Definition: cs_symbol.hpp:48