X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=ir%2Fcommon%2Fdebug.h;h=8265a377f31e1b4005524c279eef74e46a79c7aa;hb=3d306914ac98469e3d43b59de125efe64ddea8a5;hp=18c721e05cab7b6d54bf0149623eeeb19bea3124;hpb=9e625903a61a8bf93f31549c8acc4b80c4fd84a3;p=libfirm diff --git a/ir/common/debug.h b/ir/common/debug.h index 18c721e05..8265a377f 100644 --- a/ir/common/debug.h +++ b/ir/common/debug.h @@ -1,20 +1,43 @@ -/** - * Debug facility. - * @author Michael Beck, Sebastian Hack - * @date 15.12.2004 +/* + * Copyright (C) 1995-2007 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. * - * $Id$ + * 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. */ -#ifndef _FIRM_DEBUG_H -#define _FIRM_DEBUG_H +/** + * @file + * @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" +#ifdef DEBUG_libfirm + +/* WITH DEBUG OUTPUT */ + #ifdef WITH_LIBCORE #define DBG(x) _LC_DBG(x) #define DB(x) _LC_DB(x) + #include /* use the newer debug implementation in libcore */ @@ -40,7 +63,7 @@ extern firm_dbg_module_t *firm_dbg_register(const char *name); #define SET_LEVEL_5 LC_SET_LEVEL_5 #define SET_LEVEL_ALL LC_SET_LEVEL_ALL -#else +#else /* WITH_LIBCORE */ /* use the builtin debug implementation */ #include @@ -132,8 +155,6 @@ void firm_dbg_set_file(firm_dbg_module_t *module, FILE *file); #define DBG_RETAIL(args) _DBG(args) #define DB_RETAIL(args) _DB(args) -#ifdef DEBUG_libfirm - /** * Issue a debug message. * @param args The arguments. @@ -160,28 +181,29 @@ void firm_dbg_set_file(firm_dbg_module_t *module, FILE *file); #define DBG(args) _DBG(args) #define DB(args) _DB(args) -#else -#define DBG(args) -#define DB(args) -#endif /* DEBUG_libfirm */ - #endif /* WITH_LIBCORE */ -/* some more macros to handle often used cases */ -#ifdef DEBUG_libfirm - /** create a debug handle in debug mode */ #define FIRM_DBG_REGISTER(handle, name) handle = firm_dbg_register(name) #define DEBUG_ONLY(code) code #define RELEASE_ONLY(code) -#else +#else /* ndef DEBUG_libfirm */ + +/* DEBUG OUTPUT IS COMPLETELY DISABLED */ + +#define DBG(x) +#define DB(x) /** create a debug handle in release mode */ #define FIRM_DBG_REGISTER(handle, name) #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) + #endif /* DEBUG_libfirm */ -#endif /* _FIRM_DEBUG_H */ +#endif