/* All this is needed to build the constant node for methods: */
# include "irprog_t.h"
# include "ircons.h"
+# include "tv_t.h"
/*******************************************************************/
/** general **/
res->variability = constant;
rem = current_ir_graph;
current_ir_graph = get_const_code_irg();
- res->value = new_Const(mode_P, tarval_P_from_entity(res));
+ res->value = new_Const(mode_P, new_tarval_from_entity(res, mode_P));
current_ir_graph = rem;
} else {
res->variability = uninitialized;
+ res->value = NULL;
+ res->values = NULL;
}
res->peculiarity = existent;
res->volatility = non_volatile;
void
free_entity (entity *ent) {
- free_tv_entity(ent);
+ free_tarval_entity(ent);
free_entity_attrs(ent);
free(ent);
}
if (vis != local)
assert((ent->allocation == static_allocated) ||
(ent->allocation == automatic_allocated));
- // @@@ Test that the owner type is not local, but how??
- // && get_class_visibility(get_entity_owner(ent)) != local));
+ /* @@@ Test that the owner type is not local, but how??
+ && get_class_visibility(get_entity_owner(ent)) != local));*/
ent->visibility = vis;
}
ent->variability = var;
}
+/* return the name of the variablity */
+const char *get_variability_name(ent_variability var)
+{
+#define X(a) case a: return #a
+ switch (var) {
+ X(uninitialized);
+ X(initialized);
+ X(part_constant);
+ X(constant);
+ default: return "BAD VALUE";
+ }
+#undef X
+}
INLINE ent_volatility
get_entity_volatility (entity *ent) {
ent->volatility = vol;
}
+/* return the name of the volatility */
+const char *get_volatility_name(ent_volatility var)
+{
+#define X(a) case a: return #a
+ switch (var) {
+ X(non_volatile);
+ X(is_volatile);
+ default: return "BAD VALUE";
+ }
+#undef X
+}
+
INLINE peculiarity
get_entity_peculiarity (entity *ent) {
assert (ent);
ent->peculiarity = pec;
}
+/* return the name of the peculiarity */
+const char *get_peculiarity_name(peculiarity var)
+{
+#define X(a) case a: return #a
+ switch (var) {
+ X(description);
+ X(inherited);
+ X(existent);
+ default: return "BAD VALUE";
+ }
+#undef X
+}
+
/* Set has no effect for entities of type method. */
INLINE ir_node *
get_atomic_ent_value(entity *ent) {
case iro_Add:
nn = new_Add(copy_const_value(get_Add_left(n)), copy_const_value(get_Add_right(n)), m); break;
default:
- assert(0 && "opdope invalid or not implemented"); break;
+ assert(0 && "opdope invalid or not implemented");
+ nn=NULL;
+ break;
}
return nn;
}
current_ir_graph = get_const_code_irg();
for (i = 0; i < num_vals; i++) {
- val = new_Const(get_tv_mode (values[i]), values[i]);
+ val = new_Const(get_tarval_mode (values[i]), values[i]);
add_compound_ent_value(ent, val, get_array_element_entity(arrtp));
}
current_ir_graph = rem;