tree-chkp.h 2.6 KB

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