diff options
author | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-04-18 14:29:54 +0000 |
---|---|---|
committer | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-04-18 14:29:54 +0000 |
commit | 32bd77088add477333e7b7f60e5fd601e41ebe2e (patch) | |
tree | 09e712c2649b544f356460fea4ffacbd8c9364d1 /gcc/gimple.h | |
parent | 984215a66f4c3b2624f85e600e6bfc25fa2a5163 (diff) | |
download | gcc-32bd77088add477333e7b7f60e5fd601e41ebe2e.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198056 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple.h')
-rw-r--r-- | gcc/gimple.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/gcc/gimple.h b/gcc/gimple.h index 475d2ea9ee7..3a65e3ccace 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 */ |