gcc/
[gcc.git] / gcc / gimple.c
index 2af285f7a6dd5faa75127ab2855bc9eee986aac1..20cd840f08c3c4dab38642f765737a1d8cc2884f 100644 (file)
@@ -24,17 +24,15 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tm.h"
 #include "target.h"
+#include "alias.h"
+#include "symtab.h"
 #include "tree.h"
+#include "fold-const.h"
 #include "calls.h"
 #include "stmt.h"
 #include "stor-layout.h"
 #include "hard-reg-set.h"
 #include "predict.h"
-#include "vec.h"
-#include "hashtab.h"
-#include "hash-set.h"
-#include "machmode.h"
-#include "input.h"
 #include "function.h"
 #include "dominance.h"
 #include "cfg.h"
@@ -43,7 +41,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "internal-fn.h"
 #include "tree-eh.h"
 #include "gimple-expr.h"
-#include "is-a.h"
 #include "gimple.h"
 #include "gimple-iterator.h"
 #include "gimple-walk.h"
@@ -61,6 +58,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ipa-ref.h"
 #include "lto-streamer.h"
 #include "cgraph.h"
+#include "gimple-ssa.h"
 
 
 /* All the tuples have their operand vector (if present) at the very bottom
@@ -866,8 +864,7 @@ gimple_build_omp_critical (gimple_seq body, tree name)
 
    BODY is sequence of statements inside the for loop.
    KIND is the `for' variant.
-   CLAUSES, are any of the OMP loop construct's clauses: private, firstprivate,
-   lastprivate, reductions, ordered, schedule, and nowait.
+   CLAUSES, are any of the construct's clauses.
    COLLAPSE is the collapse count.
    PRE_BODY is the sequence of statements that are loop invariant.  */
 
@@ -1082,7 +1079,8 @@ gimple_build_omp_single (gimple_seq body, tree clauses)
 /* Build a GIMPLE_OMP_TARGET statement.
 
    BODY is the sequence of statements that will be executed.
-   CLAUSES are any of the OMP target construct's clauses.  */
+   KIND is the kind of the region.
+   CLAUSES are any of the construct's clauses.  */
 
 gomp_target *
 gimple_build_omp_target (gimple_seq body, int kind, tree clauses)
@@ -2944,3 +2942,20 @@ gimple_seq_discard (gimple_seq seq)
       ggc_free (stmt);
     }
 }
+
+/* See if STMT now calls function that takes no parameters and if so, drop
+   call arguments.  This is used when devirtualization machinery redirects
+   to __builtiln_unreacahble or __cxa_pure_virutal.  */
+
+void
+maybe_remove_unused_call_args (struct function *fn, gimple stmt)
+{
+  tree decl = gimple_call_fndecl (stmt);
+  if (TYPE_ARG_TYPES (TREE_TYPE (decl))
+      && TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl))) == void_type_node
+      && gimple_call_num_args (stmt))
+    {
+      gimple_set_num_ops (stmt, 3);
+      update_stmt_fn (fn, stmt);
+    }
+}