summaryrefslogtreecommitdiff
path: root/src/util/Assert.h
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2011-04-18 08:59:09 +0000
committerMorgan Deters <mdeters@gmail.com>2011-04-18 08:59:09 +0000
commitb90081962840584bb9eeda368ea232a7d42a292b (patch)
treec0f568bc787744a5d53b79a818c0f1bd819596cf /src/util/Assert.h
parent7d281fba79b1c9f3ae646d3371a0e52e2efd3bba (diff)
Partial merge from datatypes-merge branch:
1. Defines a new type "DatatypeType", a type-constant that holds a Datatype, describing an inductive data type. 2. CVC language parser supports datatypes. 3. CVC language printer now functional. 4. Minor other cleanups. No performance impact is expected outside of datatypes. I'm verifying that that is the case with a cluster job this morning.
Diffstat (limited to 'src/util/Assert.h')
-rw-r--r--src/util/Assert.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/util/Assert.h b/src/util/Assert.h
index 5bb2e830f..ec942e00b 100644
--- a/src/util/Assert.h
+++ b/src/util/Assert.h
@@ -5,7 +5,7 @@
** Major contributors: none
** Minor contributors (to current version): acsys
** This file is part of the CVC4 prototype.
- ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys)
+ ** Copyright (c) 2009, 2010, 2011 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
@@ -200,6 +200,29 @@ public:
}
};/* class IllegalArgumentException */
+class CVC4_PUBLIC InternalErrorException : public AssertionException {
+protected:
+ InternalErrorException() : AssertionException() {}
+
+public:
+ InternalErrorException(const char* function, const char* file, unsigned line) :
+ AssertionException() {
+ construct("Internal error detected", "",
+ function, file, line);
+ }
+
+ InternalErrorException(const char* function, const char* file, unsigned line,
+ const char* fmt, ...) :
+ AssertionException() {
+ va_list args;
+ va_start(args, fmt);
+ construct("Internal error detected", "",
+ function, file, line, fmt, args);
+ va_end(args);
+ }
+
+};/* class InternalErrorException */
+
#ifdef CVC4_DEBUG
#ifdef CVC4_DEBUG
@@ -249,6 +272,8 @@ void debugAssertionFailed(const AssertionException& thisException,
throw UnhandledCaseException(__PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg)
#define Unimplemented(msg...) \
throw UnimplementedOperationException(__PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg)
+#define InternalError(msg...) \
+ throw InternalErrorException(__PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg)
#define IllegalArgument(arg, msg...) \
throw IllegalArgumentException(#arg, __PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg)
#define CheckArgument(cond, arg, msg...) \
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback