fehler76: assertion when converting float constant to int
[libfirm] / ir / tr / entity.c
index 248fdcb..3b9f828 100644 (file)
@@ -143,6 +143,7 @@ new_rd_entity(dbg_info *db, ir_type *owner, ident *name, ir_type *type)
        res->allocation           = allocation_automatic;
        res->visibility           = visibility_local;
        res->volatility           = volatility_non_volatile;
+       res->align                = align_is_aligned;
        res->stickyness           = stickyness_unsticky;
        res->peculiarity          = peculiarity_existent;
        res->address_taken        = ir_address_taken_unknown;
@@ -481,7 +482,7 @@ void
        _set_entity_volatility(ent, vol);
 }  /* set_entity_volatility */
 
-/* return the name of the volatility */
+/* Return the name of the volatility. */
 const char *get_volatility_name(ir_volatility var)
 {
 #define X(a)    case a: return #a
@@ -493,6 +494,28 @@ const char *get_volatility_name(ir_volatility var)
 #undef X
 }  /* get_volatility_name */
 
+ir_align
+(get_entity_align)(const ir_entity *ent) {
+       return _get_entity_align(ent);
+}  /* get_entity_align */
+
+void
+(set_entity_align)(ir_entity *ent, ir_align a) {
+       _set_entity_align(ent, a);
+}  /* set_entity_align */
+
+/* Return the name of the alignment. */
+const char *get_align_name(ir_align a)
+{
+#define X(a)    case a: return #a
+       switch (a) {
+       X(align_non_aligned);
+       X(align_is_aligned);
+       default: return "BAD VALUE";
+       }
+#undef X
+}  /* get_align_name */
+
 ir_peculiarity
 (get_entity_peculiarity)(const ir_entity *ent) {
        return _get_entity_peculiarity(ent);
@@ -832,7 +855,8 @@ static int equal_paths(compound_graph_path *path1, int *visited_indices, compoun
  * Returns the position of a value with the given path.
  * The path must contain array indices for all array element entities.
  *
- * @todo  This implementation is very low and should be replaced when the new tree oriented
+ * @todo  This implementation is very slow (O(number of initializers^2) and should
+ *        be replaced when the new tree oriented
  *        value representation is finally implemented.
  */
 static int get_compound_ent_pos_by_path(ir_entity *ent, compound_graph_path *path) {