libFirm 1.20
libfirm/firm_types.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 
00025 #ifndef FIRM_COMMON_FIRM_TYPES_H
00026 #define FIRM_COMMON_FIRM_TYPES_H
00027 
00028 #include "begin.h"
00029 
00048 typedef unsigned long ir_visited_t;
00050 typedef unsigned long ir_label_t;
00051 
00054 typedef struct dbg_info             dbg_info;
00057 typedef struct type_dbg_info        type_dbg_info;
00060 typedef struct ident                ident;
00063 typedef struct ir_node              ir_node;
00066 typedef struct ir_op                ir_op;
00069 typedef struct ir_mode              ir_mode;
00072 typedef struct ir_edge_t            ir_edge_t;
00075 typedef struct ir_heights_t         ir_heights_t;
00078 typedef struct ir_tarval            ir_tarval;
00081 typedef struct ir_enum_const        ir_enum_const;
00084 typedef struct ir_type              ir_type;
00087 typedef struct ir_graph             ir_graph;
00090 typedef struct ir_prog              ir_prog;
00093 typedef struct ir_loop              ir_loop;
00096 typedef struct ir_entity            ir_entity;
00098 typedef struct ir_extblk            ir_extblk;
00101 typedef struct ir_exec_freq         ir_exec_freq;
00104 typedef struct ir_cdep              ir_cdep;
00107 typedef struct arch_irn_ops_t       arch_irn_ops_t;
00109 typedef struct ir_graph_pass_t      ir_graph_pass_t;
00111 typedef struct ir_prog_pass_t       ir_prog_pass_t;
00112 
00114 typedef struct ir_graph_pass_manager_t      ir_graph_pass_manager_t;
00116 typedef struct ir_prog_pass_manager_t       ir_prog_pass_manager_t;
00117 
00120 typedef union  ir_initializer_t     ir_initializer_t;
00121 
00125 typedef void irg_walk_func(ir_node *, void *);
00126 
00133 typedef struct ir_switch_table  ir_switch_table;
00134 
00151 typedef ir_node *uninitialized_local_variable_func_t(ir_graph *irg, ir_mode *mode, int pos);
00152 
00153 #ifdef __cplusplus
00154 # define ENUM_BITSET(type) \
00155     extern "C++" { \
00156         static inline type operator ~  (type  a)         { return     (type)~(int)a;           } \
00157         static inline type operator &  (type  a, type b) { return     (type)((int)a & (int)b); } \
00158         static inline type operator &= (type& a, type b) { return a = (type)((int)a & (int)b); } \
00159         static inline type operator ^  (type  a, type b) { return     (type)((int)a ^ (int)b); } \
00160         static inline type operator ^= (type& a, type b) { return a = (type)((int)a ^ (int)b); } \
00161         static inline type operator |  (type  a, type b) { return     (type)((int)a | (int)b); } \
00162         static inline type operator |= (type& a, type b) { return a = (type)((int)a | (int)b); } \
00163     }
00164 #else
00165 
00169 # define ENUM_BITSET(type)
00170 #endif
00171 
00172 #ifdef __cplusplus
00173 # define ENUM_COUNTABLE(type) \
00174     extern "C++" { \
00175         static inline type operator ++(type& a) { return a = (type)((int)a + 1); } \
00176         static inline type operator --(type& a) { return a = (type)((int)a - 1); } \
00177     }
00178 #else
00179 
00183 # define ENUM_COUNTABLE(type)
00184 #endif
00185 
00190 typedef enum ir_relation {
00191     ir_relation_false              = 0,       
00192     ir_relation_equal              = 1u << 0, 
00193     ir_relation_less               = 1u << 1, 
00194     ir_relation_greater            = 1u << 2, 
00195     ir_relation_unordered          = 1u << 3, 
00196     ir_relation_less_equal         = ir_relation_equal|ir_relation_less,    
00197     ir_relation_greater_equal      = ir_relation_equal|ir_relation_greater, 
00198     ir_relation_less_greater       = ir_relation_less|ir_relation_greater,  
00199     ir_relation_less_equal_greater = ir_relation_equal|ir_relation_less|ir_relation_greater, 
00200     ir_relation_unordered_equal    = ir_relation_unordered|ir_relation_equal, 
00201     ir_relation_unordered_less     = ir_relation_unordered|ir_relation_less,  
00202     ir_relation_unordered_less_equal = ir_relation_unordered|ir_relation_less|ir_relation_equal, 
00203     ir_relation_unordered_greater    = ir_relation_unordered|ir_relation_greater, 
00204     ir_relation_unordered_greater_equal = ir_relation_unordered|ir_relation_greater|ir_relation_equal, 
00205     ir_relation_unordered_less_greater  = ir_relation_unordered|ir_relation_less|ir_relation_greater, 
00206     ir_relation_true                    = ir_relation_equal|ir_relation_less|ir_relation_greater|ir_relation_unordered, 
00207 } ir_relation;
00208 ENUM_BITSET(ir_relation)
00209 
00210 
00214 typedef enum ir_cons_flags {
00215     cons_none             = 0,        
00216     cons_volatile         = 1U << 0,  
00217     cons_unaligned        = 1U << 1,  
00218     cons_floats           = 1U << 2,  
00219     cons_throws_exception = 1U << 3,  
00222 } ir_cons_flags;
00223 ENUM_BITSET(ir_cons_flags)
00224 
00225 
00229 typedef enum op_pin_state {
00230     op_pin_state_floats = 0,    
00231     op_pin_state_pinned = 1,    
00232     op_pin_state_exc_pinned,    
00234     op_pin_state_mem_pinned     
00236 } op_pin_state;
00237 
00242 typedef enum cond_jmp_predicate {
00243     COND_JMP_PRED_NONE,        
00244     COND_JMP_PRED_TRUE,        
00245     COND_JMP_PRED_FALSE        
00246 } cond_jmp_predicate;
00247 
00254 typedef enum mtp_additional_properties {
00255     mtp_no_property            = 0x00000000, 
00256     mtp_property_const         = 0x00000001, 
00263     mtp_property_pure          = 0x00000002, 
00270     mtp_property_noreturn      = 0x00000004, 
00273     mtp_property_nothrow       = 0x00000008, 
00275     mtp_property_naked         = 0x00000010, 
00277     mtp_property_malloc        = 0x00000020, 
00279     mtp_property_returns_twice = 0x00000040, 
00281     mtp_property_intrinsic     = 0x00000080, 
00283     mtp_property_runtime       = 0x00000100, 
00284     mtp_property_private       = 0x00000200, 
00286     mtp_property_has_loop      = 0x00000400, 
00287     mtp_property_inherited     = (1<<31)     
00289 } mtp_additional_properties;
00290 ENUM_BITSET(mtp_additional_properties)
00291 
00292 
00298 typedef enum symconst_kind {
00299     symconst_type_size,   
00301     symconst_type_align,  
00303     symconst_addr_ent,    
00306     symconst_ofs_ent,     
00308     symconst_enum_const   
00310 } symconst_kind;
00311 
00319 typedef union symconst_symbol {
00320     ir_type       *type_p;    
00321     ir_entity     *entity_p;  
00322     ir_enum_const *enum_p;    
00323 } symconst_symbol;
00324 
00329 typedef enum ir_where_alloc {
00330     stack_alloc,          
00331     heap_alloc            
00332 } ir_where_alloc;
00333 
00337 typedef struct ir_asm_constraint {
00338     unsigned       pos;           
00339     ident          *constraint;   
00340     ir_mode        *mode;         
00341 } ir_asm_constraint;
00342 
00346 typedef enum ir_builtin_kind {
00347     ir_bk_trap,                   
00348     ir_bk_debugbreak,             
00349     ir_bk_return_address,         
00350     ir_bk_frame_address,          
00351     ir_bk_prefetch,               
00352     ir_bk_ffs,                    
00353     ir_bk_clz,                    
00354     ir_bk_ctz,                    
00355     ir_bk_popcount,               
00356     ir_bk_parity,                 
00357     ir_bk_bswap,                  
00358     ir_bk_inport,                 
00359     ir_bk_outport,                
00360     ir_bk_inner_trampoline,       
00361     ir_bk_last = ir_bk_inner_trampoline,
00362 } ir_builtin_kind;
00363 
00367 typedef enum ir_value_classify_sign {
00368     value_classified_unknown  = 0,   
00369     value_classified_positive = 1,   
00370     value_classified_negative = -1   
00372 } ir_value_classify_sign;
00373 
00377 typedef enum {
00378     volatility_non_volatile,    
00379     volatility_is_volatile      
00380 } ir_volatility;
00381 
00385 typedef enum {
00386     align_is_aligned = 0, 
00387     align_non_aligned,    
00388 } ir_align;
00389 
00390 #include "end.h"
00391 
00392 #endif