string independent test.
authorGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Wed, 13 Aug 2003 07:43:13 +0000 (07:43 +0000)
committerGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Wed, 13 Aug 2003 07:43:13 +0000 (07:43 +0000)
[r1658]

ir/ir/irgraph.c
ir/ir/irgraph.h

index 8e9125a..e39554b 100644 (file)
@@ -396,6 +396,7 @@ get_irg_frame_type (ir_graph *irg)
 void
 set_irg_frame_type (ir_graph *irg, type *ftp)
 {
+  assert(is_class_type(ftp));
   irg->frame_type = ftp;
 }
 
@@ -403,9 +404,14 @@ set_irg_frame_type (ir_graph *irg, type *ftp)
 /* To test for a frame type */
 int
 is_frame_type(type *ftp) {
-  return ((is_class_type(ftp) || is_struct_type(ftp)) &&
-         id_is_suffix(id_from_str(FRAME_TP_SUFFIX, strlen(FRAME_TP_SUFFIX)),
-                      get_type_ident(ftp)));
+  int i;
+  if (is_class_type(ftp)) {
+    for (i = 0; i < get_irp_n_irgs(); i++) {
+      type *frame_tp = get_irg_frame_type(get_irp_irg(i));
+      if (ftp == frame_tp) return true;
+    }
+  }
+  return false;
 }
 
 int
index b61f09a..1a21a6c 100644 (file)
@@ -117,8 +117,8 @@ void     set_irg_ent (ir_graph *irg, entity *ent);
 
 type    *get_irg_frame_type (ir_graph *irg);
 void     set_irg_frame_type (ir_graph *irg, type *ftp);
-/* To test for a frame type */
-int      is_frame_type(type *ftp);
+/* To test for a frame type. O(#irgs) if ftp is class type.  */
+int      is_frame_type (type *ftp);
 
 ir_node *get_irg_start_block (ir_graph *irg);
 void     set_irg_start_block (ir_graph *irg, ir_node *node);