GCC Middle and Back End API Reference
call-info.h
Go to the documentation of this file.
1/* Subclasses of custom_edge_info for describing outcomes of function calls.
2 Copyright (C) 2021-2026 Free Software Foundation, Inc.
3 Contributed by David Malcolm <dmalcolm@redhat.com>.
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it
8under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 3, or (at your option)
10any later version.
11
12GCC is distributed in the hope that it will be useful, but
13WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
20
21#ifndef GCC_ANALYZER_CALL_INFO_H
22#define GCC_ANALYZER_CALL_INFO_H
23
24namespace ana {
25
26/* Subclass of custom_edge_info for an outcome of a call.
27 This is still abstract; the update_model and print_desc vfuncs must be
28 implemented. */
29
31{
32public:
33 void print (pretty_printer *pp) const override;
34 void add_events_to_path (checker_path *emission_path,
35 const exploded_edge &eedge,
37 const state_transition *state_trans) const override;
38
39 const gcall &get_call_stmt () const { return m_call_stmt; }
40 tree get_fndecl () const { return m_fndecl; }
41
42 virtual void print_desc (pretty_printer &pp) const = 0;
43
45 region_model_context *ctxt) const;
46
47protected:
49 call_info (const call_details &cd, const function &called_fn);
50
51private:
54};
55
56/* Subclass of call_info for a "success" outcome of a call,
57 adding either a
58 "when `FNDECL' succeeds" message (when 'success' is true)
59 or a
60 "when `FNDECL' fails" message (when 'success' is false).
61 This is still abstract: the custom_edge_info::update_model vfunc
62 must be implemented. */
63
65{
66public:
67 void print_desc (pretty_printer &pp) const final override;
68
69protected:
71 : call_info (cd), m_success (success) {}
72
74};
75
76/* Subclass of call_info for a "success" outcome of a call,
77 adding a "when `FNDECL' succeeds" message.
78 This is still abstract: the custom_edge_info::update_model vfunc
79 must be implemented. */
80
88
89/* Subclass of call_info for a "failure" outcome of a call,
90 adding a "when `FNDECL' fails" message.
91 This is still abstract: the custom_edge_info::update_model vfunc
92 must be implemented. */
93
101
102} // namespace ana
103
104#endif /* GCC_ANALYZER_CALL_INFO_H */
Definition call-details.h:31
const gcall & get_call_stmt() const
Definition call-info.h:39
virtual void print_desc(pretty_printer &pp) const =0
tree get_fndecl() const
Definition call-info.h:40
void add_events_to_path(checker_path *emission_path, const exploded_edge &eedge, pending_diagnostic &pd, const state_transition *state_trans) const override
call_info(const call_details &cd, const function &called_fn)
call_details get_call_details(region_model *model, region_model_context *ctxt) const
void print(pretty_printer *pp) const override
call_info(const call_details &cd)
tree m_fndecl
Definition call-info.h:53
const gcall & m_call_stmt
Definition call-info.h:52
Definition checker-path.h:32
Definition common.h:428
Definition exploded-graph.h:335
failed_call_info(const call_details &cd)
Definition call-info.h:97
Definition pending-diagnostic.h:258
Definition region-model.h:748
Definition region-model.h:294
Definition state-transition.h:31
succeed_or_fail_call_info(const call_details &cd, bool success)
Definition call-info.h:70
void print_desc(pretty_printer &pp) const final override
bool m_success
Definition call-info.h:73
success_call_info(const call_details &cd)
Definition call-info.h:84
Definition pretty-print.h:241
union tree_node * tree
Definition coretypes.h:97
Definition access-diagram.h:30
Definition function.h:249
Definition gimple.h:355
#define true
Definition system.h:890
#define false
Definition system.h:891
static control_dependences * cd
Definition tree-ssa-dce.cc:105