diff options
author | Gereon Kremer <gereon.kremer@cs.rwth-aachen.de> | 2021-03-03 17:50:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-03 16:50:45 +0000 |
commit | a02a794c383ae2381e1210f53174cefb8d94e615 (patch) | |
tree | 0eac511c22ba9eeba1925e3afa4f0542edf5cf60 /src/base | |
parent | 6db84f6e373f9651af48df7b654e3992f68472ac (diff) |
More cleanup of includes to reduce compilation times (#6037)
Similar to #6031, this PR implements suggestions from iwyu to reduce the number of includes in header files by introducing forward declarations and moving includes to source files.
Diffstat (limited to 'src/base')
-rw-r--r-- | src/base/exception.cpp | 8 | ||||
-rw-r--r-- | src/base/exception.h | 11 | ||||
-rw-r--r-- | src/base/listener.cpp | 4 |
3 files changed, 9 insertions, 14 deletions
diff --git a/src/base/exception.cpp b/src/base/exception.cpp index cddef79fd..ad50ec351 100644 --- a/src/base/exception.cpp +++ b/src/base/exception.cpp @@ -20,6 +20,7 @@ #include <cstdio> #include <cstdlib> #include <cstring> +#include <sstream> #include <string> #include "base/check.h" @@ -28,6 +29,13 @@ using namespace std; namespace CVC4 { +std::string Exception::toString() const +{ + std::stringstream ss; + toStream(ss); + return ss.str(); +} + thread_local LastExceptionBuffer* LastExceptionBuffer::s_currentBuffer = nullptr; LastExceptionBuffer::LastExceptionBuffer() : d_contents(nullptr) {} diff --git a/src/base/exception.h b/src/base/exception.h index 8a89c99fc..815e4011f 100644 --- a/src/base/exception.h +++ b/src/base/exception.h @@ -19,12 +19,8 @@ #ifndef CVC4__EXCEPTION_H #define CVC4__EXCEPTION_H -#include <cstdarg> -#include <cstdlib> #include <exception> #include <iosfwd> -#include <sstream> -#include <stdexcept> #include <string> namespace CVC4 { @@ -61,12 +57,7 @@ class CVC4_PUBLIC Exception : public std::exception { * toString(), there is no stream, so the parameters are default * and you'll get exprs and types printed using the AST language. */ - std::string toString() const - { - std::stringstream ss; - toStream(ss); - return ss.str(); - } + std::string toString() const; /** * Printing: feel free to redefine toStream(). When overridden in diff --git a/src/base/listener.cpp b/src/base/listener.cpp index 72f9ee086..6e9d659fd 100644 --- a/src/base/listener.cpp +++ b/src/base/listener.cpp @@ -16,10 +16,6 @@ #include "base/listener.h" -#include <list> - -#include "base/check.h" - namespace CVC4 { Listener::Listener(){} |