libFirm 1.20
libfirm/irloop.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 1995-2011 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 
00032 #ifndef FIRM_ANA_IRLOOP_H
00033 #define FIRM_ANA_IRLOOP_H
00034 
00035 #include "firm_types.h"
00036 #include "firm_common.h"
00037 #include "begin.h"
00038 
00045 FIRM_API int is_backedge(const ir_node *n, int pos);
00047 FIRM_API void set_backedge(ir_node *n, int pos);
00049 FIRM_API void set_not_backedge(ir_node *n, int pos);
00051 FIRM_API int has_backedges(const ir_node *n);
00053 FIRM_API void clear_backedges(ir_node *n);
00054 
00056 typedef union {
00057     firm_kind *kind; 
00058     ir_node  *node;  
00059     ir_loop  *son;   
00060     ir_graph *irg;   
00061 } loop_element;
00062 
00066 FIRM_API int is_ir_loop(const void *thing);
00067 
00069 FIRM_API void set_irg_loop(ir_graph *irg, ir_loop *l);
00070 
00072 FIRM_API ir_loop *get_irg_loop(const ir_graph *irg);
00073 
00075 FIRM_API ir_loop *get_irn_loop(const ir_node *n);
00076 
00078 FIRM_API ir_loop *get_loop_outer_loop(const ir_loop *loop);
00080 FIRM_API unsigned get_loop_depth(const ir_loop *loop);
00081 
00083 FIRM_API size_t get_loop_n_elements(const ir_loop *loop);
00084 
00087 FIRM_API loop_element get_loop_element(const ir_loop *loop, size_t pos);
00088 
00092 FIRM_API long get_loop_loop_nr(const ir_loop *loop);
00093 
00095 FIRM_API void set_loop_link(ir_loop *loop, void *link);
00098 FIRM_API void *get_loop_link(const ir_loop *loop);
00099 
00120 FIRM_API int construct_backedges(ir_graph *irg);
00121 
00138 FIRM_API int construct_cf_backedges(ir_graph *irg);
00139 
00145 FIRM_API void assure_loopinfo(ir_graph *irg);
00146 
00151 FIRM_API void free_loop_information(ir_graph *irg);
00153 FIRM_API void free_all_loop_information(void);
00154 
00162 FIRM_API int is_loop_invariant(const ir_node *n, const ir_node *block);
00163 
00166 #include "end.h"
00167 
00168 #endif