Chromium Code Reviews| Index: include/llvm/Bitcode/NaCl/NaClDebugging.h |
| diff --git a/include/llvm/Bitcode/NaCl/NaClDebugging.h b/include/llvm/Bitcode/NaCl/NaClDebugging.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..610c289f9e8c2e2541cf411cdbc97b657dc58124 |
| --- /dev/null |
| +++ b/include/llvm/Bitcode/NaCl/NaClDebugging.h |
| @@ -0,0 +1,50 @@ |
| +//===-- llvm/Bitcode/NaCl/NaClDebugging.h - ---------------------*- C++ -*-===// |
| +// Debugging utilites. |
| +// |
| +// The LLVM Compiler Infrastructure |
| +// |
| +// This file is distributed under the University of Illinois Open Source |
| +// License. See LICENSE.TXT for details. |
| +// |
| +//===----------------------------------------------------------------------===// |
| + |
| +/* Define simple debugging utilities that are turned on/off by the |
| + * value of the define flag NACL_DEBUGGING. |
| + * |
| + * To turn on debugging of instruction decoding, change value of |
|
jvoung (off chromium)
2013/05/14 23:47:14
We shouldn't need our own debugging utils?
llvm h
Karl
2013/05/17 20:52:18
Removed and using llvm debug.h
|
| + * NACL_DEBUGGING to 1. |
| + * |
| + */ |
| + |
| +#ifndef LLVM_BITCODE_NACL_NACLDEBUGGING_H |
| +#define LLVM_BITCODE_NACL_NACLDEBUGGING_H |
| + |
| +/* Turn off debugging if not otherwise specified in the specific code file. */ |
| +#ifndef NACL_DEBUGGING |
| +#define NACL_DEBUGGING 0 |
| +#endif |
| + |
| +#if NACL_DEBUGGING |
| +/* Defines to execute statement(s) s if in NACL_DEBUGGING mode, and compile |
| + * in either mode. This allows type checking to be applied at all times. |
| + */ |
| +#define NACL_DEBUG(s) s |
| +#else |
| +/* Defines to compile but not include statement(s) s if not |
| + * in NACL_DEBUGGING mode. |
| + */ |
| +#define NACL_DEBUG(s) do { if (0) { s; } } while (0) |
| +#endif |
| + |
| +#if NACL_DEBUGGING |
| +/* Defines to compile execute statement(s) if in NACL_DEBUGGING mode. |
| + * Erases otherwise. This should only be used when linking |
| + * would otherwise require the symbol when NACL_DEBUGGING is false. |
| +*/ |
| +#define NACL_DEBUG_OR_ERASE(s) s |
| +#else |
| +/* Defines to erase s if not in NACL_DEBUGGING mode. */ |
| +#define NACL_DEBUG_OR_ERASE(s) |
| +#endif |
| + |
| +#endif |