CodeSonar C++ API
[For improved navigation, enable JavaScript.]
cs_procedure.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_PROCEDURE_HPP
17 #define CS_PROCEDURE_HPP
18 
19 #include "cs_procedure_decl.hpp"
20 #include "cs_symbol_decl.hpp"
21 
24 namespace cs{
26  {
27  cs_abs_loc rv;
28  check(cs_pdg_abs_loc(inner, &rv));
29  return symbol::;
30  }
31 
33  inline point procedure::add_declaration(symbol al)
34  {
35  cs_pdg_vertex rv;
36  check(cs_pdg_add_declaration(inner, cglue<symbol>::unwrap(al), &rv));
37  return point::;
38  }
39 
40  inline point_set procedure::used_points(symbol al) const
41  {
42  cs_pdg_vertex_set rv;
43  check(cs_pdg_abs_loc_used_vertices(
44  inner, cglue<symbol>::unwrap(al), &rv));
45  return cglue<point_set>::wrap(rv, false);
46  }
47 
48  inline point_set procedure::killed_points(symbol al) const
49  {
50  cs_pdg_vertex_set rv;
51  check(cs_pdg_abs_loc_killed_vertices(
52  inner, cglue<symbol>::unwrap(al), &rv));
53  return cglue<point_set>::wrap(rv, false);
54  }
55 
56  inline point_set procedure::cond_killed_points(symbol al) const
57  {
58  cs_pdg_vertex_set rv;
59  check(cs_pdg_abs_loc_cond_killed_vertices(
60  inner, cglue<symbol>::unwrap(al), &rv));
61  return cglue<point_set>::wrap(rv, false);
62  }
63 
64  inline point_set procedure::may_killed_points(symbol al) const
65  {
66  cs_pdg_vertex_set rv;
67  check(cs_pdg_abs_loc_may_killed_vertices(
68  inner, cglue<symbol>::unwrap(al), &rv));
69  return cglue<point_set>::wrap(rv, false);
70  }
75  inline basic_block procedure::retrieve_basic_block(csint64 _id) const
76  {
77  cs_basic_block rv;
78  check(cs_pdg_retrieve_basic_block(
79  inner, _id, &rv));
80  return basic_block::;
81  }
82 
83  inline basic_block procedure::entry_basic_block() const
84  {
85  cs_basic_block rv;
86  check(cs_pdg_entry_basic_block(
87  inner, &rv));
88  return basic_block::;
89  }
90 
91  inline basic_block procedure::exit_basic_block() const
92  {
93  cs_basic_block rv;
94  check(cs_pdg_exit_basic_block(
95  inner, &rv));
96  return basic_block::;
97  }
101  inline procedure cglue<procedure>::wrap(const cs_pdg &c)
102  { return procedure(c); }
103 
104  inline cs_pdg cglue<procedure>::unwrap(const procedure &c)
105  { return c.unwrap(); }
107 }
108 
109 #endif /* CS_PROCEDURE_HPP */
Namespace for CodeSonar/CodeSurfer API.
Definition: cs_ast.hpp:33
A function or variable.
Definition: cs_symbol_decl.hpp:243
A single program point.
Definition: cs_point_decl.hpp:66
symbol get_symbol() const
Get the symbol for a procedure.
Definition: cs_procedure.hpp:25