Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: include/llvm/Bitcode/NaCl/NaClDebugging.h

Issue 14813032: Make abbreviations explicit in pnacl-freeze/thaw. (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Fix typos in CL Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698