ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn.
[gcc.git] / gcc / gimplify.h
index 5f81cf2fe774d310e381ca9f81e799c6fcf87ab8..5085ccfe554cc54f278a9269e0d48c3cb0deed12 100644 (file)
@@ -1,5 +1,5 @@
 /* Header file for gimplification.
-   Copyright (C) 2013 Free Software Foundation, Inc.
+   Copyright (C) 2013-2014 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -20,8 +20,6 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_GIMPLIFY_H
 #define GCC_GIMPLIFY_H
 
-#include "gimple.h"
-
 /* Validation of GIMPLE expressions.  Note that these predicates only check
    the basic form of the expression, they don't recurse to make sure that
    underlying nodes are also of the right form.  */
@@ -51,7 +49,9 @@ enum gimplify_status {
   GS_ALL_DONE  = 1     /* The expression is fully gimplified.  */
 };
 
-extern void push_gimplify_context (struct gimplify_ctx *);
+extern void free_gimplify_stack (void);
+extern void push_gimplify_context (bool in_ssa = false,
+                                  bool rhs_cond_ok = false);
 extern void pop_gimplify_context (gimple);
 extern gimple gimple_current_bind_expr (void);
 extern vec<gimple> gimple_bind_expr_stack (void);
@@ -60,6 +60,7 @@ extern tree get_formal_tmp_var (tree, gimple_seq *);
 extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq *);
 extern void declare_vars (tree, gimple, bool);
 extern void gimple_add_tmp_var (tree);
+extern void gimple_add_tmp_var_fn (struct function *, tree);
 extern tree unshare_expr (tree);
 extern tree unshare_expr_without_location (tree);
 extern tree voidify_wrapper_expr (tree, tree);
@@ -67,6 +68,7 @@ extern tree build_and_jump (tree *);
 extern enum gimplify_status gimplify_self_mod_expr (tree *, gimple_seq *,
                                                    gimple_seq *, bool, tree);
 extern tree gimple_boolify (tree);
+extern gimple_predicate rhs_predicate_for (tree);
 extern bool gimplify_stmt (tree *, gimple_seq *);
 extern void omp_firstprivatize_variable (struct gimplify_omp_ctx *, tree);
 extern enum gimplify_status gimplify_expr (tree *, gimple_seq *, gimple_seq *,
@@ -75,18 +77,29 @@ extern enum gimplify_status gimplify_expr (tree *, gimple_seq *, gimple_seq *,
 extern void gimplify_type_sizes (tree, gimple_seq *);
 extern void gimplify_one_sizepos (tree *, gimple_seq *);
 extern gimple gimplify_body (tree, bool);
+extern enum gimplify_status gimplify_arg (tree *, gimple_seq *, location_t);
 extern void gimplify_function_tree (tree);
-extern void gimple_regimplify_operands (gimple, gimple_stmt_iterator *);
-extern tree force_gimple_operand_1 (tree, gimple_seq *, gimple_predicate, tree);
-extern tree force_gimple_operand (tree, gimple_seq *, bool, tree);
-extern tree force_gimple_operand_gsi_1 (gimple_stmt_iterator *, tree,
-                                       gimple_predicate, tree,
-                                       bool, enum gsi_iterator_update);
-extern tree force_gimple_operand_gsi (gimple_stmt_iterator *, tree, bool, tree,
-                                     bool, enum gsi_iterator_update);
-
 extern enum gimplify_status gimplify_va_arg_expr (tree *, gimple_seq *,
                                                  gimple_seq *);
 gimple gimplify_assign (tree, tree, gimple_seq *);
 
+/* Return true if gimplify_one_sizepos doesn't need to gimplify
+   expr (when in TYPE_SIZE{,_UNIT} and similar type/decl size/bitsize
+   fields).  */
+
+static inline bool
+is_gimple_sizepos (tree expr)
+{
+  /* gimplify_one_sizepos doesn't need to do anything if the value isn't there,
+     is constant, or contains A PLACEHOLDER_EXPR.  We also don't want to do
+     anything if it's already a VAR_DECL.  If it's a VAR_DECL from another
+     function, the gimplifier will want to replace it with a new variable,
+     but that will cause problems if this type is from outside the function.
+     It's OK to have that here.  */
+  return (expr == NULL_TREE
+         || TREE_CONSTANT (expr)
+         || TREE_CODE (expr) == VAR_DECL
+         || CONTAINS_PLACEHOLDER_P (expr));
+}                                        
+
 #endif /* GCC_GIMPLIFY_H */