This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gimple-classes, committed 82/92] Concretize gimple_call_arg_flags
- From: David Malcolm <dmalcolm at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: David Malcolm <dmalcolm at redhat dot com>
- Date: Mon, 27 Oct 2014 16:41:20 -0400
- Subject: [gimple-classes, committed 82/92] Concretize gimple_call_arg_flags
- Authentication-results: sourceware.org; auth=none
- References: <1414442490-14841-1-git-send-email-dmalcolm at redhat dot com>
This corresponds to:
[PATCH 84/89] Concretize gimple_call_arg_flags
https://gcc.gnu.org/ml/gcc-patches/2014-04/msg01186.html
from the original 89-patch kit
That earlier patch was approved by Jeff:
> This is fine, but will need tweaking once the const changes go in. The
> final form is approved given its triviality, but please post for
> archival purposes.
in https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00838.html
gcc/
* gimple.h (gimple_call_arg_flags): Require a const_gimple_call
rather than a const_gimple.
* gimple.c (gimple_call_fnspec): Likewise.
(gimple_call_arg_flags): Likewise.
* tree-inline.c (remap_gimple_stmt): Use a dyn_cast rather than a
is_gimple_call and repeated checked casts.
---
gcc/ChangeLog.gimple-classes | 13 +++++++++++++
gcc/gimple.c | 4 ++--
gcc/gimple.h | 2 +-
gcc/tree-inline.c | 6 +++---
4 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes
index 56fe40d..e064bcf 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,18 @@
2014-10-24 David Malcolm <dmalcolm@redhat.com>
+ Concretize gimple_call_arg_flags
+
+ * gimple.h (gimple_call_arg_flags): Require a const_gimple_call
+ rather than a const_gimple.
+
+ * gimple.c (gimple_call_fnspec): Likewise.
+ (gimple_call_arg_flags): Likewise.
+
+ * tree-inline.c (remap_gimple_stmt): Use a dyn_cast rather than a
+ is_gimple_call and repeated checked casts.
+
+2014-10-24 David Malcolm <dmalcolm@redhat.com>
+
Concretize gimple_call_set_tail and gimple_call_tail_p
* gimple.h (gimple_call_set_tail): Require a gimple_call.
diff --git a/gcc/gimple.c b/gcc/gimple.c
index a244617..73aa6c1 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -1367,7 +1367,7 @@ gimple_call_flags (const_gimple stmt)
/* Return the "fn spec" string for call STMT. */
static const_tree
-gimple_call_fnspec (const_gimple stmt)
+gimple_call_fnspec (const_gimple_call stmt)
{
tree type, attr;
@@ -1388,7 +1388,7 @@ gimple_call_fnspec (const_gimple stmt)
/* Detects argument flags for argument number ARG on call STMT. */
int
-gimple_call_arg_flags (const_gimple stmt, unsigned arg)
+gimple_call_arg_flags (const_gimple_call stmt, unsigned arg)
{
const_tree attr = gimple_call_fnspec (stmt);
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 9d09804..a396ec3 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -1373,7 +1373,7 @@ bool empty_body_p (gimple_seq);
gimple_seq gimple_seq_copy (gimple_seq);
bool gimple_call_same_target_p (const_gimple, const_gimple);
int gimple_call_flags (const_gimple);
-int gimple_call_arg_flags (const_gimple, unsigned);
+int gimple_call_arg_flags (const_gimple_call, unsigned);
int gimple_call_return_flags (const_gimple_call);
bool gimple_assign_copy_p (gimple);
bool gimple_assign_ssa_name_copy_p (gimple);
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 84dfea8..a0a299b 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1548,9 +1548,9 @@ remap_gimple_stmt (gimple stmt, copy_body_data *id)
copy = gimple_copy (stmt);
/* Clear flags that need revisiting. */
- if (is_gimple_call (copy)
- && gimple_call_tail_p (as_a <gimple_call> (copy)))
- gimple_call_set_tail (as_a <gimple_call> (copy), false);
+ if (gimple_call call_stmt = dyn_cast <gimple_call> (copy))
+ if (gimple_call_tail_p (call_stmt))
+ gimple_call_set_tail (call_stmt, false);
/* Remap the region numbers for __builtin_eh_{pointer,filter},
RESX and EH_DISPATCH. */
--
1.8.5.3