+int (entity_not_visited)(ir_entity *ent) {
+ return _entity_not_visited(ent);
+} /* entity_not_visited */
+
+/* Returns the mask of the additional entity properties. */
+unsigned get_entity_additional_properties(ir_entity *ent) {
+ ir_graph *irg;
+
+ assert(is_method_entity(ent));
+
+ /* first check, if the graph has additional properties */
+ irg = get_entity_irg(ent);
+
+ if (irg)
+ return get_irg_additional_properties(irg);
+
+ if (ent->attr.mtd_attr.irg_add_properties & mtp_property_inherited)
+ return get_method_additional_properties(get_entity_type(ent));
+
+ return ent->attr.mtd_attr.irg_add_properties;
+} /* get_entity_additional_properties */
+
+/* Sets the mask of the additional graph properties. */
+void set_entity_additional_properties(ir_entity *ent, unsigned property_mask)
+{
+ ir_graph *irg;
+
+ assert(is_method_entity(ent));
+
+ /* first check, if the graph exists */
+ irg = get_entity_irg(ent);
+ if (irg)
+ set_irg_additional_properties(irg, property_mask);
+ else {
+ /* do not allow to set the mtp_property_inherited flag or
+ * the automatic inheritance of flags will not work */
+ ent->attr.mtd_attr.irg_add_properties = property_mask & ~mtp_property_inherited;
+ }
+} /* set_entity_additional_properties */
+
+/* Sets one additional graph property. */
+void set_entity_additional_property(ir_entity *ent, mtp_additional_property flag)
+{
+ ir_graph *irg;
+
+ assert(is_method_entity(ent));
+
+ /* first check, if the graph exists */
+ irg = get_entity_irg(ent);
+ if (irg)
+ set_irg_additional_property(irg, flag);
+ else {
+ unsigned mask = ent->attr.mtd_attr.irg_add_properties;
+
+ if (mask & mtp_property_inherited)
+ mask = get_method_additional_properties(get_entity_type(ent));
+
+ /* do not allow to set the mtp_property_inherited flag or
+ * the automatic inheritance of flags will not work */
+ ent->attr.mtd_attr.irg_add_properties = mask | (flag & ~mtp_property_inherited);
+ }
+} /* set_entity_additional_property */
+
+/* Returns the class type that this type info entity represents or NULL
+ if ent is no type info entity. */
+ir_type *(get_entity_repr_class)(const ir_entity *ent) {
+ return _get_entity_repr_class(ent);
+} /* get_entity_repr_class */
+
+dbg_info *(get_entity_dbg_info)(const ir_entity *ent) {
+ return _get_entity_dbg_info(ent);
+} /* get_entity_dbg_info */
+
+void (set_entity_dbg_info)(ir_entity *ent, dbg_info *db) {
+ _set_entity_dbg_info(ent, db);
+} /* set_entity_dbg_info */
+
+/* Initialize entity module. */
+void firm_init_entity(void)
+{
+ symconst_symbol sym;
+
+ assert(firm_unknown_type && "Call init_type() before firm_init_entity()!");
+ assert(!unknown_entity && "Call firm_init_entity() only once!");
+
+ unknown_entity = new_rd_entity(NULL, firm_unknown_type, new_id_from_str(UNKNOWN_ENTITY_NAME), firm_unknown_type);
+ set_entity_visibility(unknown_entity, visibility_external_allocated);
+ set_entity_ld_ident(unknown_entity, get_entity_ident(unknown_entity));
+
+ current_ir_graph = get_const_code_irg();
+ sym.entity_p = unknown_entity;
+ /* TODO: we need two unknown_entities here, one for code and one for data */
+ unknown_entity->value = new_SymConst(mode_P_data, sym, symconst_addr_ent);
+} /* firm_init_entity */