aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple.h
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2013-04-18 10:29:54 -0400
committerDiego Novillo <dnovillo@gcc.gnu.org>2013-04-18 10:29:54 -0400
commit475b8f37f3f4085df385dbb122e0401a63d24edd (patch)
tree09e712c2649b544f356460fea4ffacbd8c9364d1 /gcc/gimple.h
parent13957435839e1dc1d3bad23510640a1d09a84772 (diff)
downloadgcc-475b8f37f3f4085df385dbb122e0401a63d24edd.zip
gcc-475b8f37f3f4085df385dbb122e0401a63d24edd.tar.gz
gcc-475b8f37f3f4085df385dbb122e0401a63d24edd.tar.bz2
Simplified GIMPLE IL builder functions.
* gimple.c (create_gimple_tmp): New. (get_expr_type): New. (build_assign): New. (build_type_cast): New. * gimple.h (enum ssa_mode): Define. (gimple_seq_set_location): New. * asan.c (build_check_stmt): Change some gimple_build_* calls to use build_assign and build_type_cast. From-SVN: r198056
Diffstat (limited to 'gcc/gimple.h')
-rw-r--r--gcc/gimple.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 475d2ea..3a65e3c 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -33,6 +33,15 @@ along with GCC; see the file COPYING3. If not see
typedef gimple gimple_seq_node;
+/* Types of supported temporaries. GIMPLE temporaries may be symbols
+ in normal form (i.e., regular decls) or SSA names. This enum is
+ used by create_gimple_tmp to tell it what kind of temporary the
+ caller wants. */
+enum ssa_mode {
+ M_SSA = 0,
+ M_NORMAL
+};
+
/* For each block, the PHI nodes that need to be rewritten are stored into
these vectors. */
typedef vec<gimple> gimple_vec;
@@ -720,6 +729,17 @@ union GTY ((desc ("gimple_statement_structure (&%h)"),
/* In gimple.c. */
+/* Helper functions to build GIMPLE statements. */
+tree create_gimple_tmp (tree, enum ssa_mode = M_SSA);
+gimple build_assign (enum tree_code, tree, int, enum ssa_mode = M_SSA);
+gimple build_assign (enum tree_code, gimple, int, enum ssa_mode = M_SSA);
+gimple build_assign (enum tree_code, tree, tree, enum ssa_mode = M_SSA);
+gimple build_assign (enum tree_code, gimple, tree, enum ssa_mode = M_SSA);
+gimple build_assign (enum tree_code, tree, gimple, enum ssa_mode = M_SSA);
+gimple build_assign (enum tree_code, gimple, gimple, enum ssa_mode = M_SSA);
+gimple build_type_cast (tree, tree, enum ssa_mode = M_SSA);
+gimple build_type_cast (tree, gimple, enum ssa_mode = M_SSA);
+
/* Offset in bytes to the location of the operand vector.
Zero if there is no operand vector for this tuple structure. */
extern size_t const gimple_ops_offset_[];
@@ -1096,7 +1116,6 @@ gimple_seq_empty_p (gimple_seq s)
return s == NULL;
}
-
void gimple_seq_add_stmt (gimple_seq *, gimple);
/* Link gimple statement GS to the end of the sequence *SEQ_P. If
@@ -5326,4 +5345,15 @@ extern tree maybe_fold_or_comparisons (enum tree_code, tree, tree,
enum tree_code, tree, tree);
bool gimple_val_nonnegative_real_p (tree);
+
+
+/* Set the location of all statements in SEQ to LOC. */
+
+static inline void
+gimple_seq_set_location (gimple_seq seq, location_t loc)
+{
+ for (gimple_stmt_iterator i = gsi_start (seq); !gsi_end_p (i); gsi_next (&i))
+ gimple_set_location (gsi_stmt (i), loc);
+}
+
#endif /* GCC_GIMPLE_H */