libFirm 1.20
libfirm/irmemory.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 1995-2010 University of Karlsruhe.  All right reserved.
00003  *
00004  * This file is part of libFirm.
00005  *
00006  * This file may be distributed and/or modified under the terms of the
00007  * GNU General Public License version 2 as published by the Free Software
00008  * Foundation and appearing in the file LICENSE.GPL included in the
00009  * packaging of this file.
00010  *
00011  * Licensees holding valid libFirm Professional Edition licenses may use
00012  * this file in accordance with the libFirm Commercial License.
00013  * Agreement provided with the Software.
00014  *
00015  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00016  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00017  * PURPOSE.
00018  */
00019 
00026 #ifndef FIRM_ANA_IRMEMORY_H
00027 #define FIRM_ANA_IRMEMORY_H
00028 
00029 #include "firm_types.h"
00030 #include "begin.h"
00031 
00042 typedef enum ir_alias_relation {
00043     ir_no_alias,       
00044     ir_may_alias,      
00045     ir_sure_alias      
00046 } ir_alias_relation;
00047 
00049 typedef enum ir_entity_usage_computed_state {
00050     ir_entity_usage_not_computed,
00051     ir_entity_usage_computed
00052 } ir_entity_usage_computed_state;
00053 
00055 typedef enum ir_disambuigator_options {
00056     aa_opt_no_opt               = 0,  
00057     aa_opt_type_based           = 1,  
00058     aa_opt_byte_type_may_alias  = 2,  
00059     aa_opt_no_alias_args        = 4,  
00060     aa_opt_no_alias_args_global = 8,  
00061     aa_opt_no_alias             = 16, 
00062     aa_opt_inherited            = 128 
00063 } ir_disambuigator_options;
00064 ENUM_BITSET(ir_disambuigator_options)
00065 
00066 
00072 typedef enum ir_storage_class_class_t {
00073     ir_sc_pointer           = 0x0,  
00074     ir_sc_globalvar         = 0x1,  
00075     ir_sc_localvar          = 0x2,  
00076     ir_sc_tls               = 0x3,  
00077     ir_sc_malloced          = 0x4,  
00078     ir_sc_globaladdr        = 0x5,  
00080     ir_sc_modifier_nottaken = 0x80, 
00081     ir_sc_modifier_argument = 0x40, 
00082     ir_sc_modifiers         = ir_sc_modifier_nottaken | ir_sc_modifier_argument
00083 } ir_storage_class_class_t;
00084 ENUM_BITSET(ir_storage_class_class_t)
00085 
00086 
00087 FIRM_API ir_storage_class_class_t get_base_sc(ir_storage_class_class_t x);
00088 
00093 typedef ir_alias_relation (*DISAMBIGUATOR_FUNC)(
00094     const ir_node *adr1, const ir_mode *mode1,
00095     const ir_node *adr2, const ir_mode *mode2);
00096 
00103 FIRM_API ir_storage_class_class_t classify_pointer(const ir_node *irn,
00104                                                    const ir_entity *ent);
00105 
00109 FIRM_API const char *get_ir_alias_relation_name(ir_alias_relation rel);
00110 
00144 FIRM_API ir_alias_relation get_alias_relation(
00145     const ir_node *adr1, const ir_mode *mode1,
00146     const ir_node *adr2, const ir_mode *mode2);
00147 
00153 FIRM_API void set_language_memory_disambiguator(DISAMBIGUATOR_FUNC func);
00154 
00158 FIRM_API void mem_disambig_init(void);
00159 
00171 FIRM_API ir_alias_relation get_alias_relation_ex(
00172     const ir_node *adr1, const ir_mode *mode1,
00173     const ir_node *adr2, const ir_mode *mode2);
00174 
00178 FIRM_API void mem_disambig_term(void);
00179 
00188 FIRM_API void assure_irg_entity_usage_computed(ir_graph *irg);
00189 
00193 FIRM_API ir_entity_usage_computed_state get_irp_globals_entity_usage_state(void);
00194 
00200 FIRM_API void set_irp_globals_entity_usage_state(ir_entity_usage_computed_state state);
00201 
00214 FIRM_API void assure_irp_globals_entity_usage_computed(void);
00215 
00221 FIRM_API unsigned get_irg_memory_disambiguator_options(const ir_graph *irg);
00222 
00229 FIRM_API void set_irg_memory_disambiguator_options(ir_graph *irg,
00230                                                    unsigned options);
00231 
00238 FIRM_API void set_irp_memory_disambiguator_options(unsigned options);
00239 
00245 FIRM_API void mark_private_methods(void);
00246 
00254 FIRM_API ir_prog_pass_t *mark_private_methods_pass(const char *name);
00255 
00258 #include "end.h"
00259 
00260 #endif