X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=include%2Flibfirm%2Firmemory.h;h=7ed3fbf256a8ac12ae5544070eea86a565aa28dd;hb=abe1a1208ecb24b75b001bfe98ea0c500407a094;hp=427ffe329bf5d76fe2268ea04a915b4128540734;hpb=d7337be4ef7938bf403e919f71844215a56e10b2;p=libfirm diff --git a/include/libfirm/irmemory.h b/include/libfirm/irmemory.h index 427ffe329..7ed3fbf25 100644 --- a/include/libfirm/irmemory.h +++ b/include/libfirm/irmemory.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2010 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -22,7 +22,6 @@ * @brief Memory disambiguator * @author Michael Beck * @date 27.12.2006 - * @version $Id$ */ #ifndef FIRM_ANA_IRMEMORY_H #define FIRM_ANA_IRMEMORY_H @@ -30,21 +29,30 @@ #include "firm_types.h" #include "begin.h" +/** @ingroup irana + * @defgroup ir_memory Memory Disambiguator + * + * A memory disambiguator checks wether 2 given SSA values representing + * addresses alias. + * + * @{ + */ + /** The alias relation of two memory addresses. */ -typedef enum { +typedef enum ir_alias_relation { ir_no_alias, /**< No alias. */ ir_may_alias, /**< Unknown state, may alias. */ ir_sure_alias /**< Sure alias. */ } ir_alias_relation; /** The state of the entity usage flags. */ -typedef enum { +typedef enum ir_entity_usage_computed_state { ir_entity_usage_not_computed, ir_entity_usage_computed } ir_entity_usage_computed_state; /** Possible options for the memory disambiguator. */ -typedef enum { +typedef enum ir_disambuigator_options { aa_opt_no_opt = 0, /**< no options: most conservative */ aa_opt_type_based = 1, /**< use type based alias analysis: strict typed source language */ aa_opt_byte_type_may_alias = 2, /**< if type based analysis is enabled: bytes types may alias other types */ @@ -53,6 +61,7 @@ typedef enum { aa_opt_no_alias = 16, /**< two addresses NEVER alias, use with CAUTION (gcc -fno-alias) */ aa_opt_inherited = 128 /**< only for implementation: options from a graph are inherited from global */ } ir_disambuigator_options; +ENUM_BITSET(ir_disambuigator_options) /** * Classify storage locations. @@ -60,7 +69,7 @@ typedef enum { * ir_sc_pointer potentially aliases all classes which don't have a * NOTTAKEN modifier. */ -typedef enum { +typedef enum ir_storage_class_class_t { ir_sc_pointer = 0x0, /**< generic pointer, may be anything */ ir_sc_globalvar = 0x1, /**< an address of a global variable */ ir_sc_localvar = 0x2, /**< an address of a local variable or method argument */ @@ -72,28 +81,26 @@ typedef enum { ir_sc_modifier_argument = 0x40, /**< if set pointer was a function argument */ ir_sc_modifiers = ir_sc_modifier_nottaken | ir_sc_modifier_argument } ir_storage_class_class_t; +ENUM_BITSET(ir_storage_class_class_t) /** Get the base storage class (ignore modifier) */ -#define GET_BASE_SC(x) ((x) & ~ir_sc_modifiers) +FIRM_API ir_storage_class_class_t get_base_sc(ir_storage_class_class_t x); /** * A source language specific memory disambiguator function. * Called by get_alias_relation(). */ typedef ir_alias_relation (*DISAMBIGUATOR_FUNC)( - const ir_graph *irg, const ir_node *adr1, const ir_mode *mode1, const ir_node *adr2, const ir_mode *mode2); /** * Classify a base pointer. * - * @param irg the graph of the pointer * @param irn the node representing the base address * @param ent the base entity of the base address iff any */ -FIRM_API ir_storage_class_class_t classify_pointer(const ir_graph *irg, - const ir_node *irn, +FIRM_API ir_storage_class_class_t classify_pointer(const ir_node *irn, const ir_entity *ent); /** @@ -104,7 +111,6 @@ FIRM_API const char *get_ir_alias_relation_name(ir_alias_relation rel); /** * Determine the alias relation between two addresses. * - * @param irg The current graph. * @param adr1 The first address. * @param mode1 The mode of the first memory access. * @param adr2 The second address. @@ -136,7 +142,6 @@ FIRM_API const char *get_ir_alias_relation_name(ir_alias_relation rel); * interrogated to detect the alias relation. */ FIRM_API ir_alias_relation get_alias_relation( - const ir_graph *irg, const ir_node *adr1, const ir_mode *mode1, const ir_node *adr2, const ir_mode *mode2); @@ -165,7 +170,6 @@ FIRM_API void mem_disambig_init(void); * @see get_alias_relation() */ FIRM_API ir_alias_relation get_alias_relation_ex( - const ir_graph *irg, const ir_node *adr1, const ir_mode *mode1, const ir_node *adr2, const ir_mode *mode2); @@ -174,19 +178,11 @@ FIRM_API ir_alias_relation get_alias_relation_ex( */ FIRM_API void mem_disambig_term(void); -FIRM_API ir_entity_usage_computed_state get_irg_entity_usage_state(const ir_graph *irg); - -FIRM_API void set_irg_entity_usage_state(ir_graph *irg, - ir_entity_usage_computed_state state); - /** * Assure that the entity usage flags have been computed for the given graph. * * This analysis computes the entity usage state for all local variables. * - * Note that this is a conservative estimation that by no Firm transformation - * can be invalidated, so it's only recomputed if manually triggered by calling - * set_irg_entity_usage_state(irg, ir_entity_usage_not_computed). * Even then the information is not cleaned from the variables, call * assure_irg_entity_usage_computed() again for recomputation. */ @@ -257,6 +253,8 @@ FIRM_API void mark_private_methods(void); */ FIRM_API ir_prog_pass_t *mark_private_methods_pass(const char *name); +/** @} */ + #include "end.h" #endif