summaryrefslogtreecommitdiffstats
path: root/polly/lib/JSON/json_value.cpp
diff options
context:
space:
mode:
authorHongbin Zheng <etherzhhb@gmail.com>2011-04-30 02:47:34 +0000
committerHongbin Zheng <etherzhhb@gmail.com>2011-04-30 02:47:34 +0000
commitad6915685e6c7686091cc8fbad6a51eb804ac680 (patch)
tree50a7d2659a055e0320d64668b68901ae6d2becfa /polly/lib/JSON/json_value.cpp
parent986fee0055e2eb5f0c56604e694fd2a6a808e404 (diff)
downloadbcm5719-llvm-ad6915685e6c7686091cc8fbad6a51eb804ac680.tar.gz
bcm5719-llvm-ad6915685e6c7686091cc8fbad6a51eb804ac680.zip
JSON: Do not use throw when exception is disabled.
llvm-svn: 130575
Diffstat (limited to 'polly/lib/JSON/json_value.cpp')
-rw-r--r--polly/lib/JSON/json_value.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/polly/lib/JSON/json_value.cpp b/polly/lib/JSON/json_value.cpp
index 573205f13e2..34acce947ce 100644
--- a/polly/lib/JSON/json_value.cpp
+++ b/polly/lib/JSON/json_value.cpp
@@ -15,7 +15,12 @@
#define JSON_ASSERT_UNREACHABLE assert( false )
#define JSON_ASSERT( condition ) assert( condition ); // @todo <= change this into an exception throw
-#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) throw std::runtime_error( message );
+// Do not use throw when exception is disable.
+#if JSON_USE_EXCEPTION
+# define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) throw std::runtime_error( message );
+#else
+# define JSON_ASSERT_MESSAGE( condition, message ) JSON_ASSERT( condition ) // @todo <= provide the message
+#endif
namespace Json {
OpenPOWER on IntegriCloud