xref: /netbsd-src/external/gpl3/gcc/dist/gcc/gimple-ssa-warn-access.h (revision b1e838363e3c6fc78a55519254d99869742dd33c)
1 /* Pass to detect and issue warnings for invalid accesses, including
2    invalid or mismatched allocation/deallocation calls.
3 
4    Copyright (C) 2020-2022 Free Software Foundation, Inc.
5    Contributed by Martin Sebor <msebor@redhat.com>.
6 
7    This file is part of GCC.
8 
9    GCC is free software; you can redistribute it and/or modify it under
10    the terms of the GNU General Public License as published by the Free
11    Software Foundation; either version 3, or (at your option) any later
12    version.
13 
14    GCC is distributed in the hope that it will be useful, but WITHOUT ANY
15    WARRANTY; without even the implied warranty of MERCHANTABILITY or
16    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17    for more details.
18 
19    You should have received a copy of the GNU General Public License
20    along with GCC; see the file COPYING3.  If not see
21    <http://www.gnu.org/licenses/>.  */
22 
23 #ifndef GCC_GIMPLE_SSA_WARN_ACCESS_H
24 #define GCC_GIMPLE_SSA_WARN_ACCESS_H
25 
26 extern bool check_nul_terminated_array (tree, tree, tree = NULL_TREE);
27 extern void warn_string_no_nul (location_t, gimple *, const char *, tree,
28 				tree, tree = NULL_TREE, bool = false,
29 				const wide_int[2] = NULL);
30 extern void warn_string_no_nul (location_t, tree, const char *, tree,
31 				tree, tree = NULL_TREE, bool = false,
32 				const wide_int[2] = NULL);
33 extern tree unterminated_array (tree, tree * = NULL, bool * = NULL);
34 
35 extern bool maybe_warn_nonstring_arg (tree, gimple *);
36 extern bool maybe_warn_nonstring_arg (tree, tree);
37 
38 class access_data;
39 extern bool maybe_warn_for_bound (opt_code, location_t, gimple *, tree,
40 				  tree[2], tree, const access_data * = NULL);
41 extern bool maybe_warn_for_bound (opt_code, location_t, tree, tree,
42 				  tree[2], tree, const access_data * = NULL);
43 
44 class access_data;
45 extern bool check_access (tree, tree, tree, tree, tree, access_mode,
46 			  const access_data * = NULL);
47 
48 #endif   // GCC_GIMPLE_SSA_WARN_ACCESS_H
49