X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firflag_t.h;h=478024f993d43ab0d914e7ce0c6fbfb5d659de0f;hb=c77f71bb78b53c0bf9d3a394712bc0e17262aaff;hp=0fe549982d545709dd3304e7ba5f0913ff8081ef;hpb=3082a470a6c3b42c7b531fb6492efcd14567be0a;p=libfirm diff --git a/ir/ir/irflag_t.h b/ir/ir/irflag_t.h index 0fe549982..478024f99 100644 --- a/ir/ir/irflag_t.h +++ b/ir/ir/irflag_t.h @@ -1,41 +1,66 @@ /* - * Project: libFIRM - * File name: ir/ir/irgraph.c - * Purpose: Flags to control optimizations, inline implementation. - * Author: Michael Beck - * Created: - * CVS-ID: $Id$ - * Copyright: (c) 1998-2004 Universität Karlsruhe - * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * + * This file is part of libFirm. + * + * This file may be distributed and/or modified under the terms of the + * GNU General Public License version 2 as published by the Free Software + * Foundation and appearing in the file LICENSE.GPL included in the + * packaging of this file. + * + * Licensees holding valid libFirm Professional Edition licenses may use + * this file in accordance with the libFirm Commercial License. + * Agreement provided with the Software. + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. */ /** - * @file irflag_t.h - * - * Inline implementation of Optimization flags. - * - * @author Michael Beck + * @file + * @brief Flags to control optimizations, inline implementation. + * @author Michael Beck, Sebastian Hack + * @version $Id$ */ -#ifndef _IRFLAG_T_H_ -#define _IRFLAG_T_H_ +#ifndef FIRM_IR_IRFLAG_T_H +#define FIRM_IR_IRFLAG_T_H + +#include "firm_config.h" #include "irflag.h" /** - * current libFIRM optimizations + * libFIRM optimizations flags */ typedef enum { -#define E_FLAG(name, value, def) irf_##name = (1 << value), -#define I_FLAG(name, value, def) irf_##name = (1 << value), +#define E_FLAG(name, value, def) irf_##name = (1 << value), +#define I_FLAG(name, value, def) irf_##name = (1 << value), +#define R_FLAG(name, value) #include "irflag_t.def" irf_last #undef I_FLAG #undef E_FLAG +#undef R_FLAG } libfirm_opts_t; -extern optimization_state_t libFIRM_opt; -extern optimization_state_t libFIRM_verb; +/** + * libFIRM running flags + */ +typedef enum { +#define E_FLAG(name, value, def) +#define I_FLAG(name, value, def) +#define R_FLAG(name, value) ir_rf_##name = (1 << value), + +#include "irflag_t.def" + ir_rf_last +#undef I_FLAG +#undef E_FLAG +#undef R_FLAG +} libfirm_running_t; + +extern optimization_state_t libFIRM_opt, libFIRM_running, libFIRM_verb; extern firm_verification_t opt_do_node_verification; extern int firm_verbosity_level; @@ -61,22 +86,33 @@ static INLINE int get_opt_##name##_verbose(void) { \ return libFIRM_verb & irf_##name; \ } +/* generate getter and setter functions for running flags */ +#define R_FLAG(name, value) \ +static INLINE int is_##name##_running(void) { \ + return libFIRM_running & ir_rf_##name; \ +} \ +static INLINE void set_##name##_running(int flag) {\ + if (flag) libFIRM_running |= ir_rf_##name; \ + else libFIRM_running &= ~ir_rf_##name; \ +} + #include "irflag_t.def" #undef I_FLAG #undef E_FLAG +#undef R_FLAG -static INLINE int _get_firm_verbosity (void) { +static INLINE int _get_firm_verbosity(void) { return firm_verbosity_level; } -static INLINE int _get_optimize (void) { - return get_opt_optimize(); +static INLINE int _get_optimize(void) { + return get_opt_optimize(); } static INLINE firm_verification_t get_node_verification_mode(void) { - return opt_do_node_verification; + return opt_do_node_verification; } #define get_optimize() _get_optimize() @@ -88,4 +124,4 @@ get_node_verification_mode(void) { extern void firm_init_flags(void); -#endif /* _IRFLAG_T_H_ */ +#endif