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
- Cc: David Malcolm <dmalcolm at redhat dot com>
- Date: Thu, 29 Aug 2013 12:20:14 -0400
- Subject: [PATCH 4/6] Implement is_a_helper <>::test specializations for various gimple types
- Authentication-results: sourceware.org; auth=none
- References: <1377793216-22549-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 43573a1..e2cd383 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -1722,6 +1722,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. */
@@ -1731,6 +1746,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