From: Andres Noetzli Date: Tue, 15 Aug 2017 05:46:48 +0000 (-0700) Subject: Minimize includes in expr.h: remove dups, iostream (#219) X-Git-Tag: cvc5-1.0.0~5676 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6432a16bd86c7540dad4ce5321ee68b7a7287c66;p=cvc5.git Minimize includes in expr.h: remove dups, iostream (#219) --- 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 #include #include #include @@ -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 -#include +#include #include #include #include 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);