Patchwork [MELT] add primitive isnull_tree

login
register
mail settings
Submitter Pierre Vittet
Date Aug. 30, 2011, 8:54 a.m.
Message ID <4E5CA559.804@pvittet.com>
Download mbox | patch
Permalink /patch/112208/
State New
Headers show

Comments

Pierre Vittet - Aug. 30, 2011, 8:54 a.m.
Hello,

This is a small patch adding primitive isnull_tree (as there is already
a primitive isnull_basicblock).

Pierre Vittet

2011-08-30  Pierre Vittet  <piervit@pvittet.com>

	* melt/xtramelt-ana-base.melt(isnull_tree): Add primitive.

Patch

Index: gcc/melt/xtramelt-ana-base.melt
===================================================================
--- gcc/melt/xtramelt-ana-base.melt	(révision 178282)
+++ gcc/melt/xtramelt-ana-base.melt	(copie de travail)
@@ -1447,12 +1447,15 @@ 
 
 (defprimitive gimpleseq_content (v) :gimple_seq
   #{(melt_gimpleseq_content((melt_ptr_t)($v)))}# )
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-
-
 (defprimitive is_tree (v) :long
   #{(melt_magic_discr((melt_ptr_t)($v)) == MELTOBMAG_TREE)}# )
 
+(defprimitive isnull_tree (:tree tr) :long
+  #{$tr == (tree)0}#
+)
+
 (defprimitive make_tree (discr :tree g) :value
   #{(meltgc_new_tree((meltobject_ptr_t)($discr),($g)))}# )
 
@@ -3597,7 +3600,8 @@  and discriminant $DIS, usually $DISCR_MIXED_LOCATI
  is_mapgimple 
  is_maploop
  is_maptree
- is_tree  
+ is_tree
+ isnull_tree
  isnull_basicblock
  loop_body_tuple
  loop_can_be_parallel