This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 4/6] Implement is_a_helper <>::test specializations for various gimple types
- From: David Malcolm <dmalcolm at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, Andrew MacLeod <amacleod at redhat dot com>
- Cc: David Malcolm <dmalcolm at redhat dot com>
- Date: Thu, 31 Oct 2013 12:26:39 -0400
- Subject: [PATCH 4/6] Implement is_a_helper <>::test specializations for various gimple types
- Authentication-results: sourceware.org; auth=none
- References: <5271CBF9 dot 2070005 at redhat dot com> <1383236801-13234-1-git-send-email-dmalcolm at redhat dot com>
* gimple.h (is_a_helper <const gimple_statement_with_ops>::test): New.
(is_a_helper <gimple_statement_with_ops>::test): New.
(is_a_helper <const gimple_statement_with_memory_ops>::test): New.
(is_a_helper <gimple_statement_with_memory_ops>::test): New.
---
gcc/gimple.h | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/gcc/gimple.h b/gcc/gimple.h
index f258992..710ce04 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -1756,6 +1756,21 @@ gimple_has_ops (const_gimple g)
return gimple_code (g) >= GIMPLE_COND && gimple_code (g) <= GIMPLE_RETURN;
}
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_with_ops>::test (const_gimple gs)
+{
+ return gimple_has_ops (gs);
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_with_ops>::test (gimple gs)
+{
+ return gimple_has_ops (gs);
+}
/* Return true if GIMPLE statement G has memory operands. */
@@ -1765,6 +1780,21 @@ gimple_has_mem_ops (const_gimple g)
return gimple_code (g) >= GIMPLE_ASSIGN && gimple_code (g) <= GIMPLE_RETURN;
}
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_with_memory_ops>::test (const_gimple gs)
+{
+ return gimple_has_mem_ops (gs);
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_with_memory_ops>::test (gimple gs)
+{
+ return gimple_has_mem_ops (gs);
+}
/* Return the set of USE operands for statement G. */
--
1.7.11.7