libFirm
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
typerep.h
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2012 University of Karlsruhe.
4  */
5 
10 #ifndef FIRM_TYPEREP_H
11 #define FIRM_TYPEREP_H
12 
13 #include <stddef.h>
14 
15 #include "firm_types.h"
16 
17 #include "begin.h"
18 
79 typedef enum {
114 } ir_visibility;
115 
119 typedef enum ir_linkage {
134  IR_LINKAGE_WEAK = 1 << 1,
171 } ir_linkage;
172 ENUM_BITSET(ir_linkage)
173 
174 
177 FIRM_API ir_visibility get_entity_visibility(const ir_entity *entity);
178 
182 FIRM_API void set_entity_visibility(ir_entity *entity, ir_visibility visibility);
183 
192 FIRM_API int entity_is_externally_visible(const ir_entity *entity);
193 
199 FIRM_API int entity_has_definition(const ir_entity *entity);
200 
209 FIRM_API ir_entity *new_entity(ir_type *owner, ident *name, ir_type *tp);
210 
214 FIRM_API ir_entity *new_global_entity(ir_type *segment, ident *ld_name,
215  ir_type *type, ir_visibility visibility,
216  ir_linkage linkage);
217 
222 FIRM_API ir_entity *new_parameter_entity(ir_type *owner, size_t pos,
223  ir_type *type);
224 
240 FIRM_API ir_entity *new_alias_entity(ir_type *owner, ident *name,
241  ir_entity *alias, ir_type *type,
242  ir_visibility visibility);
243 
247 FIRM_API void set_entity_alias(ir_entity *alias, ir_entity *aliased);
248 
252 FIRM_API ir_entity *get_entity_alias(const ir_entity *alias);
253 
259 FIRM_API int check_entity(const ir_entity *ent);
260 
269 FIRM_API ir_entity *copy_entity_own(ir_entity *old, ir_type *new_owner);
270 
279 FIRM_API ir_entity *copy_entity_name(ir_entity *old, ident *new_name);
280 
287 FIRM_API void free_entity(ir_entity *ent);
288 
290 FIRM_API const char *get_entity_name(const ir_entity *ent);
291 
293 FIRM_API ident *get_entity_ident(const ir_entity *ent);
294 
296 FIRM_API void set_entity_ident(ir_entity *ent, ident *id);
297 
304 FIRM_API ident *get_entity_ld_ident(const ir_entity *ent);
305 
307 FIRM_API void set_entity_ld_ident(ir_entity *ent, ident *ld_ident);
308 
310 FIRM_API const char *get_entity_ld_name(const ir_entity *ent);
311 
313 FIRM_API int entity_has_ld_ident(const ir_entity *entity);
314 
316 FIRM_API ir_type *get_entity_owner(const ir_entity *ent);
317 
323 FIRM_API void set_entity_owner(ir_entity *ent, ir_type *owner);
324 
326 FIRM_API ir_type *get_entity_type(const ir_entity *ent);
327 
329 FIRM_API void set_entity_type(ir_entity *ent, ir_type *tp);
330 
332 FIRM_API ir_linkage get_entity_linkage(const ir_entity *entity);
333 
335 FIRM_API void set_entity_linkage(ir_entity *entity, ir_linkage linkage);
337 FIRM_API void add_entity_linkage(ir_entity *entity, ir_linkage linkage);
339 FIRM_API void remove_entity_linkage(ir_entity *entity, ir_linkage linkage);
340 
345 FIRM_API ir_volatility get_entity_volatility(const ir_entity *ent);
346 
351 FIRM_API void set_entity_volatility(ir_entity *ent, ir_volatility vol);
352 
354 FIRM_API const char *get_volatility_name(ir_volatility var);
355 
357 FIRM_API unsigned get_entity_alignment(const ir_entity *entity);
358 
363 FIRM_API void set_entity_alignment(ir_entity *entity, unsigned alignment);
364 
369 FIRM_API ir_align get_entity_aligned(const ir_entity *ent);
370 
375 FIRM_API void set_entity_aligned(ir_entity *ent, ir_align a);
376 
378 FIRM_API const char *get_align_name(ir_align a);
379 
382 FIRM_API int get_entity_offset(const ir_entity *entity);
383 
385 FIRM_API void set_entity_offset(ir_entity *entity, int offset);
386 
388 FIRM_API unsigned get_entity_bitfield_offset(const ir_entity *entity);
389 
391 FIRM_API void set_entity_bitfield_offset(ir_entity *entity, unsigned offset);
392 
394 FIRM_API void set_entity_bitfield_size(ir_entity *entity, unsigned size);
395 
397 FIRM_API unsigned get_entity_bitfield_size(const ir_entity *entity);
398 
400 FIRM_API void *get_entity_link(const ir_entity *ent);
401 
403 FIRM_API void set_entity_link(ir_entity *ent, void *l);
404 
411 FIRM_API ir_graph *get_entity_irg(const ir_entity *ent);
412 
419 FIRM_API ir_graph *get_entity_linktime_irg(const ir_entity *ent);
420 
422 #define IR_VTABLE_NUM_NOT_SET ((unsigned)(-1))
423 
425 FIRM_API unsigned get_entity_vtable_number(const ir_entity *ent);
426 
428 FIRM_API void set_entity_vtable_number(ir_entity *ent, unsigned vtable_number);
429 
431 FIRM_API void set_entity_label(ir_entity *ent, ir_label_t label);
433 FIRM_API ir_label_t get_entity_label(const ir_entity *ent);
434 
438 typedef enum {
441  ir_usage_write = 1 << 1,
442  ir_usage_read = 1 << 2,
450 
452 FIRM_API ir_entity_usage get_entity_usage(const ir_entity *ent);
453 
455 FIRM_API void set_entity_usage(ir_entity *ent, ir_entity_usage flag);
456 
462 FIRM_API dbg_info *get_entity_dbg_info(const ir_entity *ent);
463 
470 FIRM_API void set_entity_dbg_info(ir_entity *ent, dbg_info *db);
471 
480 #define IR_VA_START_PARAMETER_NUMBER ((size_t)-1)
481 
486 FIRM_API int is_parameter_entity(const ir_entity *entity);
487 
491 FIRM_API size_t get_entity_parameter_number(const ir_entity *entity);
492 
496 FIRM_API void set_entity_parameter_number(ir_entity *entity, size_t n);
497 
499 FIRM_API ir_node *get_atomic_ent_value(const ir_entity *ent);
502 FIRM_API void set_atomic_ent_value(ir_entity *ent, ir_node *val);
503 
509 typedef enum ir_initializer_kind_t {
519 
521 FIRM_API ir_initializer_kind_t get_initializer_kind(const ir_initializer_t *initializer);
522 
524 FIRM_API const char *get_initializer_kind_name(ir_initializer_kind_t ini);
525 
529 FIRM_API ir_initializer_t *get_initializer_null(void);
530 
536 
539 
541 FIRM_API ir_node *get_initializer_const_value(const ir_initializer_t *initializer);
542 
544 FIRM_API ir_tarval *get_initializer_tarval_value(const ir_initializer_t *initialzier);
545 
547 FIRM_API ir_initializer_t *create_initializer_compound(size_t n_entries);
548 
550 FIRM_API size_t get_initializer_compound_n_entries(const ir_initializer_t *initializer);
551 
553 FIRM_API void set_initializer_compound_value(ir_initializer_t *initializer,
554  size_t index,
555  ir_initializer_t *value);
556 
559  const ir_initializer_t *initializer, size_t index);
560 
564 FIRM_API void set_entity_initializer(ir_entity *entity, ir_initializer_t *initializer);
565 
567 FIRM_API ir_initializer_t *get_entity_initializer(const ir_entity *entity);
568 
570 FIRM_API void add_entity_overwrites(ir_entity *ent, ir_entity *overwritten);
573 FIRM_API size_t get_entity_n_overwrites(const ir_entity *ent);
576 FIRM_API size_t get_entity_overwrites_index(const ir_entity *ent,
577  ir_entity *overwritten);
579 FIRM_API ir_entity *get_entity_overwrites(const ir_entity *ent, size_t pos);
581 FIRM_API void set_entity_overwrites(ir_entity *ent, size_t pos,
582  ir_entity *overwritten);
584 FIRM_API void remove_entity_overwrites(ir_entity *ent, ir_entity *overwritten);
585 
587 FIRM_API size_t get_entity_n_overwrittenby(const ir_entity *ent);
590 FIRM_API size_t get_entity_overwrittenby_index(const ir_entity *ent,
591  ir_entity *overwrites);
593 FIRM_API ir_entity *get_entity_overwrittenby(const ir_entity *ent, size_t pos);
595 FIRM_API void set_entity_overwrittenby(ir_entity *ent, size_t pos,
596  ir_entity *overwrites);
598 FIRM_API void remove_entity_overwrittenby(ir_entity *ent,
599  ir_entity *overwrites);
600 
606 FIRM_API int is_atomic_entity(const ir_entity *ent);
609 FIRM_API int is_compound_entity(const ir_entity *ent);
611 FIRM_API int is_method_entity(const ir_entity *ent);
613 FIRM_API int is_alias_entity(const ir_entity *ent);
614 
619 FIRM_API long get_entity_nr(const ir_entity *ent);
620 
623 FIRM_API ir_visited_t get_entity_visited(const ir_entity *ent);
624 
627 FIRM_API void set_entity_visited(ir_entity *ent, ir_visited_t num);
628 
631 FIRM_API void mark_entity_visited(ir_entity *ent);
632 
635 FIRM_API int entity_visited(const ir_entity *ent);
636 
639 FIRM_API int entity_not_visited(const ir_entity *ent);
640 
645 FIRM_API int entity_has_additional_properties(const ir_entity *entity);
646 
655 
659 
663 
698 FIRM_API ir_entity *get_unknown_entity(void);
699 
702 FIRM_API int is_unknown_entity(const ir_entity *entity);
703 
707 typedef enum ptr_access_kind {
708  ptr_access_none = 0,
709  ptr_access_read = 1,
710  ptr_access_write = 2,
711  ptr_access_rw = ptr_access_read|ptr_access_write,
712  ptr_access_store = 4,
713  ptr_access_all = ptr_access_rw|ptr_access_store
714 } ptr_access_kind;
715 ENUM_BITSET(ptr_access_kind)
716 
717 
744 typedef enum tp_opcode {
745  tpo_uninitialized = 0, /* not a type opcode */
756  tpo_last = tpo_unknown /* not a type opcode */
757 } tp_opcode;
758 
762 FIRM_API const char *get_type_opcode_name(tp_opcode opcode);
763 
770 FIRM_API int is_SubClass_of(const ir_type *low, const ir_type *high);
771 
778 FIRM_API int is_SubClass_ptr_of(ir_type *low, ir_type *high);
779 
786 #define is_SuperClass_of(high, low) is_SubClass_of(low, high)
787 
794 #define is_SuperClass_ptr_of(low, high) is_SubClass_ptr_of(high, low)
795 
799 FIRM_API int is_overwritten_by(ir_entity *high, ir_entity *low);
800 
806 FIRM_API ir_entity *resolve_ent_polymorphy(ir_type *dynamic_class,
807  ir_entity* static_ent);
808 
809 /* ----------------------------------------------------------------------- */
810 /* The transitive closure of the subclass/superclass and */
811 /* overwrites/overwrittenby relation. */
812 /* */
813 /* A walk over the ir (O(#types+#entities)) computes the transitive */
814 /* closure. Adding a new type/entity or changing the basic relations in */
815 /* some other way invalidates the transitive closure, i.e., it is not */
816 /* updated by the basic functions. */
817 /* */
818 /* The transitive edges are held in a set, not in an array as the */
819 /* underlying relation. */
820 /* */
821 /* Do the sets contain the node itself? I assume NOT! */
822 /* ----------------------------------------------------------------------- */
823 
827 typedef enum {
833 
843 
849 FIRM_API void compute_inh_transitive_closure(void);
850 
852 FIRM_API void free_inh_transitive_closure(void);
853 
855 FIRM_API ir_type *get_class_trans_subtype_first(const ir_type *tp);
860 FIRM_API ir_type *get_class_trans_subtype_next(const ir_type *tp);
866 FIRM_API int is_class_trans_subtype(const ir_type *tp, const ir_type *subtp);
867 
869 FIRM_API ir_type *get_class_trans_supertype_first(const ir_type *tp);
874 FIRM_API ir_type *get_class_trans_supertype_next(const ir_type *tp);
875 
883 
892 
893 
899 FIRM_API int check_type(const ir_type *tp);
900 
906 FIRM_API int tr_verify(void);
907 
914 FIRM_API void free_type(ir_type *tp);
915 
917 FIRM_API tp_opcode get_type_opcode(const ir_type *type);
918 
928 FIRM_API void ir_print_type(char *buffer, size_t buffer_size,
929  const ir_type *tp);
930 
932 typedef enum {
945 } ir_type_state;
946 
948 FIRM_API const char *get_type_state_name(ir_type_state s);
949 
951 FIRM_API ir_type_state get_type_state(const ir_type *tp);
952 
958 FIRM_API void set_type_state(ir_type *tp, ir_type_state state);
959 
964 FIRM_API ir_mode *get_type_mode(const ir_type *tp);
965 
967 FIRM_API unsigned get_type_size_bytes(const ir_type *tp);
968 
974 FIRM_API void set_type_size_bytes(ir_type *tp, unsigned size);
975 
977 FIRM_API unsigned get_type_alignment_bytes(const ir_type *tp);
978 
980 FIRM_API void set_type_alignment_bytes(ir_type *tp, unsigned align);
981 
984 FIRM_API ir_visited_t get_type_visited(const ir_type *tp);
987 FIRM_API void set_type_visited(ir_type *tp, ir_visited_t num);
990 FIRM_API void mark_type_visited(ir_type *tp);
993 FIRM_API int type_visited(const ir_type *tp);
994 
996 FIRM_API void *get_type_link(const ir_type *tp);
998 FIRM_API void set_type_link(ir_type *tp, void *l);
999 
1002 FIRM_API void inc_master_type_visited(void);
1005 FIRM_API void set_master_type_visited(ir_visited_t val);
1008 FIRM_API ir_visited_t get_master_type_visited(void);
1009 
1016 FIRM_API void set_type_dbg_info(ir_type *tp, type_dbg_info *db);
1017 
1023 FIRM_API type_dbg_info *get_type_dbg_info(const ir_type *tp);
1024 
1030 FIRM_API long get_type_nr(const ir_type *tp);
1031 
1057 FIRM_API ir_type *new_type_class(ident *name);
1058 
1060 FIRM_API ident *get_class_ident(const ir_type *clss);
1061 
1063 FIRM_API const char *get_class_name(const ir_type *clss);
1064 
1066 FIRM_API size_t get_class_n_members(const ir_type *clss);
1067 
1069 FIRM_API ir_entity *get_class_member(const ir_type *clss, size_t pos);
1070 
1075 #define INVALID_MEMBER_INDEX ((size_t)-1)
1076 
1078 FIRM_API size_t get_class_member_index(ir_type const *clss,
1079  ir_entity const *mem);
1080 
1085 FIRM_API void add_class_subtype(ir_type *clss, ir_type *subtype);
1086 
1088 FIRM_API size_t get_class_n_subtypes(const ir_type *clss);
1089 
1091 FIRM_API ir_type *get_class_subtype(const ir_type *clss, size_t pos);
1092 
1097 FIRM_API size_t get_class_subtype_index(const ir_type *clss,
1098  const ir_type *subclass);
1099 
1104 FIRM_API void set_class_subtype(ir_type *clss, ir_type *subtype, size_t pos);
1105 
1107 FIRM_API void remove_class_subtype(ir_type *clss, ir_type *subtype);
1108 
1113 FIRM_API void add_class_supertype(ir_type *clss, ir_type *supertype);
1114 
1116 FIRM_API size_t get_class_n_supertypes(const ir_type *clss);
1117 
1122 FIRM_API size_t get_class_supertype_index(const ir_type *clss,
1123  const ir_type *super_clss);
1124 
1126 FIRM_API ir_type *get_class_supertype(const ir_type *clss, size_t pos);
1127 
1132 FIRM_API void set_class_supertype(ir_type *clss, ir_type *supertype, size_t pos);
1133 
1135 FIRM_API void remove_class_supertype(ir_type *clss, ir_type *supertype);
1136 
1138 FIRM_API int is_Class_type(const ir_type *clss);
1139 
1161 FIRM_API ir_type *new_type_struct(ident *name);
1162 
1164 FIRM_API ident *get_struct_ident(const ir_type *strct);
1165 
1167 FIRM_API const char *get_struct_name(const ir_type *strct);
1168 
1170 FIRM_API size_t get_struct_n_members(const ir_type *strct);
1171 
1173 FIRM_API ir_entity *get_struct_member(const ir_type *strct, size_t pos);
1174 
1176 FIRM_API size_t get_struct_member_index(ir_type const *strct,
1177  ir_entity const *member);
1178 
1180 FIRM_API int is_Struct_type(const ir_type *strct);
1181 
1199 FIRM_API ir_type *new_type_union(ident *name);
1200 
1202 FIRM_API ident *get_union_ident(const ir_type *uni);
1203 
1205 FIRM_API const char *get_union_name(const ir_type *uni);
1206 
1208 FIRM_API size_t get_union_n_members(const ir_type *uni);
1209 
1211 FIRM_API ir_entity *get_union_member(const ir_type *uni, size_t pos);
1212 
1214 FIRM_API size_t get_union_member_index(ir_type const *uni,
1215  ir_entity const *member);
1216 
1218 FIRM_API int is_Union_type(const ir_type *uni);
1219 
1261 FIRM_API ir_type *new_type_method(size_t n_param, size_t n_res);
1262 
1264 FIRM_API size_t get_method_n_params(const ir_type *method);
1265 
1267 FIRM_API ir_type *get_method_param_type(const ir_type *method, size_t pos);
1271 FIRM_API void set_method_param_type(ir_type *method, size_t pos, ir_type *tp);
1273 FIRM_API size_t get_method_n_ress(const ir_type *method);
1275 FIRM_API ir_type *get_method_res_type(const ir_type *method, size_t pos);
1277 FIRM_API void set_method_res_type(ir_type *method, size_t pos, ir_type *tp);
1278 
1280 FIRM_API int is_method_variadic(ir_type const *method);
1281 
1283 FIRM_API void set_method_variadic(ir_type *method, int is_variadic);
1284 
1287 
1289 FIRM_API void set_method_additional_properties(ir_type *method,
1290  mtp_additional_properties property_mask);
1291 
1293 FIRM_API void add_method_additional_properties(ir_type *method,
1295 
1300 typedef enum {
1301  cc_reg_param = 0x01000000,
1303  cc_last_on_top = 0x02000000,
1308  cc_callee_clear_stk = 0x04000000,
1310  cc_this_call = 0x08000000,
1312  cc_compound_ret = 0x10000000,
1313  cc_frame_on_caller_stk = 0x20000000,
1315  cc_fpreg_param = 0x40000000,
1316  cc_bits = (0xFF << 24)
1318 
1320 #define cc_cdecl_set (0)
1321 
1322 #define cc_stdcall_set cc_callee_clear_stk
1323 
1324 #define cc_fastcall_set (cc_reg_param|cc_callee_clear_stk)
1325 
1329 #define IS_CDECL(cc_mask) (((cc_mask) & cc_bits) == cc_cdecl_set)
1330 
1334 #define IS_STDCALL(cc_mask) (((cc_mask) & cc_bits) == cc_stdcall_set)
1335 
1339 #define IS_FASTCALL(cc_mask) (((cc_mask) & cc_bits) == cc_fastcall_set)
1340 
1344 #define SET_CDECL(cc_mask) (((cc_mask) & ~cc_bits) | cc_cdecl_set)
1345 
1349 #define SET_STDCALL(cc_mask) (((cc_mask) & ~cc_bits) | cc_stdcall_set)
1350 
1354 #define SET_FASTCALL(cc_mask) (((cc_mask) & ~cc_bits) | cc_fastcall_set)
1355 
1357 FIRM_API unsigned get_method_calling_convention(const ir_type *method);
1358 
1360 FIRM_API void set_method_calling_convention(ir_type *method, unsigned cc_mask);
1361 
1363 FIRM_API unsigned get_method_n_regparams(ir_type *method);
1364 
1366 FIRM_API void set_method_n_regparams(ir_type *method, unsigned n_regs);
1367 
1369 FIRM_API int is_Method_type(const ir_type *method);
1370 
1384 FIRM_API ir_type *new_type_array(ir_type *element_type);
1385 
1387 FIRM_API void set_array_size(ir_type *array, ir_node *size);
1388 
1390 FIRM_API void set_array_size_int(ir_type *array, unsigned size);
1391 
1393 FIRM_API int has_array_size(const ir_type *array);
1395 FIRM_API ir_node *get_array_size(const ir_type *array);
1397 FIRM_API unsigned get_array_size_int(const ir_type *array);
1398 
1400 FIRM_API void set_array_element_type(ir_type *array, ir_type *tp);
1401 
1403 FIRM_API ir_type *get_array_element_type(const ir_type *array);
1404 
1410 FIRM_API void set_array_variable_size(ir_type *array, int variable_size_flag);
1411 
1416 FIRM_API int is_array_variable_size(const ir_type *array);
1417 
1419 FIRM_API int is_Array_type(const ir_type *array);
1420 
1432 FIRM_API ir_type *new_type_pointer(ir_type *points_to);
1433 
1435 FIRM_API void set_pointer_points_to_type(ir_type *pointer, ir_type *tp);
1436 
1438 FIRM_API ir_type *get_pointer_points_to_type(const ir_type *pointer);
1439 
1441 FIRM_API int is_Pointer_type(const ir_type *pointer);
1442 
1447 
1459 FIRM_API ir_type *new_type_primitive(ir_mode *mode);
1460 
1462 FIRM_API int is_Primitive_type(const ir_type *primitive);
1463 
1470 FIRM_API ir_type *get_code_type(void);
1474 FIRM_API int is_code_type(const ir_type *tp);
1496 FIRM_API ir_type *get_unknown_type(void);
1498 FIRM_API int is_unknown_type(const ir_type *type);
1506 FIRM_API int is_atomic_type(const ir_type *tp);
1507 
1517 FIRM_API ident *get_compound_ident(const ir_type *tp);
1518 
1520 FIRM_API const char *get_compound_name(const ir_type *tp);
1521 
1533 FIRM_API size_t get_compound_n_members(const ir_type *tp);
1534 
1543 FIRM_API ir_entity *get_compound_member(const ir_type *tp, size_t pos);
1544 
1546 FIRM_API size_t get_compound_member_index(ir_type const *tp,
1547  ir_entity const *member);
1548 
1550 FIRM_API void remove_compound_member(ir_type *compound, ir_entity *entity);
1551 
1559 FIRM_API void set_compound_variable_size(ir_type *compound, int variable_size);
1560 
1564 FIRM_API int is_compound_variable_size(const ir_type *compound);
1565 
1569 FIRM_API void default_layout_compound_type(ir_type *tp);
1570 
1578 FIRM_API int is_compound_type(const ir_type *tp);
1579 
1591 FIRM_API ir_type *new_type_frame(void);
1592 
1596 FIRM_API int is_frame_type(const ir_type *tp);
1597 
1603 FIRM_API ir_type *clone_frame_type(ir_type *type);
1604 
1617 FIRM_API ir_entity *frame_alloc_area(ir_type *frame_type, int size,
1618  unsigned alignment, int at_start);
1619 
1629 FIRM_API int is_segment_type(const ir_type *tp);
1630 
1632 FIRM_API ident *get_segment_ident(ir_type const *type);
1633 
1646 typedef int (compare_types_func_t)(const void *tp1, const void *tp2);
1647 
1654 typedef void type_walk_func(ir_type *type, ir_entity *entity, void *env);
1655 
1661 typedef void class_walk_func(ir_type *clss, void *env);
1662 
1667 FIRM_API void type_walk(type_walk_func *pre, type_walk_func *post, void *env);
1668 
1674 FIRM_API void type_walk_irg(ir_graph *irg, type_walk_func *pre,
1675  type_walk_func *post, void *env);
1676 
1686 FIRM_API void type_walk_super2sub(type_walk_func *pre, type_walk_func *post,
1687  void *env);
1688 
1702 FIRM_API void type_walk_super(type_walk_func *pre, type_walk_func *post,
1703  void *env);
1704 
1712 FIRM_API void class_walk_super2sub(class_walk_func *pre, class_walk_func *post,
1713  void *env);
1714 
1721 typedef void entity_walk_func(ir_entity *ent, void *env);
1722 
1730 FIRM_API void walk_types_entities(ir_type *tp, entity_walk_func *doit,
1731  void *env);
1732 
1734 FIRM_API ir_visibility get_type_visibility(const ir_type *tp);
1736 FIRM_API void set_type_visibility(ir_type *tp, ir_visibility v);
1737 
1742 #include "end.h"
1743 
1744 #endif
int is_frame_type(const ir_type *tp)
Checks, whether a type is a frame type.
void remove_class_supertype(ir_type *clss, ir_type *supertype)
Finds supertype in the list of supertypes and removes it.
ir_type * get_method_res_type(const ir_type *method, size_t pos)
Returns the return type of a method type at position pos.
void set_entity_initializer(ir_entity *entity, ir_initializer_t *initializer)
Sets the new style initializers of an entity.
a piece of code (a basic block)
Definition: typerep.h:754
size_t get_compound_member_index(ir_type const *tp, ir_entity const *member)
Returns index of member in tp, -1 if not contained.
ir_node * get_array_size(const ir_type *array)
Returns the size (number of elements) of an array.
ir_entity * new_alias_entity(ir_type *owner, ident *name, ir_entity *alias, ir_type *type, ir_visibility visibility)
Creates a new entity aliasing another entity.
ir_type * get_unknown_type(void)
Returns the unknown type.
type_dbg_info * get_type_dbg_info(const ir_type *tp)
Returns the debug information of a type.
ir_initializer_t * get_initializer_compound_value(const ir_initializer_t *initializer, size_t index)
Returns the value with index index of a compound initializer.
int is_method_entity(const ir_entity *ent)
Returns true if the entity is a method entity.
The entity may be removed when it isn't referenced anywhere in the compilation unit even if it is exp...
Definition: typerep.h:140
int is_SubClass_of(const ir_type *low, const ir_type *high)
Returns true if low is subclass of high.
ir_graph * get_entity_irg(const ir_entity *ent)
Return the method graph of a method entity.
An union type.
Definition: typerep.h:747
void type_walk_func(ir_type *type, ir_entity *entity, void *env)
Type of argument functions for type walkers.
Definition: typerep.h:1654
struct ir_type ir_type
Type.
Definition: firm_types.h:71
struct dbg_info dbg_info
Source Reference.
Definition: firm_types.h:40
void set_entity_bitfield_size(ir_entity *entity, unsigned size)
Sets the size in bits for a bitfield.
size_t get_struct_n_members(const ir_type *strct)
Returns the number of members of this struct.
ir_graph * get_entity_linktime_irg(const ir_entity *ent)
Return the method graph the method entity points to after linking.
ir_type * clone_frame_type(ir_type *type)
Makes a clone of a frame type.
void set_type_alignment_bytes(ir_type *tp, unsigned align)
Sets the alignment of a type in bytes.
int entity_visited(const ir_entity *ent)
Returns true if this entity was visited.
The entity is a weak symbol.
Definition: typerep.h:134
int is_array_variable_size(const ir_type *array)
Returns the array variable size flag.
void set_array_variable_size(ir_type *array, int variable_size_flag)
Sets the array variable size flag.
int is_class_trans_subtype(const ir_type *tp, const ir_type *subtp)
Check if subtp is a subtype of tp.
void type_walk(type_walk_func *pre, type_walk_func *post, void *env)
Touches every type and entity in unspecified order.
const char * get_compound_name(const ir_type *tp)
Returns compound identifier as c-string.
The callee clears the stack.
Definition: typerep.h:1308
dbg_info * get_entity_dbg_info(const ir_entity *ent)
Returns the debug information of an entity.
ir_type * new_type_class(ident *name)
Creates a new class type.
void set_entity_type(ir_entity *ent, ir_type *tp)
Sets the type of an entity.
The address of this entity was taken.
Definition: typerep.h:440
ir_entity * new_parameter_entity(ir_type *owner, size_t pos, ir_type *type)
Creates a new entity corresponding to a function parameter.
union ir_initializer_t ir_initializer_t
Initializer (for entities)
Definition: firm_types.h:89
void remove_entity_overwrites(ir_entity *ent, ir_entity *overwritten)
Remove overwritten from list of entities overwriting entity ent.
ir_visited_t get_master_type_visited(void)
Returns type visited reference counter.
ir_label_t get_entity_label(const ir_entity *ent)
Returns label number of an entity with code type.
ir_entity * get_entity_overwrites(const ir_entity *ent, size_t pos)
Returns entry pos in list of entities overwriting entity ent.
ir_mode * get_type_mode(const ir_type *tp)
Returns the mode of a type.
void set_method_additional_properties(ir_type *method, mtp_additional_properties property_mask)
Sets the mask of the additional graph properties.
ir_entity_usage
Bitfield type indicating the way an entity is used.
Definition: typerep.h:438
ir_type_state
The state of the type layout.
Definition: typerep.h:932
ir_type * get_method_param_type(const ir_type *method, size_t pos)
Returns the type of the parameter at position pos of a method.
const char * get_volatility_name(ir_volatility var)
Returns the name of the volatility.
int entity_not_visited(const ir_entity *ent)
Returns true if this entity was not visited.
ir_entity * frame_alloc_area(ir_type *frame_type, int size, unsigned alignment, int at_start)
Allocate an area of size bytes aligned at alignment at the start or the end of a frame type...
ir_initializer_t * create_initializer_tarval(ir_tarval *tv)
Creates an initializer containing a single tarval value.
void * get_type_link(const ir_type *tp)
Returns the associated link field of a type.
const char * get_type_state_name(ir_type_state s)
Returns a human readable string for the enum entry.
void entity_walk_func(ir_entity *ent, void *env)
the entity walk function.
Definition: typerep.h:1721
unsigned get_array_size_int(const ir_type *array)
Works only if bound is Const node with tarval that can be converted to long.
A primitive type.
Definition: typerep.h:753
The last non-register parameter is transmitted on top of the stack.
Definition: typerep.h:1303
struct ir_graph ir_graph
Procedure Graph.
Definition: firm_types.h:74
The method returns a compound type.
Definition: typerep.h:1312
int tr_verify(void)
Walks the type information and performs a set of sanity checks.
int is_overwritten_by(ir_entity *high, ir_entity *low)
Returns true if high is (transitive) overwritten by low.
A segment type.
Definition: typerep.h:749
int is_parameter_entity(const ir_entity *entity)
returns true if a given entity is a parameter_entity representing the address of a function parameter...
size_t get_class_member_index(ir_type const *clss, ir_entity const *mem)
Returns index of mem in clss, INVALID_MEMBER_INDEX if not contained.
ir_entity * resolve_ent_polymorphy(ir_type *dynamic_class, ir_entity *static_ent)
Resolve polymorphism in the inheritance relation.
tp_opcode
An enum for the type kinds.
Definition: typerep.h:744
size_t get_initializer_compound_n_entries(const ir_initializer_t *initializer)
Returns the number of entries in a compound initializer.
void set_entity_additional_properties(ir_entity *ent, mtp_additional_properties prop)
Sets the mask of the additional graph properties.
Invalid value.
Definition: typerep.h:831
void add_entity_additional_properties(ir_entity *ent, mtp_additional_properties flag)
Sets additional graph properties.
void set_type_dbg_info(ir_type *tp, type_dbg_info *db)
Sets the debug information of a type.
ir_type * get_entity_owner(const ir_entity *ent)
Returns the owner of the entity.
void set_class_supertype(ir_type *clss, ir_type *supertype, size_t pos)
Sets the supertype at position pos, 0 <= pos < n_supertype.
void set_array_element_type(ir_type *array, ir_type *tp)
Sets the array element type.
ir_entity * get_compound_member(const ir_type *tp, size_t pos)
Returns the member of a Firm compound type at position pos.
const char * get_type_opcode_name(tp_opcode opcode)
Returns the name of the type opcode opcode.
The method did not allocate an own stack frame, instead the caller must reserve size on its own stack...
Definition: typerep.h:1313
void set_master_type_visited(ir_visited_t val)
Sets type visited reference counter.
int is_alias_entity(const ir_entity *ent)
Returns true if the entity is an alias entity.
ir_initializer_t * get_initializer_null(void)
Returns the null initializer (there's only one instance of it in a program )
int entity_has_additional_properties(const ir_entity *entity)
Return true if this entity can be queried for additional properties.
The entity was written to.
Definition: typerep.h:441
ir_entity * get_entity_alias(const ir_entity *alias)
Returns the entity aliased by an alias entity.
mtp_additional_properties get_entity_additional_properties(const ir_entity *ent)
Returns the mask of the additional entity properties.
const char * get_entity_name(const ir_entity *ent)
Returns the name of an entity.
int is_Array_type(const ir_type *array)
Returns true if a type is an array type.
struct type_dbg_info type_dbg_info
Source Type Reference.
Definition: firm_types.h:43
The entity is visible across compilation units, but not across modules.
Definition: typerep.h:92
int is_segment_type(const ir_type *tp)
Checks, whether a type is a frame type.
ir_entity * new_global_entity(ir_type *segment, ident *ld_name, ir_type *type, ir_visibility visibility, ir_linkage linkage)
Creates a new global entity.
void set_entity_overwrittenby(ir_entity *ent, size_t pos, ir_entity *overwrites)
Sets entry pos in list of entities overwritten by entity ent.
int is_Class_type(const ir_type *clss)
Returns true if a type is a class type.
unsigned get_entity_bitfield_offset(const ir_entity *entity)
For bitfields, returns the offset in bits to the bitfield base.
void free_entity(ir_entity *ent)
Frees the entity.
void set_pointer_points_to_type(ir_type *pointer, ir_type *tp)
Sets the type to which a pointer points to.
void mark_entity_visited(ir_entity *ent)
Marks entity as visited.
void free_type(ir_type *tp)
Frees the memory used by the type.
A pointer type.
Definition: typerep.h:752
ir_tarval * get_initializer_tarval_value(const ir_initializer_t *initialzier)
Returns value contained in a tarval initializer.
ir_entity * get_entity_overwrittenby(const ir_entity *ent, size_t pos)
Return entry pos in list of entities overwritten by entity ent.
int check_entity(const ir_entity *ent)
Check an entity.
void set_irp_inh_transitive_closure_state(inh_transitive_closure_state s)
Sets the transitive closure of sub/superclass state for the whole program.
void set_method_calling_convention(ir_type *method, unsigned cc_mask)
Sets the calling convention of an entities graph.
initializer containing an ir_node from the const-code irg
Definition: typerep.h:511
long get_entity_nr(const ir_entity *ent)
Outputs a unique number for this entity if libfirm is compiled for debugging, (configure with –enable...
ir_type * find_pointer_type_to_type(ir_type *tp)
Returns the first pointer type that has as points_to tp.
The entity is visible across compilation units.
Definition: typerep.h:87
void set_type_visibility(ir_type *tp, ir_visibility v)
void set_entity_link(ir_entity *ent, void *l)
Stores new intermediate information.
int is_compound_variable_size(const ir_type *compound)
Returns the variable size flag.
const char * get_struct_name(const ir_type *strct)
Returns struct identifier as c-string.
int( compare_types_func_t)(const void *tp1, const void *tp2)
Type for a function that compares two types.
Definition: typerep.h:1646
A method type.
Definition: typerep.h:750
int has_array_size(const ir_type *array)
returns true if lower size != Unknown
void invalidate_irp_inh_transitive_closure_state(void)
Sets the transitive closure of sub/superclass state for the whole program to inh_transitive_closure_i...
void set_entity_vtable_number(ir_entity *ent, unsigned vtable_number)
Sets the entity vtable number.
ir_visibility
Visibility classed for entities.
Definition: typerep.h:79
This has the same semantic as visibility_local.
Definition: typerep.h:113
void type_walk_super2sub(type_walk_func *pre, type_walk_func *post, void *env)
Touches every class in specified order:
Special code for the Unknown type.
Definition: typerep.h:755
const char * get_union_name(const ir_type *uni)
Returns union identifier as c-string.
Closure computed and valid.
Definition: typerep.h:829
void set_entity_overwrites(ir_entity *ent, size_t pos, ir_entity *overwritten)
Sets entry pos in list of entities overwriting entity ent.
The entity is visible across compilation units and modules and cannot be overridden by other modules...
Definition: typerep.h:98
ir_entity * get_entity_trans_overwrittenby_first(const ir_entity *ent)
Start iteration over all entities that transitive overwrite entity ent.
ir_type * get_array_element_type(const ir_type *array)
Returns the array element type.
size_t get_entity_parameter_number(const ir_entity *entity)
returns number of parameter a parameter entitiy represents
void default_layout_compound_type(ir_type *tp)
layout members of a struct/union or class type in a default way.
size_t get_class_n_subtypes(const ir_type *clss)
Returns the number of subtypes.
void set_entity_dbg_info(ir_entity *ent, dbg_info *db)
Sets the debug information of an entity.
ir_type * get_class_trans_subtype_first(const ir_type *tp)
Start iteration over all transitive subtypes of tp.
ir_entity * new_entity(ir_type *owner, ident *name, ir_type *tp)
Creates a new entity.
ident * get_struct_ident(const ir_type *strct)
Returns struct identifier.
int is_Union_type(const ir_type *uni)
Returns true if a type is a union type.
The layout of this type is not defined.
Definition: typerep.h:933
ir_initializer_kind_t
the kind (type) of an initializer
Definition: typerep.h:509
ir_initializer_t * create_initializer_const(ir_node *value)
Creates an initializer containing a reference to a node on the const-code irg.
void add_class_supertype(ir_type *clss, ir_type *supertype)
Adds supertype as supertype to class.
The linker will try to merge entities with same name from different compilation units.
Definition: typerep.h:147
int is_SubClass_ptr_of(ir_type *low, ir_type *high)
Subclass check for pointers to classes.
ir_node * get_initializer_const_value(const ir_initializer_t *initializer)
Returns value contained in a const initializer.
void class_walk_super2sub(class_walk_func *pre, class_walk_func *post, void *env)
Same as type_walk_super2sub, but visits only class types.
void add_class_subtype(ir_type *clss, ir_type *subtype)
Adds subtype as subtype to clss.
size_t get_struct_member_index(ir_type const *strct, ir_entity const *member)
Returns index of member in strct, -1 if not contained.
ir_type * new_type_frame(void)
Makes a new frame type.
size_t get_class_supertype_index(const ir_type *clss, const ir_type *super_clss)
Returns the index to access superclass as supertype of class.
The layout is fixed, all component/member entities have an offset assigned.
Definition: typerep.h:939
calling_convention
Calling conventions: lower 24 bits are the number of register parameters, upper 8 encode the calling ...
Definition: typerep.h:1300
unsigned get_method_calling_convention(const ir_type *method)
Returns the calling convention of an entities graph.
Transmit parameters in registers, else the stack is used.
Definition: typerep.h:1301
ir_initializer_kind_t get_initializer_kind(const ir_initializer_t *initializer)
Returns kind of an initializer.
ir_volatility get_entity_volatility(const ir_entity *ent)
Returns the volatility of an entity.
size_t get_entity_overwrittenby_index(const ir_entity *ent, ir_entity *overwrites)
Returns index of overwrites in list of entities overwritten by entity ent.
ir_node * get_atomic_ent_value(const ir_entity *ent)
Returns initial value of entity with atomic type ent.
int is_compound_entity(const ir_entity *ent)
Returns true if the type of the entity is a class, structure, array or union type.
int is_method_variadic(ir_type const *method)
Returns the variadicity of a method.
void remove_entity_overwrittenby(ir_entity *ent, ir_entity *overwrites)
Removes entry overwrites in list of entities overwritten by ent.
This entity is unused.
Definition: typerep.h:439
long get_type_nr(const ir_type *tp)
Outputs a unique number for this type if libfirm is compiled for debugging, (configure with –enable-d...
void * get_entity_link(const ir_entity *ent)
Returns the stored intermediate information.
ir_visited_t get_entity_visited(const ir_entity *ent)
Returns the entities visited counter.
void set_atomic_ent_value(ir_entity *ent, ir_node *val)
Sets initial value of entity with atomic type ent to node val.
void set_type_link(ir_type *tp, void *l)
Sets the associated link field of a type.
ir_linkage
linkage specifies how the linker treats symbols
Definition: typerep.h:119
size_t get_entity_n_overwrittenby(const ir_entity *ent)
Returns number of entities overwritten by ent.
The calling convention bits.
Definition: typerep.h:1316
void remove_class_subtype(ir_type *clss, ir_type *subtype)
Finds subtype in the list of subtypes and removes it.
void set_entity_ident(ir_entity *ent, ident *id)
Sets the ident of the entity.
void set_entity_alias(ir_entity *alias, ir_entity *aliased)
Sets the entity an alias entity aliases.
int is_code_type(const ir_type *tp)
Checks whether a type is a code type.
void type_walk_super(type_walk_func *pre, type_walk_func *post, void *env)
Walker for class types in inheritance order.
tp_opcode get_type_opcode(const ir_type *type)
Returns opcode of type type.
Some entity uses are potentially hidden from the compiler.
Definition: typerep.h:156
int entity_is_externally_visible(const ir_entity *entity)
Returns 1 if the entity is visible outside the current compilation unit or to unknown callers (like a...
int is_Method_type(const ir_type *method)
Returns true if a type is a method type.
unsigned get_type_size_bytes(const ir_type *tp)
Returns the size of a type in bytes.
struct ir_entity ir_entity
Entity.
Definition: firm_types.h:83
A struct type.
Definition: typerep.h:746
The entity is local to the compilation unit.
Definition: typerep.h:105
ir_type * get_class_trans_supertype_first(const ir_type *tp)
Start iteration over all transitive supertypes of tp.
ident * get_union_ident(const ir_type *uni)
Returns union identifier.
void add_entity_overwrites(ir_entity *ent, ir_entity *overwritten)
Adds entity ent to the list of entities that overwrite overwritten.
size_t get_class_subtype_index(const ir_type *clss, const ir_type *subclass)
Returns the index to access subclass as subtype of class.
ir_type * get_pointer_points_to_type(const ir_type *pointer)
Returns the type to which a pointer points to.
ident * get_compound_ident(const ir_type *tp)
Returns the identifier of a compound type.
ir_initializer_t * get_entity_initializer(const ir_entity *entity)
Returns the new style initializers of an entity.
The entity does not need to have an address that is different from other entities.
Definition: typerep.h:170
int is_unknown_entity(const ir_entity *entity)
Tests whether entity entity is (the) unknown entity.
size_t get_entity_n_overwrites(const ir_entity *ent)
Returns the number of entities in the list of entities that overwrite entity ent. ...
void set_entity_parameter_number(ir_entity *entity, size_t n)
set number of parameter an entity represents
void set_method_variadic(ir_type *method, int is_variadic)
Sets the variadicity of a method.
void compute_inh_transitive_closure(void)
Compute transitive closure of the subclass/superclass and overwrites/overwrittenby relation...
void set_class_subtype(ir_type *clss, ir_type *subtype, size_t pos)
Sets the subtype at position pos, 0 <= pos < n_subtype.
const char * get_class_name(const ir_type *clss)
Returns identifier of the class type.
ir_type * new_type_pointer(ir_type *points_to)
Creates a new type pointer.
ir_initializer_t * create_initializer_compound(size_t n_entries)
Creates a compound initializer which holds n_entries entries.
void free_inh_transitive_closure(void)
Free memory occupied by the transitive closure information.
void set_entity_owner(ir_entity *ent, ir_type *owner)
Sets the owner field in entity to owner.
size_t get_compound_n_members(const ir_type *tp)
Returns the number of elements in a Firm compound type.
void set_entity_alignment(ir_entity *entity, unsigned alignment)
Allows you to override the type alignment for an entity.
void set_initializer_compound_value(ir_initializer_t *initializer, size_t index, ir_initializer_t *value)
Sets entry with index index to the initializer value.
ir_entity * get_entity_trans_overwrittenby_next(const ir_entity *ent)
Returns next entity in a overwrittenby iteration started by get_entity_trans_overwrittenby_first() ...
ir_type * new_type_method(size_t n_param, size_t n_res)
Create a new method type.
struct ir_tarval ir_tarval
Target Machine Value.
Definition: firm_types.h:68
The entity was read.
Definition: typerep.h:442
ir_type * get_entity_type(const ir_entity *ent)
Returns the type of an entity.
ir_type_state get_type_state(const ir_type *tp)
Returns the type layout state of a type.
ir_type * new_type_struct(ident *name)
Creates a new type struct.
void set_type_state(ir_type *tp, ir_type_state state)
Sets the type layout state of a type.
void add_method_additional_properties(ir_type *method, mtp_additional_properties flag)
Sets one additional graph property.
int type_visited(const ir_type *tp)
Returns non-zero if the type is already visited.
A class type.
Definition: typerep.h:748
inh_transitive_closure_state get_irp_inh_transitive_closure_state(void)
Returns the transitive closure of sub/superclass state for the whole program.
void set_method_param_type(ir_type *method, size_t pos, ir_type *tp)
Sets the type of the parameter at position pos of a method.
Transmit floating point parameters in registers, else the stack is used.
Definition: typerep.h:1315
void set_type_visited(ir_type *tp, ir_visited_t num)
Sets the visited counter of a type to num.
list of initializers used to initializer a compound or array type
Definition: typerep.h:517
int entity_has_definition(const ir_entity *entity)
Returns 1 if the entity has a definition (initializer) in the current compilation unit...
void walk_types_entities(ir_type *tp, entity_walk_func *doit, void *env)
Walks over all entities in the type.
void set_entity_linkage(ir_entity *entity, ir_linkage linkage)
Sets the linkage flags of entity entity to linkage.
void set_compound_variable_size(ir_type *compound, int variable_size)
Sets the variable size flag of a compound type.
int entity_has_ld_ident(const ir_entity *entity)
returns 1 if the entity has an ld_ident set explicitely
void set_entity_offset(ir_entity *entity, int offset)
Sets the offset of an entity (in a compound) in bytes.
ident * get_entity_ident(const ir_entity *ent)
Returns the ident of an entity.
ident * get_entity_ld_ident(const ir_entity *ent)
Returns the mangled name of the entity.
The entity was read but with a wrong mode (an implicit reinterpret cast)
Definition: typerep.h:443
void add_entity_linkage(ir_entity *entity, ir_linkage linkage)
Adds linkage flags linkage to entity entity.
size_t get_union_member_index(ir_type const *uni, ir_entity const *member)
Returns index of member in uni, -1 if not contained.
void inc_master_type_visited(void)
Increments type visited reference counter by one.
void set_type_size_bytes(ir_type *tp, unsigned size)
Sets the size of a type in bytes.
ir_type * get_class_trans_subtype_next(const ir_type *tp)
Returns next type in a subtype iteration started by get_class_trans_subtype_first() ...
initializes type with default values (usually 0)
Definition: typerep.h:515
A symbol whose definition won't change in a program.
Definition: typerep.h:127
ir_linkage get_entity_linkage(const ir_entity *entity)
Returns the linkage of an entity.
size_t get_union_n_members(const ir_type *uni)
Returns the number of unioned types of this union.
ir_type * new_type_array(ir_type *element_type)
Create a new type array.
int is_atomic_type(const ir_type *tp)
Checks whether a type is atomic.
size_t get_class_n_members(const ir_type *clss)
Returns the number of members of this class.
unsigned get_entity_alignment(const ir_entity *entity)
Returns alignment of entity in bytes.
void class_walk_func(ir_type *clss, void *env)
The class walk function.
Definition: typerep.h:1661
ir_entity * copy_entity_own(ir_entity *old, ir_type *new_owner)
Copies the entity if the new_owner is different from the owner of the old entity, else returns the ol...
void remove_entity_linkage(ir_entity *entity, ir_linkage linkage)
Remove linkage flags linkage from entity entity.
int is_atomic_entity(const ir_entity *ent)
Returns true if the type of the entity is a primitive, pointer or method type.
ir_entity * copy_entity_name(ir_entity *old, ident *new_name)
Copies the entity if the new_name is different from the name of the old entity, else returns the old ...
ir_entity * get_entity_trans_overwrites_first(const ir_entity *ent)
Start iteration over all transitive overwritten entities, overwritten by entity ent.
void set_entity_aligned(ir_entity *ent, ir_align a)
Sets indication whether entity is aligned in memory.
struct ir_mode ir_mode
SSA Value mode.
Definition: firm_types.h:59
Unknown access.
Definition: typerep.h:446
struct ir_node ir_node
Procedure Graph Node.
Definition: firm_types.h:53
ir_type * get_class_supertype(const ir_type *clss, size_t pos)
Returns the supertype at position pos, 0 <= pos < n_supertype.
size_t get_method_n_params(const ir_type *method)
Returns the number of parameters of this method.
int is_Struct_type(const ir_type *strct)
Returns true if a type is a struct type.
const char * get_entity_ld_name(const ir_entity *ent)
Returns the mangled name of the entity as a string.
Closure is not computed, can not be accessed.
Definition: typerep.h:828
ir_entity * get_class_member(const ir_type *clss, size_t pos)
Returns the member at position pos, 0 <= pos < n_member.
ir_entity * get_unknown_entity(void)
Returns the unknown entity .
void set_entity_visited(ir_entity *ent, ir_visited_t num)
Sets the entities visited counter.
ir_visibility get_type_visibility(const ir_type *tp)
void set_entity_ld_ident(ir_entity *ent, ident *ld_ident)
Sets the mangled name of the entity.
int is_unknown_type(const ir_type *type)
Checks whether type type is the unknown type.
int is_compound_type(const ir_type *tp)
Checks whether a type is a compound type.
unsigned get_method_n_regparams(ir_type *method)
Returns the number of registers parameters, 0 means default.
int is_Primitive_type(const ir_type *primitive)
Returns true if a type is a primitive type.
inh_transitive_closure_state
The state of the transitive closure.
Definition: typerep.h:827
ir_entity * get_entity_trans_overwrites_next(const ir_entity *ent)
Returns next entity in a overwrites iteration started by get_entity_trans_overwrites_first() ...
const char ident
Identifier.
Definition: firm_types.h:50
ir_visibility get_entity_visibility(const ir_entity *entity)
Returns the visibility class of an entity.
void set_array_size(ir_type *array, ir_node *size)
Sets the size (number of elements) of the array, i.e.
unsigned get_entity_bitfield_size(const ir_entity *entity)
Returns the size in bits for a bitfield, 0 if entity is not a bitfield.
unsigned get_type_alignment_bytes(const ir_type *tp)
Returns the alignment of a type in bytes.
Do not generate code even if the entity has a graph attached.
Definition: typerep.h:164
void set_method_res_type(ir_type *method, size_t pos, ir_type *tp)
Sets the type of the result at position pos of a method.
ir_align get_entity_aligned(const ir_entity *ent)
Returns indication whether entity is aligned in memory.
ident * get_segment_ident(ir_type const *type)
Returns segment identifier.
size_t get_class_n_supertypes(const ir_type *clss)
Returns the number of supertypes.
void set_array_size_int(ir_type *array, unsigned size)
Sets array size of array to size elements.
int check_type(const ir_type *tp)
Checks a type.
void set_entity_label(ir_entity *ent, ir_label_t label)
Sets label number of an entity with code type.
const char * get_initializer_kind_name(ir_initializer_kind_t ini)
Returns the name of the initializer kind.
void type_walk_irg(ir_graph *irg, type_walk_func *pre, type_walk_func *post, void *env)
Walks over all type information reachable from an ir graph.
ir_type * get_code_type(void)
Returns the code type.
ir_entity_usage get_entity_usage(const ir_entity *ent)
Returns the entity usage.
void mark_type_visited(ir_type *tp)
Sets visited field in type to type_visited.
int get_entity_offset(const ir_entity *entity)
Returns the offset of an entity (in a compound) in bytes.
int is_Pointer_type(const ir_type *pointer)
Returns true if a type is a pointer type.
ir_type * get_class_subtype(const ir_type *clss, size_t pos)
Returns the subtype at position pos, 0 <= pos < n_subtype.
void set_entity_bitfield_offset(ir_entity *entity, unsigned offset)
Sets the offset in bits to the base for a bitfield.
ir_visited_t get_type_visited(const ir_type *tp)
Returns the visited counter of a type.
initializer containing a tarval
Definition: typerep.h:513
An array type.
Definition: typerep.h:751
void set_entity_volatility(ir_entity *ent, ir_volatility vol)
Sets the volatility of an entity.
void ir_print_type(char *buffer, size_t buffer_size, const ir_type *tp)
construct a string representing the type.
ir_entity * get_struct_member(const ir_type *strct, size_t pos)
Returns the member at position pos, pos < n_member.
size_t get_method_n_ress(const ir_type *method)
Returns the number of results of a method type.
const char * get_align_name(ir_align a)
Returns the name of the alignment.
ident * get_class_ident(const ir_type *clss)
Returns identifier of the class type.
size_t get_entity_overwrites_index(const ir_entity *ent, ir_entity *overwritten)
Returns index of overwritten in list of entities overwriting entity ent.
ir_type * get_class_trans_supertype_next(const ir_type *tp)
Returns next type in a supertype iteration started by get_class_trans_supertype_first() ...
void set_entity_visibility(ir_entity *entity, ir_visibility visibility)
Sets visibility class of an entity.
void set_method_n_regparams(ir_type *method, unsigned n_regs)
Sets the number of registers parameters, 0 means default.
void set_entity_usage(ir_entity *ent, ir_entity_usage flag)
Sets/resets the state of the address taken flag of an entity.
mtp_additional_properties
Additional method type properties: Tell about special properties of a method type.
Definition: firm_types.h:221
The first parameter is a this pointer and is transmitted in a special way.
Definition: typerep.h:1310
ir_type * new_type_union(ident *name)
Creates a new type union.
mtp_additional_properties get_method_additional_properties(const ir_type *method)
Returns the mask of the additional graph properties.
Closure invalid, but can be accessed.
Definition: typerep.h:830
void remove_compound_member(ir_type *compound, ir_entity *entity)
Remove a member from a compound type.
unsigned get_entity_vtable_number(const ir_entity *ent)
Returns the entity vtable number.
ir_entity * get_union_member(const ir_type *uni, size_t pos)
Returns the entity at position pos of a union.
ir_type * new_type_primitive(ir_mode *mode)
Creates a new primitive type.