recognize dummy loads
authorFlorian Liekweg <liekweg@ipd.info.uni-karlsruhe.de>
Fri, 26 Nov 2004 15:59:14 +0000 (15:59 +0000)
committerFlorian Liekweg <liekweg@ipd.info.uni-karlsruhe.de>
Fri, 26 Nov 2004 15:59:14 +0000 (15:59 +0000)
[r4479]

ir/ana2/pto_util.c
ir/ana2/pto_util.h

index 03c4b7c..7b1461d 100644 (file)
 # include "pto_debug.h"
 
 /* Local Defines: */
+# ifndef TRUE
+#  define TRUE 1
+#  define FALSE 0
+# endif /* not defined TRUE */
 
 /* Local Data Types: */
 /* Environment for find_irg_args */
@@ -92,12 +96,16 @@ ir_node **find_irg_args (ir_graph *graph)
 
   return (args);
 }
+
 /* Get the entity of a ptr */
 entity *get_ptr_ent (ir_node *ptr)
 {
   entity *ent = NULL;
   const opcode ptr_op = get_irn_opcode (ptr);
   switch (ptr_op) {
+  case (iro_Cast): {
+    ent = get_ptr_ent (get_Cast_op (ptr));
+  } break;
   case (iro_Sel): {
     ent = get_Sel_entity (ptr);
   } break;
@@ -118,11 +126,34 @@ entity *get_ptr_ent (ir_node *ptr)
   return (ent);
 }
 
+/* Check whether the load of the given ptr is a dummy */
+int is_dummy_load_ptr (ir_node *ptr)
+{
+  const opcode ptr_op = get_irn_opcode (ptr);
+
+  switch (ptr_op) {
+  case (iro_Cast): {
+    return (is_dummy_load_ptr (get_Cast_op (ptr)));
+  } break;
+  case (iro_Sel):
+  case (iro_SymConst): {
+    return (FALSE);
+  } break;
+
+  default: {
+    return (TRUE);
+  }
+  }
+}
+
 
 
 \f
 /*
   $Log$
+  Revision 1.8  2004/11/26 15:59:14  liekweg
+  recognize dummy loads
+
   Revision 1.7  2004/11/24 14:53:56  liekweg
   Bugfixes
 
index 457c547..0ad2b7e 100644 (file)
@@ -37,6 +37,9 @@ entity *get_ptr_ent (ir_node*);
   result array has 'n+1' entries, the last of which is written NULL. */
 ir_node **find_irg_args (ir_graph*);
 
+/* Check whether the load of the given ptr is a dummy */
+int is_dummy_load_ptr (ir_node*);
+
 /* ===================================================
    Global Variables:
    =================================================== */
@@ -48,6 +51,9 @@ ir_node **find_irg_args (ir_graph*);
 \f
 /*
   $Log$
+  Revision 1.6  2004/11/26 15:59:14  liekweg
+  recognize dummy loads
+
   Revision 1.5  2004/11/24 14:53:56  liekweg
   Bugfixes