Added name getting methods for variability and allocation
authorSebastian Hack <hack@ipd.info.uni-karlsruhe.de>
Wed, 2 Jul 2003 08:54:45 +0000 (08:54 +0000)
committerSebastian Hack <hack@ipd.info.uni-karlsruhe.de>
Wed, 2 Jul 2003 08:54:45 +0000 (08:54 +0000)
[r1428]

ir/tr/entity.c
ir/tr/entity.h

index 1dfef15..8d52c28 100644 (file)
@@ -279,6 +279,20 @@ set_entity_allocation (entity *ent, ent_allocation al) {
   ent->allocation = al;
 }
 
+/* return the name of the visibility */
+const char *get_allocation_name(ent_allocation all)
+{
+#define X(a)   case a: return #a
+  switch (all) {
+    X(automatic_allocated);
+    X(parameter_allocated);
+    X(dynamic_allocated);
+    X(static_allocated);
+    default: return "BAD VALUE";
+  }
+#undef X
+}
+
 
 INLINE ent_visibility
 get_entity_visibility (entity *ent) {
@@ -295,6 +309,19 @@ set_entity_visibility (entity *ent, ent_visibility vis) {
   ent->visibility = vis;
 }
 
+/* return the name of the visibility */
+const char *get_visibility_name(ent_visibility vis)
+{
+#define X(a)   case a: return #a
+  switch (vis) {
+    X(local);
+    X(external_visible);
+    X(external_allocated);
+    default: return "BAD VALUE";
+  }
+#undef X
+}
+
 INLINE ent_variability
 get_entity_variability (entity *ent) {
   return ent->variability;
index d180c7f..8f5dfbb 100644 (file)
@@ -224,6 +224,9 @@ ent_allocation get_entity_allocation (entity *ent);
 /** Sets the allocation type of an entity. */
 void           set_entity_allocation (entity *ent, ent_allocation al);
 
+/** Return the name of the visibility */
+const char *get_allocation_name(ent_allocation vis);
+
 /**
  * This enumeration flags the visibility of entities.  This is necessary
  * for partial compilation.
@@ -245,6 +248,9 @@ ent_visibility get_entity_visibility (entity *ent);
 /** Sets the visibility of an entity. */
 void           set_entity_visibility (entity *ent, ent_visibility vis);
 
+/** Return the name of the visibility */
+const char *get_visibility_name(ent_visibility vis);
+
 /** This enumeration flags the variability of entities. */
 typedef enum {
   uninitialized,    /**< The content of the entity is completely unknown. */