summaryrefslogtreecommitdiff
path: root/src/expr
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2017-08-14 22:46:48 -0700
committerGitHub <noreply@github.com>2017-08-14 22:46:48 -0700
commit6432a16bd86c7540dad4ce5321ee68b7a7287c66 (patch)
tree4855efd77237c767a8a94f063e1f521d2b452ac0 /src/expr
parent779ca55f2802b2c77ea39d1c94a097a9761f544c (diff)
Minimize includes in expr.h: remove dups, iostream (#219)
Diffstat (limited to 'src/expr')
-rw-r--r--src/expr/expr_template.cpp3
-rw-r--r--src/expr/expr_template.h2
-rwxr-xr-xsrc/expr/mkexpr6
3 files changed, 8 insertions, 3 deletions
diff --git a/src/expr/expr_template.cpp b/src/expr/expr_template.cpp
index b0611ccbb..9fbdc81d6 100644
--- a/src/expr/expr_template.cpp
+++ b/src/expr/expr_template.cpp
@@ -15,6 +15,7 @@
**/
#include "expr/expr.h"
+#include <iostream>
#include <iterator>
#include <utility>
#include <vector>
@@ -31,7 +32,7 @@ ${includes}
// compiler directs the user to the template file instead of the
// generated one. We don't want the user to modify the generated one,
// since it'll get overwritten on a later build.
-#line 35 "${template}"
+#line 36 "${template}"
using namespace CVC4::kind;
using namespace std;
diff --git a/src/expr/expr_template.h b/src/expr/expr_template.h
index d2ad45dee..ead50c1ab 100644
--- a/src/expr/expr_template.h
+++ b/src/expr/expr_template.h
@@ -27,7 +27,7 @@ ${includes}
#define __CVC4__EXPR_H
#include <stdint.h>
-#include <iostream>
+#include <iosfwd>
#include <iterator>
#include <string>
#include <unordered_map>
diff --git a/src/expr/mkexpr b/src/expr/mkexpr
index 60ee758d8..010ec9a2e 100755
--- a/src/expr/mkexpr
+++ b/src/expr/mkexpr
@@ -218,8 +218,12 @@ function constant {
lineno=${BASH_LINENO[0]}
check_theory_seen
- includes="${includes}
+ # Only add include if it is not in the list of includes yet
+ if [[ "${includes}" != *"#include \"$4\""* ]]; then
+ includes="${includes}
#include \"$4\""
+ fi
+
mkConst_instantiations="${mkConst_instantiations}
#line $lineno \"$kf\"
template <> Expr ExprManager::mkConst($2 const& val);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback