summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/assert.h18
-rw-r--r--src/util/command.cpp5
-rw-r--r--src/util/command.h4
3 files changed, 15 insertions, 12 deletions
diff --git a/src/util/assert.h b/src/util/assert.h
index 4a164716c..8fd970c6c 100644
--- a/src/util/assert.h
+++ b/src/util/assert.h
@@ -57,17 +57,17 @@ public:
inline void AssertImpl(const char* info, bool cond, std::string msg) {
if(EXPECT_FALSE( ! cond ))
- throw new AssertionException(std::string(info) + "\n" + msg);
+ throw AssertionException(std::string(info) + "\n" + msg);
}
inline void AssertImpl(const char* info, bool cond, const char* msg) {
if(EXPECT_FALSE( ! cond ))
- throw new AssertionException(std::string(info) + "\n" + msg);
+ throw AssertionException(std::string(info) + "\n" + msg);
}
inline void AssertImpl(const char* info, bool cond) {
if(EXPECT_FALSE( ! cond ))
- throw new AssertionException(info);
+ throw AssertionException(info);
}
#ifdef __GNUC__
@@ -77,15 +77,15 @@ inline void UnreachableImpl(const char* info) __attribute__ ((noreturn));
#endif /* __GNUC__ */
inline void UnreachableImpl(const char* info, std::string msg) {
- throw new UnreachableCodeException(std::string(info) + "\n" + msg);
+ throw UnreachableCodeException(std::string(info) + "\n" + msg);
}
inline void UnreachableImpl(const char* info, const char* msg) {
- throw new UnreachableCodeException(std::string(info) + "\n" + msg);
+ throw UnreachableCodeException(std::string(info) + "\n" + msg);
}
inline void UnreachableImpl(const char* info) {
- throw new UnreachableCodeException(info);
+ throw UnreachableCodeException(info);
}
#ifdef __GNUC__
@@ -95,15 +95,15 @@ inline void UnhandledImpl(const char* info) __attribute__ ((noreturn));
#endif /* __GNUC__ */
inline void UnhandledImpl(const char* info, std::string msg) {
- throw new UnhandledCaseException(std::string(info) + "\n" + msg);
+ throw UnhandledCaseException(std::string(info) + "\n" + msg);
}
inline void UnhandledImpl(const char* info, const char* msg) {
- throw new UnhandledCaseException(std::string(info) + "\n" + msg);
+ throw UnhandledCaseException(std::string(info) + "\n" + msg);
}
inline void UnhandledImpl(const char* info) {
- throw new UnhandledCaseException(info);
+ throw UnhandledCaseException(info);
}
}/* CVC4 namespace */
diff --git a/src/util/command.cpp b/src/util/command.cpp
index e38695b46..961104585 100644
--- a/src/util/command.cpp
+++ b/src/util/command.cpp
@@ -19,7 +19,8 @@ ostream& operator<<(ostream& out, const CVC4::Command& c) {
namespace CVC4 {
-EmptyCommand::EmptyCommand() {
+EmptyCommand::EmptyCommand(std::string name) :
+ d_name(name) {
}
void EmptyCommand::invoke(SmtEngine* smt_engine) {
@@ -77,7 +78,7 @@ void CommandSequence::addCommand(Command* cmd) {
using namespace std;
void EmptyCommand::toString(ostream& out) const {
- out << "EmptyCommand";
+ out << "EmptyCommand(" << d_name << ")";
}
void AssertCommand::toString(ostream& out) const {
diff --git a/src/util/command.h b/src/util/command.h
index ce137896a..3d738ba45 100644
--- a/src/util/command.h
+++ b/src/util/command.h
@@ -38,9 +38,11 @@ public:
class CVC4_PUBLIC EmptyCommand : public Command {
public:
- EmptyCommand();
+ EmptyCommand(std::string name = "");
void invoke(CVC4::SmtEngine* smt_engine);
void toString(std::ostream& out) const;
+private:
+ std::string d_name;
};/* class EmptyCommand */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback