annotate gcc/gimplify.h @ 127:4c56639505ff

fix function.c and add CbC-example Makefile
author mir3636
date Wed, 11 Apr 2018 18:46:58 +0900
parents 04ced10e8804
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Header file for gimplification.
kono
parents:
diff changeset
2 Copyright (C) 2013-2017 Free Software Foundation, Inc.
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 This file is part of GCC.
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 GCC is free software; you can redistribute it and/or modify it under
kono
parents:
diff changeset
7 the terms of the GNU General Public License as published by the Free
kono
parents:
diff changeset
8 Software Foundation; either version 3, or (at your option) any later
kono
parents:
diff changeset
9 version.
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
kono
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kono
parents:
diff changeset
14 for more details.
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
17 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
18 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 #ifndef GCC_GIMPLIFY_H
kono
parents:
diff changeset
21 #define GCC_GIMPLIFY_H
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 /* Validation of GIMPLE expressions. Note that these predicates only check
kono
parents:
diff changeset
24 the basic form of the expression, they don't recurse to make sure that
kono
parents:
diff changeset
25 underlying nodes are also of the right form. */
kono
parents:
diff changeset
26 typedef bool (*gimple_predicate)(tree);
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 /* FIXME we should deduce this from the predicate. */
kono
parents:
diff changeset
29 enum fallback {
kono
parents:
diff changeset
30 fb_none = 0, /* Do not generate a temporary. */
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 fb_rvalue = 1, /* Generate an rvalue to hold the result of a
kono
parents:
diff changeset
33 gimplified expression. */
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 fb_lvalue = 2, /* Generate an lvalue to hold the result of a
kono
parents:
diff changeset
36 gimplified expression. */
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 fb_mayfail = 4, /* Gimplification may fail. Error issued
kono
parents:
diff changeset
39 afterwards. */
kono
parents:
diff changeset
40 fb_either= fb_rvalue | fb_lvalue
kono
parents:
diff changeset
41 };
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 typedef int fallback_t;
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 enum gimplify_status {
kono
parents:
diff changeset
46 GS_ERROR = -2, /* Something Bad Seen. */
kono
parents:
diff changeset
47 GS_UNHANDLED = -1, /* A langhook result for "I dunno". */
kono
parents:
diff changeset
48 GS_OK = 0, /* We did something, maybe more to do. */
kono
parents:
diff changeset
49 GS_ALL_DONE = 1 /* The expression is fully gimplified. */
kono
parents:
diff changeset
50 };
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 extern void free_gimplify_stack (void);
kono
parents:
diff changeset
53 extern void push_gimplify_context (bool in_ssa = false,
kono
parents:
diff changeset
54 bool rhs_cond_ok = false);
kono
parents:
diff changeset
55 extern void pop_gimplify_context (gimple *);
kono
parents:
diff changeset
56 extern gbind *gimple_current_bind_expr (void);
kono
parents:
diff changeset
57 extern vec<gbind *> gimple_bind_expr_stack (void);
kono
parents:
diff changeset
58 extern void gimplify_and_add (tree, gimple_seq *);
kono
parents:
diff changeset
59 extern tree get_formal_tmp_var (tree, gimple_seq *);
kono
parents:
diff changeset
60 extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq *,
kono
parents:
diff changeset
61 bool = true);
kono
parents:
diff changeset
62 extern void declare_vars (tree, gimple *, bool);
kono
parents:
diff changeset
63 extern void gimple_add_tmp_var (tree);
kono
parents:
diff changeset
64 extern void gimple_add_tmp_var_fn (struct function *, tree);
kono
parents:
diff changeset
65 extern tree unshare_expr (tree);
kono
parents:
diff changeset
66 extern tree unshare_expr_without_location (tree);
kono
parents:
diff changeset
67 extern tree voidify_wrapper_expr (tree, tree);
kono
parents:
diff changeset
68 extern tree build_and_jump (tree *);
kono
parents:
diff changeset
69 extern enum gimplify_status gimplify_self_mod_expr (tree *, gimple_seq *,
kono
parents:
diff changeset
70 gimple_seq *, bool, tree);
kono
parents:
diff changeset
71 extern tree gimple_boolify (tree);
kono
parents:
diff changeset
72 extern gimple_predicate rhs_predicate_for (tree);
kono
parents:
diff changeset
73 extern bool gimplify_stmt (tree *, gimple_seq *);
kono
parents:
diff changeset
74 extern void omp_firstprivatize_variable (struct gimplify_omp_ctx *, tree);
kono
parents:
diff changeset
75 extern enum gimplify_status gimplify_expr (tree *, gimple_seq *, gimple_seq *,
kono
parents:
diff changeset
76 bool (*) (tree), fallback_t);
kono
parents:
diff changeset
77
kono
parents:
diff changeset
78 extern void gimplify_type_sizes (tree, gimple_seq *);
kono
parents:
diff changeset
79 extern void gimplify_one_sizepos (tree *, gimple_seq *);
kono
parents:
diff changeset
80 extern gbind *gimplify_body (tree, bool);
kono
parents:
diff changeset
81 extern enum gimplify_status gimplify_arg (tree *, gimple_seq *, location_t,
kono
parents:
diff changeset
82 bool = true);
kono
parents:
diff changeset
83 extern void gimplify_function_tree (tree);
kono
parents:
diff changeset
84 extern enum gimplify_status gimplify_va_arg_expr (tree *, gimple_seq *,
kono
parents:
diff changeset
85 gimple_seq *);
kono
parents:
diff changeset
86 gimple *gimplify_assign (tree, tree, gimple_seq *);
kono
parents:
diff changeset
87
kono
parents:
diff changeset
88 /* Return true if gimplify_one_sizepos doesn't need to gimplify
kono
parents:
diff changeset
89 expr (when in TYPE_SIZE{,_UNIT} and similar type/decl size/bitsize
kono
parents:
diff changeset
90 fields). */
kono
parents:
diff changeset
91
kono
parents:
diff changeset
92 static inline bool
kono
parents:
diff changeset
93 is_gimple_sizepos (tree expr)
kono
parents:
diff changeset
94 {
kono
parents:
diff changeset
95 /* gimplify_one_sizepos doesn't need to do anything if the value isn't there,
kono
parents:
diff changeset
96 is constant, or contains A PLACEHOLDER_EXPR. We also don't want to do
kono
parents:
diff changeset
97 anything if it's already a VAR_DECL. If it's a VAR_DECL from another
kono
parents:
diff changeset
98 function, the gimplifier will want to replace it with a new variable,
kono
parents:
diff changeset
99 but that will cause problems if this type is from outside the function.
kono
parents:
diff changeset
100 It's OK to have that here. */
kono
parents:
diff changeset
101 return (expr == NULL_TREE
kono
parents:
diff changeset
102 || TREE_CODE (expr) == INTEGER_CST
kono
parents:
diff changeset
103 || TREE_CODE (expr) == VAR_DECL
kono
parents:
diff changeset
104 || CONTAINS_PLACEHOLDER_P (expr));
kono
parents:
diff changeset
105 }
kono
parents:
diff changeset
106
kono
parents:
diff changeset
107 #endif /* GCC_GIMPLIFY_H */