Patchwork [4/6] Implement is_a_helper <>::test specializations for various gimple types

login
register
mail settings
Submitter David Malcolm
Date Aug. 29, 2013, 4:20 p.m.
Message ID <1377793216-22549-5-git-send-email-dmalcolm@redhat.com>
Download mbox | patch
Permalink /patch/270879/
State New
Headers show

Comments

David Malcolm - Aug. 29, 2013, 4:20 p.m.
* 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(+)

Patch

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.  */