annotate gcc/ubsan.h @ 16:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
kono
parents:
diff changeset
1 /* UndefinedBehaviorSanitizer, undefined behavior detector.
kono
parents:
diff changeset
2 Copyright (C) 2013-2017 Free Software Foundation, Inc.
kono
parents:
diff changeset
3 Contributed by Marek Polacek <polacek@redhat.com>
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 This file is part of GCC.
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 GCC is free software; you can redistribute it and/or modify it under
kono
parents:
diff changeset
8 the terms of the GNU General Public License as published by the Free
kono
parents:
diff changeset
9 Software Foundation; either version 3, or (at your option) any later
kono
parents:
diff changeset
10 version.
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
kono
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kono
parents:
diff changeset
15 for more details.
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
18 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
19 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 #ifndef GCC_UBSAN_H
kono
parents:
diff changeset
22 #define GCC_UBSAN_H
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 /* The various kinds of NULL pointer checks. */
kono
parents:
diff changeset
25 enum ubsan_null_ckind {
kono
parents:
diff changeset
26 UBSAN_LOAD_OF,
kono
parents:
diff changeset
27 UBSAN_STORE_OF,
kono
parents:
diff changeset
28 UBSAN_REF_BINDING,
kono
parents:
diff changeset
29 UBSAN_MEMBER_ACCESS,
kono
parents:
diff changeset
30 UBSAN_MEMBER_CALL,
kono
parents:
diff changeset
31 UBSAN_CTOR_CALL,
kono
parents:
diff changeset
32 UBSAN_DOWNCAST_POINTER,
kono
parents:
diff changeset
33 UBSAN_DOWNCAST_REFERENCE,
kono
parents:
diff changeset
34 UBSAN_UPCAST,
kono
parents:
diff changeset
35 UBSAN_CAST_TO_VBASE
kono
parents:
diff changeset
36 };
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 /* This controls how ubsan prints types. Used in ubsan_type_descriptor. */
kono
parents:
diff changeset
39 enum ubsan_print_style {
kono
parents:
diff changeset
40 UBSAN_PRINT_NORMAL,
kono
parents:
diff changeset
41 UBSAN_PRINT_POINTER,
kono
parents:
diff changeset
42 UBSAN_PRINT_ARRAY
kono
parents:
diff changeset
43 };
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 /* This controls ubsan_encode_value behavior. */
kono
parents:
diff changeset
46 enum ubsan_encode_value_phase {
kono
parents:
diff changeset
47 UBSAN_ENCODE_VALUE_GENERIC,
kono
parents:
diff changeset
48 UBSAN_ENCODE_VALUE_GIMPLE,
kono
parents:
diff changeset
49 UBSAN_ENCODE_VALUE_RTL
kono
parents:
diff changeset
50 };
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 extern bool ubsan_expand_bounds_ifn (gimple_stmt_iterator *);
kono
parents:
diff changeset
53 extern bool ubsan_expand_null_ifn (gimple_stmt_iterator *);
kono
parents:
diff changeset
54 extern bool ubsan_expand_objsize_ifn (gimple_stmt_iterator *);
kono
parents:
diff changeset
55 extern bool ubsan_expand_ptr_ifn (gimple_stmt_iterator *);
kono
parents:
diff changeset
56 extern bool ubsan_expand_vptr_ifn (gimple_stmt_iterator *);
kono
parents:
diff changeset
57 extern bool ubsan_instrument_unreachable (gimple_stmt_iterator *);
kono
parents:
diff changeset
58 extern tree ubsan_create_data (const char *, int, const location_t *, ...);
kono
parents:
diff changeset
59 extern tree ubsan_type_descriptor (tree, ubsan_print_style
kono
parents:
diff changeset
60 = UBSAN_PRINT_NORMAL);
kono
parents:
diff changeset
61 extern tree ubsan_encode_value (tree, ubsan_encode_value_phase
kono
parents:
diff changeset
62 = UBSAN_ENCODE_VALUE_GENERIC);
kono
parents:
diff changeset
63 extern bool is_ubsan_builtin_p (tree);
kono
parents:
diff changeset
64 extern tree ubsan_build_overflow_builtin (tree_code, location_t, tree, tree,
kono
parents:
diff changeset
65 tree, tree *);
kono
parents:
diff changeset
66 extern tree ubsan_instrument_float_cast (location_t, tree, tree);
kono
parents:
diff changeset
67 extern tree ubsan_get_source_location_type (void);
kono
parents:
diff changeset
68
kono
parents:
diff changeset
69 #endif /* GCC_UBSAN_H */