X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fcommon%2Fdebug.h;h=9c9388b18343c5788fd3b51e59062bce6cdd5c06;hb=e997eedfb605aa149004122d63c7c54a8e384132;hp=0fabe2b5d5b41854e690957a4f157ac478e938db;hpb=1ce363f80e6a204d4011f85813362d9bd1d0e7e4;p=libfirm diff --git a/ir/common/debug.h b/ir/common/debug.h index 0fabe2b5d..9c9388b18 100644 --- a/ir/common/debug.h +++ b/ir/common/debug.h @@ -1,20 +1,6 @@ /* - * 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. + * Copyright (C) 2012 University of Karlsruhe. */ /** @@ -22,36 +8,33 @@ * @brief Debug facility. * @author Michael Beck, Sebastian Hack * @date 15.12.2004 - * @version $Id$ */ #ifndef FIRM_COMMON_DEBUG_H #define FIRM_COMMON_DEBUG_H -#include "firm_config.h" - /* WITH DEBUG OUTPUT */ #ifdef DEBUG_libfirm #include enum firm_dbg_level_t { - LEVEL_DEFAULT = 0, /**< Prints always. Use with DBG(). */ - LEVEL_1 = 1, - LEVEL_2 = 2, - LEVEL_3 = 4, - LEVEL_4 = 8, - LEVEL_5 = 16, - - SET_LEVEL_0 = 0, /**< use with firm_dbg_set_mask(). */ - SET_LEVEL_1 = 1, - SET_LEVEL_2 = 3, - SET_LEVEL_3 = 7, - SET_LEVEL_4 = 15, - SET_LEVEL_5 = 31, - SET_LEVEL_ALL = SET_LEVEL_5 + LEVEL_DEFAULT = 0, /**< Prints always. Use with DBG(). */ + LEVEL_1 = 1, + LEVEL_2 = 2, + LEVEL_3 = 4, + LEVEL_4 = 8, + LEVEL_5 = 16, + + SET_LEVEL_0 = 0, /**< use with firm_dbg_set_mask(). */ + SET_LEVEL_1 = 1, + SET_LEVEL_2 = 3, + SET_LEVEL_3 = 7, + SET_LEVEL_4 = 15, + SET_LEVEL_5 = 31, + SET_LEVEL_ALL = SET_LEVEL_5 }; -typedef struct _firm_dbg_module_t firm_dbg_module_t; +typedef struct firm_dbg_module_t firm_dbg_module_t; /* Internal function to the debug module. */ void *_firm_dbg_make_msg(const firm_dbg_module_t *mod, unsigned mask, const char *fmt, ...); @@ -96,21 +79,7 @@ void firm_dbg_set_file(firm_dbg_module_t *module, FILE *file); #define _DBG_MAIN(func,args) \ _firm_dbg_print_msg(__FILE__, __LINE__, func, _firm_dbg_make_msg args) -/* If we have C99 use the __func__ variable for calling functions name. */ -#if defined(__STD_VERSION__) && __STD_VERSION >= 199901L -#define _DBG(args) _DBG_MAIN(__func__, args) -#else - -/* Else, check for gcc and use the proprietary __FUNCTION__ macro. */ -#ifdef __GNUC__ -#define _DBG(args) _DBG_MAIN(__FUNCTION__, args) -#else - -/* Else go without the name of the calling function. */ -#define _DBG(args) _DBG_MAIN("", args) -#endif /* __GNUC__ */ -#endif /* __STD_VERSION__ ... */ - +#define _DBG(args) _DBG_MAIN(__func__, args) #define _DB(args) _firm_dbg_print args /** @@ -156,17 +125,17 @@ void firm_dbg_set_file(firm_dbg_module_t *module, FILE *file); /* DEBUG OUTPUT IS COMPLETELY DISABLED */ -#define DBG(x) -#define DB(x) +#define DBG(x) (void)0 +#define DB(x) (void)0 /** create a debug handle in release mode */ -#define FIRM_DBG_REGISTER(handle, name) +#define FIRM_DBG_REGISTER(handle, name) (void)0 #define DEBUG_ONLY(code) #define RELEASE_ONLY(code) code -#define firm_dbg_set_mask(module, mask) -#define firm_dbg_get_mask(module) -#define firm_dbg_set_file(module, file) +#define firm_dbg_set_mask(module, mask) (void)0 +#define firm_dbg_get_mask(module) (void)0 +#define firm_dbg_set_file(module, file) (void)0 #endif /* DEBUG_libfirm */