debug.hxx

Go to the documentation of this file.
00001 #ifndef DEBUG_HXX
00002 #define DEBUG_HXX
00003 
00004 /**************************************************************************
00005  *
00006  * Copyright (C) 2008, Johns Hopkins University.
00007  * All rights reserved.
00008  *
00009  * Redistribution and use in source and binary forms, with or
00010  * without modification, are permitted provided that the following
00011  * conditions are met:
00012  *
00013  *   - Redistributions of source code must contain the above
00014  *     copyright notice, this list of conditions, and the following
00015  *     disclaimer.
00016  *
00017  *   - Redistributions in binary form must reproduce the above
00018  *     copyright notice, this list of conditions, and the following
00019  *     disclaimer in the documentation and/or other materials
00020  *     provided with the distribution.
00021  *
00022  *   - Neither the names of the copyright holders nor the names of any
00023  *     of any contributors may be used to endorse or promote products
00024  *     derived from this software without specific prior written
00025  *     permission.
00026  *
00027  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00028  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00029  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00030  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00031  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00032  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00033  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00034  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00035  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00036  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00037  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038  *
00039  **************************************************************************/
00040 
00041 #include <assert.h>
00042 
00043 #define DEBUG_ON  if (1)
00044 #define DEBUG_OFF if (0)
00045 #define DEBUG_VERBOSE true
00046 
00047 #define dbg_all           ~0u
00048 
00049 #define dbg_BEG_SIMP    0x00000001u
00050 #define dbg_METH_DECL   0x00000002u
00051 #define dbg_ILH         0x00000004u   // Inst-Lambda-Hoist
00052 #define dbg_INST        0x00000008u   // Debug Polyinstantiation
00053 #define dbg_INST_ENV    0x00000010u   // Debug Polyinstantiator's env-handling
00054 #define dbg_REPR_SIMP   0x00000020u
00055 #define dbg_UNION_INF   0x00000040u
00056 #define dbg_DEF_INF     0x00000080u
00057 #define dbg_TI_TOP      0x00000100u   // Inference Top-Loop
00058 #define dbg_TI_UNITWISE 0x00000200u   // Print Inferred interface/module info
00059 #define dbg_TI_AST      0x00000400u   // Inference AST-wise output
00060 #define dbg_CLCONV      0x00000800u
00061 #define dbg_GEN_TL      0x00001000u   // Treat all generalization as local
00062 #define dbg_GEN         0x00002000u   // Debug Type Generalization
00063 #define dbg_INS         0x00004000u   // Debug Type Instantiation
00064 #define dbg_ID_INS      0x00008000u   // Debug Instantiation at at_ident
00065 #define dbg_SOL         0x00010000u   // Debug Constraint Solver
00066 #define dbg_SPSOL       0x00020000u   // Debug Solving Special constaints
00067 #define dbg_PCST        0x00040000u   // Debug Solving Polymorhic * constaints
00068 #define dbg_TCSOL       0x00080000u   // Debug Solving Type-class constaints
00069 #define dbg_UNIFY       0x00100000u   // Debug Unification
00070 #define dbg_UNF_RES     0x00200000u   // Debug Unification by showing Results
00071 #define dbg_TRAIL       0x00400000u   // Debug Type Linking
00072 #define dbg_TS_NORM     0x00800000u   // Debug TypeScheme Normalization
00073 #define dbg_TYPE_ACC    0x01000000u
00074 #define dbg_DEF_DECL    0x02000000u   // Debug Definition-Declaration consistency checking
00075 #define dbg_TC_INST     0x04000000u   // Concrete type class instantiation
00076 
00077 // #define dbg_flags         (dbg_INS|dbg_GEN|dbg_SOL|dbg_SPSOL|0u)
00078 #define dbg_flags         (0u)
00079 
00080 #define DEBUG_CND(x) ((dbg_flags) & (dbg_ ## x))
00081 #define DEBUG(x) if (DEBUG_CND(x))
00082 
00083 #endif /* DEBUG_HXX */

Generated on Sat Feb 4 23:59:28 2012 for BitC Compiler by  doxygen 1.4.7