summaryrefslogtreecommitdiff
path: root/src/util/debug.h
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2009-11-17 17:09:13 +0000
committerMorgan Deters <mdeters@gmail.com>2009-11-17 17:09:13 +0000
commit105503064be6a198dd864d1e95d6d79e1af51d25 (patch)
tree040d1dfc2d696c2efef84cf2cb044072d97a337a /src/util/debug.h
parent61330b862f7b5565f70e3c1f4d26a8c51a0f534a (diff)
from meeting
Diffstat (limited to 'src/util/debug.h')
-rw-r--r--src/util/debug.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/util/debug.h b/src/util/debug.h
new file mode 100644
index 000000000..36942d1ae
--- /dev/null
+++ b/src/util/debug.h
@@ -0,0 +1,26 @@
+/********************* -*- C++ -*- */
+/** debug.h
+ ** This file is part of the CVC4 prototype.
+ ** Copyright (c) 2009 The Analysis of Computer Systems Group (ACSys)
+ ** Courant Institute of Mathematical Sciences
+ ** New York University
+ ** See the file COPYING in the top-level source directory for licensing
+ ** information.
+ **
+ **/
+
+#ifndef __CVC4_DEBUG_H
+#define __CVC4_DEBUG_H
+
+#include <cassert>
+
+#ifdef DEBUG
+// the __builtin_expect() helps us if assert is built-in or a macro
+# define cvc4assert(x) assert(__builtin_expect((x), 1))
+#else
+// TODO: use a compiler annotation when assertions are off ?
+// (to improve optimization)
+# define cvc4assert(x)
+#endif /* DEBUG */
+
+#endif /* __CVC4_DEBUG_H */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback