more handling for compound graph path ,
[libfirm] / ir / tr / entity_t.h
index 41309a7..8d37f80 100644 (file)
 # define _ENTITY_T_H_
 
 #include "firm_common_t.h"
+#include "firm_config.h"
 
 # include "entity.h"
 # include "typegmod.h"
 # include "mangle.h"
+# include "pseudo_irg.h"
 
 
 /** A path in a compund graph. */
@@ -50,10 +52,10 @@ struct compound_graph_path {
   firm_kind kind;       /**< dynamic type tag for compound graph path. */
   type *tp;             /**< The type this path belongs to. */
   int len;              /**< length of the path */
-  int *arr_indicees;    /**< List of array indicees.  To compute position of
-                 array elements */
+  int *arr_indicees;    /**< List of array indeces.  To compute position of
+                          array elements */
   entity *nodes[1];     /**< List of entities of length len to express the
-                 access path. */
+                          access path. */
 };
 
 /** the type of an entity */
@@ -62,7 +64,7 @@ struct entity {
   ident *name;          /**< name of this entity */
   ident *ld_name;       /**< Unique name of this entity, i.e., the mangled
                            name.  If the field is read before written a default
-                           magling is applies.  The name of the owner is prepended
+                           mangling is applies.  The name of the owner is prepended
                            to the name of the entity, separated by a underscore.
                            E.g.,  for a class `A' with field `a' this
                            is the ident for `A_a'. */
@@ -112,8 +114,7 @@ struct entity {
 
 #ifdef DEBUG_libfirm
   int nr;             /**< a unique node number for each node to make output
-             readable. */
-  char *c_name;                 /**< Since idents are ipaque, provide the name in cleartext */
+                           readable. */
 # endif /* DEBUG_libfirm */
 };
 
@@ -219,13 +220,17 @@ __get_entity_peculiarity(const entity *ent) {
 }
 
 /**
- * @todo why peculiarity only for methods
+ * @todo Why peculiarity only for methods?
+ *       Good question.  Originally, there were only description and
+ *       existent.  The thought was, what sense does it make to
+ *       describe a field?  With inherited the situation changed.  So
+ *       I removed the assertion.  GL, 28.2.05
  */
 static INLINE void
 __set_entity_peculiarity(entity *ent, peculiarity pec) {
   assert(ent && ent->kind == k_entity);
   /* @@@ why peculiarity only for methods? */
-  assert(is_method_type(ent->type));
+  //assert(is_Method_type(ent->type));
 
   ent->peculiarity = pec;
 }
@@ -283,7 +288,9 @@ __set_entity_link(entity *ent, void *l) {
 static INLINE ir_graph *
 __get_entity_irg(const entity *ent) {
   assert(ent && ent->kind == k_entity);
-  assert(ent == unknown_entity || is_method_type(ent->type));
+  assert(ent == unknown_entity || is_Method_type(ent->type));
+  if (!get_visit_pseudo_irgs() && ent->irg && is_pseudo_ir_graph(ent->irg))
+    return NULL;
   return ent->irg;
 }