xref: /dragonfly/contrib/gcc-8.0/gcc/tree-chkp.h (revision 38fd1498)
1*38fd1498Szrj /* Declaration of interface functions of Pointer Bounds Checker.
2*38fd1498Szrj    Copyright (C) 2014-2018 Free Software Foundation, Inc.
3*38fd1498Szrj 
4*38fd1498Szrj This file is part of GCC.
5*38fd1498Szrj 
6*38fd1498Szrj GCC is free software; you can redistribute it and/or modify it under
7*38fd1498Szrj the terms of the GNU General Public License as published by the Free
8*38fd1498Szrj Software Foundation; either version 3, or (at your option) any later
9*38fd1498Szrj version.
10*38fd1498Szrj 
11*38fd1498Szrj GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12*38fd1498Szrj WARRANTY; without even the implied warranty of MERCHANTABILITY or
13*38fd1498Szrj FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14*38fd1498Szrj for more details.
15*38fd1498Szrj 
16*38fd1498Szrj You should have received a copy of the GNU General Public License
17*38fd1498Szrj along with GCC; see the file COPYING3.  If not see
18*38fd1498Szrj <http://www.gnu.org/licenses/>.  */
19*38fd1498Szrj 
20*38fd1498Szrj #ifndef GCC_TREE_CHKP_H
21*38fd1498Szrj #define GCC_TREE_CHKP_H
22*38fd1498Szrj 
23*38fd1498Szrj #define DECL_BOUNDS(NODE) (chkp_get_bounds (DECL_WRTL_CHECK (NODE)))
24*38fd1498Szrj 
25*38fd1498Szrj #define SET_DECL_BOUNDS(NODE, VAL) \
26*38fd1498Szrj   (chkp_set_bounds (DECL_WRTL_CHECK (NODE), VAL))
27*38fd1498Szrj 
28*38fd1498Szrj extern tree chkp_get_bounds (tree node);
29*38fd1498Szrj extern void chkp_set_bounds (tree node, tree val);
30*38fd1498Szrj extern bool chkp_register_var_initializer (tree var);
31*38fd1498Szrj extern void chkp_finish_file (void);
32*38fd1498Szrj extern bool chkp_type_has_pointer (const_tree type);
33*38fd1498Szrj extern unsigned chkp_type_bounds_count (const_tree type);
34*38fd1498Szrj extern tree chkp_make_bounds_for_struct_addr (tree ptr);
35*38fd1498Szrj extern tree chkp_get_zero_bounds_var (void);
36*38fd1498Szrj extern tree chkp_get_none_bounds_var (void);
37*38fd1498Szrj extern void chkp_check_mem_access (tree first, tree last, tree bounds,
38*38fd1498Szrj 				   gimple_stmt_iterator iter,
39*38fd1498Szrj 				   location_t location,
40*38fd1498Szrj 				   tree dirflag);
41*38fd1498Szrj extern void chkp_fix_cfg (void);
42*38fd1498Szrj extern bool chkp_variable_size_type (tree type);
43*38fd1498Szrj extern tree chkp_build_make_bounds_call (tree lb, tree size);
44*38fd1498Szrj extern tree chkp_build_bndldx_call (tree addr, tree ptr);
45*38fd1498Szrj extern tree chkp_build_bndstx_call (tree addr, tree ptr, tree bounds);
46*38fd1498Szrj extern void chkp_find_bound_slots (const_tree type, bitmap res);
47*38fd1498Szrj extern void chkp_build_bndstx (tree addr, tree ptr, tree bounds,
48*38fd1498Szrj 			       gimple_stmt_iterator *gsi);
49*38fd1498Szrj extern gcall *chkp_retbnd_call_by_val (tree val);
50*38fd1498Szrj extern bool chkp_function_instrumented_p (tree fndecl);
51*38fd1498Szrj extern void chkp_function_mark_instrumented (tree fndecl);
52*38fd1498Szrj extern void chkp_copy_bounds_for_assign (gimple *assign,
53*38fd1498Szrj 					 struct cgraph_edge *edge);
54*38fd1498Szrj extern bool chkp_gimple_call_builtin_p (gimple *call,
55*38fd1498Szrj 					enum built_in_function code);
56*38fd1498Szrj extern rtx chkp_expand_zero_bounds (void);
57*38fd1498Szrj extern void chkp_expand_bounds_reset_for_mem (tree mem, tree ptr);
58*38fd1498Szrj extern tree chkp_insert_retbnd_call (tree bndval, tree retval,
59*38fd1498Szrj 				     gimple_stmt_iterator *gsi);
60*38fd1498Szrj extern gcall *chkp_copy_call_skip_bounds (gcall *call);
61*38fd1498Szrj extern bool chkp_redirect_edge (cgraph_edge *e);
62*38fd1498Szrj extern void chkp_fixup_inlined_call (tree lhs, tree rhs);
63*38fd1498Szrj 
64*38fd1498Szrj #endif /* GCC_TREE_CHKP_H */
65