X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Flibfirm%2Firprog.h;h=8d5347894131ef6938ad9de02c21641d3e03662d;hb=fa9c992b5f23e7a059ac91fdd04b409b951ebcc4;hp=da1da0683ac5dec80bb5e6c2b95431c53be35d5d;hpb=bd84c0c27fb6a39f8d2fe340c50dab076bacbb63;p=libfirm diff --git a/include/libfirm/irprog.h b/include/libfirm/irprog.h index da1da0683..8d5347894 100644 --- a/include/libfirm/irprog.h +++ b/include/libfirm/irprog.h @@ -46,6 +46,24 @@ #include "firm_types.h" #include "irgraph.h" +typedef enum ir_segment_t { + IR_SEGMENT_FIRST, + /** "normal" global data */ + IR_SEGMENT_GLOBAL = IR_SEGMENT_FIRST, + /** thread local storage segment */ + IR_SEGMENT_THREAD_LOCAL, + /** + * the constructors segment. Contains pointers to functions which are + * executed on module initialization (program start or when a library is + * dynamically loaded) + */ + IR_SEGMENT_CONSTRUCTORS, + /** like constructors, but functions are executed on module exit */ + IR_SEGMENT_DESTRUCTORS, + + IR_SEGMENT_COUNT +} ir_segment_t; + /** * Datastructure that holds central information about a program * @@ -140,9 +158,15 @@ int get_irp_n_allirgs(void); pseudo graphs). Visits first graphs, then pseudo graphs. */ ir_graph *get_irp_allirg(int pos); +/** + * returns the type containing the entities for a segment + */ +ir_type *get_segment_type(ir_segment_t segment); + /** * Returns the "global" type of the irp. * Upon creation this is an empty class type. + * This is a convenience function for get_segment_type(IR_SEGMENT_GLOBAL) */ ir_type *get_glob_type(void); @@ -152,13 +176,6 @@ ir_type *get_glob_type(void); */ ir_type *get_tls_type(void); -/** - * returns the constructors type containing entities that should be put in - * the constructos section. (The constructors section contains pointers to - * module constructor functions) - */ -ir_type *get_constructors_type(void); - /** Adds type to the list of types in irp. */ void add_irp_type(ir_type *typ); @@ -236,4 +253,13 @@ ir_exc_region_t get_irp_next_region_nr(void); /** Returns a new, unique label number. */ ir_label_t get_irp_next_label_nr(void); +/** Add a new global asm include. */ +void add_irp_asm(ident *asm_string); + +/** Return the number of global asm includes. */ +int get_irp_n_asms(void); + +/** Return the global asm include at position pos. */ +ident *get_irp_asm(int pos); + #endif