This PR removes any usage of the #line directive.
We no longer consider it particularly useful, and it obstructs reproducible builds (see #4980).
Fixes #4980.
${includes}
-// This is a hack, but an important one: if there's an error, the
-// 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 34 "${template}"
-
#ifdef CVC4_STATISTICS_ON
#define INC_STAT(kind) \
{ \
${includes}
-// This is a hack, but an important one: if there's an error, the
-// 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 36 "${template}"
-
namespace CVC4 {
namespace api {
${includes}
-// This is a hack, but an important one: if there's an error, the
-// 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 37 "${template}"
-
using namespace CVC4::kind;
using namespace std;
#include "options/language.h"
#include "util/hash.h"
-// This is a hack, but an important one: if there's an error, the
-// 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 47 "${template}"
-
namespace CVC4 {
// The internal expression representation
${getConst_instantiations}
-#line 625 "${template}"
-
inline size_t ExprHashFunction::operator()(CVC4::Expr e) const {
return (size_t) e.getId();
}
std::ostream& operator<<(std::ostream& out, TypeConstant typeConstant) {
switch(typeConstant) {
${type_constant_descriptions}
-#line 73 "${template}"
default:
out << "UNKNOWN_TYPE_CONSTANT";
break;
case kind::NULL_EXPR:
break;
${kind_to_theory_id}
-#line 89 "${template}"
case kind::LAST_KIND:
break;
}
switch (typeConstant)
{
${type_constant_to_theory_id}
-#line 101 "${template}"
case LAST_TYPE: break;
}
throw IllegalArgumentException(
*/
std::ostream& operator<<(std::ostream&, CVC4::Kind) CVC4_PUBLIC;
-#line 67 "${template}"
-
/** Returns true if the given kind is associative. This is used by ExprManager to
* decide whether it's safe to modify big expressions by changing the grouping of
* the arguments. */
enum CVC4_PUBLIC TypeConstant
{
${type_constant_list}
-#line 90 "${template}"
LAST_TYPE
}; /* enum TypeConstant */
}/* CVC4::kind namespace */
-#line 205 "${template}"
-
}/* CVC4 namespace */
#endif /* CVC4__NODE_MANAGER_NEEDS_CONSTANT_MAP */
lineno=${BASH_LINENO[0]}
check_theory_seen
typerules="${typerules}
-#line $lineno \"$kf\"
case kind::$1:
-#line $lineno \"$kf\"
typeNode = $2::computeType(nodeManager, n, check);
break;
"
lineno=${BASH_LINENO[0]}
check_theory_seen
construles="${construles}
-#line $lineno \"$kf\"
case kind::$1:
-#line $lineno \"$kf\"
return $2::computeIsConst(nodeManager, n);
"
}
fi
mkConst_instantiations="${mkConst_instantiations}
-#line $lineno \"$kf\"
template <> Expr ExprManager::mkConst($2 const& val);
"
mkConst_implementations="${mkConst_implementations}
-#line $lineno \"$kf\"
template <> Expr ExprManager::mkConst($2 const& val) {
-#line $lineno \"$kf\"
return Expr(this, new Node(d_nodeManager->mkConst< $2 >(val)));
}
"
getConst_instantiations="${getConst_instantiations}
-#line $lineno \"$kf\"
template <> $2 const & Expr::getConst< $2 >() const;
"
getConst_implementations="${getConst_implementations}
-#line $lineno \"$kf\"
template <> $2 const & Expr::getConst() const {
-#line $lineno \"$kf\"
PrettyCheckArgument(getKind() == ::CVC4::kind::$1, *this, \"Improper kind for getConst<$2>()\");
-#line $lineno \"$kf\"
return d_node->getConst< $2 >();
}
"
## output
-# generate warnings about incorrect #line annotations in templates
-nl -ba -s' ' "$template" | grep '^ *[0-9][0-9]* # *line' |
- awk '{OFS="";if($1+1!=$3) print "'"$template"':",$1,": warning: incorrect annotation \"#line ",$3,"\" (it should be \"#line ",($1+1),"\")"}' >&2
-
text=$(cat "$template")
for var in \
includes \
"
type_constant_to_theory_id="${type_constant_to_theory_id} case $id: return $theory_id;
"
- type_constant_cardinalities="${type_constant_cardinalities}#line $lineno \"$kf\"
+ type_constant_cardinalities="${type_constant_cardinalities}
case $id: return Cardinality($cardinality);
"
- type_constant_wellfoundednesses="${type_constant_wellfoundednesses}#line $lineno \"$kf\"
+ type_constant_wellfoundednesses="${type_constant_wellfoundednesses}
case $id: return $wellfoundedness;
"
if [ -n "$groundterm" ]; then
- type_constant_groundterms="${type_constant_groundterms}#line $lineno \"$kf\"
+ type_constant_groundterms="${type_constant_groundterms}
case $id: return $groundterm;
"
if [ -n "$header" ]; then
- type_properties_includes="${type_properties_includes}#line $lineno \"$kf\"
+ type_properties_includes="${type_properties_includes}
#include \"$header\"
"
fi
else
- type_constant_groundterms="${type_constant_groundterms}#line $lineno \"$kf\"
+ type_constant_groundterms="${type_constant_groundterms}
case $id: Unhandled() << tc;
"
fi
cardinality_computer=$(sed 's,%TYPE%,typeNode,g' <<<"$2")
header=$3
- type_cardinalities="${type_cardinalities}#line $lineno \"$kf\"
+ type_cardinalities="${type_cardinalities}
case $id: return $cardinality_computer;
"
if [ -n "$header" ]; then
- type_properties_includes="${type_properties_includes}#line $lineno \"$kf\"
+ type_properties_includes="${type_properties_includes}
#include \"$header\"
"
fi
fi
fi
- type_wellfoundednesses="${type_wellfoundednesses}#line $lineno \"$kf\"
+ type_wellfoundednesses="${type_wellfoundednesses}
case $id: return $wellfoundedness_computer;
"
if [ -n "$groundterm_computer" ]; then
- type_groundterms="${type_groundterms}#line $lineno \"$kf\"
+ type_groundterms="${type_groundterms}
case $id: return $groundterm_computer;
"
else
- type_groundterms="${type_groundterms}#line $lineno \"$kf\"
+ type_groundterms="${type_groundterms}
case $id: Unhandled() << typeNode;
"
fi
if [ -n "$header" ]; then
- type_properties_includes="${type_properties_includes}#line $lineno \"$kf\"
+ type_properties_includes="${type_properties_includes}
#include \"$header\"
"
fi
## output
-# generate warnings about incorrect #line annotations in templates
-nl -ba -s' ' "$template" | grep '^ *[0-9][0-9]* # *line' |
- awk '{OFS="";if($1+1!=$3) print "'"$template"':",$1,": warning: incorrect annotation \"#line ",$3,"\" (it should be \"#line ",($1+1),"\")"}' >&2
-
text=$(cat "$template")
for var in \
kind_decls \
"
metakind_constHashes="${metakind_constHashes}
case kind::$1:
-#line $lineno \"$kf\"
return $3()(nv->getConst< $2 >());
"
metakind_constPrinters="${metakind_constPrinters}
case kind::$1:
-#line $lineno \"$kf\"
out << nv->getConst< $2 >();
break;
"
cname=`echo "$2" | awk 'BEGIN {FS="::"} {print$NF}'`
metakind_constDeleters="${metakind_constDeleters}
case kind::$1:
-#line $lineno \"$kf\"
std::allocator< $2 >().destroy(reinterpret_cast< $2* >(nv->d_children));
break;
"
operatorKind=$1
applyKind=$2
metakind_operatorKinds="${metakind_operatorKinds}
-#line $lineno \"$kf\"
case kind::$applyKind: return kind::$operatorKind;";
}
## output
-# generate warnings about incorrect #line annotations in templates
-nl -ba -s' ' "$template" | grep '^ *[0-9][0-9]* # *line' |
- awk '{OFS="";if($1+1!=$3) print "'"$template"':",$1,": warning: incorrect annotation \"#line ",$3,"\" (it should be \"#line ",($1+1),"\")"}' >&2
-
text=$(cat "$template")
for var in \
metakind_includes \
** TypeChecker implementation.
**/
-#line 18 "${template}"
-
#include "expr/node_manager.h"
#include "expr/node_manager_attributes.h"
#include "expr/type_checker.h"
${typechecker_includes}
-#line 27 "${template}"
-
namespace CVC4 {
namespace expr {
${typerules}
-#line 48 "${template}"
-
default:
Debug("getType") << "FAILURE" << std::endl;
Unhandled() << n.getKind();
switch(n.getKind()) {
${construles}
-#line 72 "${template}"
-
default:;
}
#ifndef CVC4__TYPE_PROPERTIES_H
#define CVC4__TYPE_PROPERTIES_H
-#line 23 "${template}"
-
#include <sstream>
#include "base/check.h"
${type_properties_includes}
-#line 35 "${template}"
-
namespace CVC4 {
namespace kind {
switch (tc)
{
${type_constant_cardinalities}
-#line 51 "${template}"
default: InternalError() << "No cardinality known for type constant " << tc;
}
} /* getCardinality(TypeConstant) */
case TYPE_CONSTANT:
return getCardinality(typeNode.getConst<TypeConstant>());
${type_cardinalities}
-#line 68 "${template}"
default:
InternalError() << "A theory kinds file did not provide a cardinality "
<< "or cardinality computer for type:\n"
inline bool isWellFounded(TypeConstant tc) {
switch(tc) {
${type_constant_wellfoundednesses}
-#line 79 "${template}"
default:
InternalError() << "No well-foundedness status known for type constant: "
<< tc;
case TYPE_CONSTANT:
return isWellFounded(typeNode.getConst<TypeConstant>());
${type_wellfoundednesses}
-#line 92 "${template}"
default:
InternalError() << "A theory kinds file did not provide a well-foundedness "
<< "or well-foundedness computer for type:\n"
switch (tc)
{
${type_constant_groundterms}
-#line 105 "${template}"
default:
InternalError() << "No ground term known for type constant: " << tc;
}
case TYPE_CONSTANT:
return mkGroundTerm(typeNode.getConst<TypeConstant>());
${type_groundterms}
-#line 119 "${template}"
default:
InternalError() << "A theory kinds file did not provide a ground term "
<< "or ground term computer for type:\n"
## output
-# generate warnings about incorrect #line annotations in templates
-nl -ba -s' ' "$template" | grep '^ *[0-9][0-9]* # *line' |
- awk '{OFS="";if($1+1!=$3) print "'"$template"':",$1,": warning: incorrect annotation \"#line ",$3,"\" (it should be \"#line ",($1+1),"\")"}' >&2
-
text=$(cat "$template")
for var in \
rewriter_includes \
lineno=${BASH_LINENO[0]}
check_theory_seen
type_enumerator_includes="${type_enumerator_includes}
-#line $lineno \"$kf\"
#include \"$3\""
if expr "$type_constants" : '.* '"$1"' ' &>/dev/null; then
mk_type_enumerator_type_constant_cases="${mk_type_enumerator_type_constant_cases}
-#line $lineno \"$kf\"
case $1:
-#line $lineno \"$kf\"
return new $2(type, tep);
"
elif expr "$type_kinds" : '.* '"$1"' ' &>/dev/null; then
mk_type_enumerator_cases="${mk_type_enumerator_cases}
-#line $lineno \"$kf\"
case kind::$1:
-#line $lineno \"$kf\"
return new $2(type, tep);
"
else
eval "theory_constructors=\"$theory_constructors\""
-# generate warnings about incorrect #line annotations in templates
-nl -ba -s' ' "$template" | grep '^ *[0-9][0-9]* # *line' |
- awk '{OFS="";if($1+1!=$3) print "'"$template"':",$1,": warning: incorrect annotation \"#line ",$3,"\" (it should be \"#line ",($1+1),"\")"}' >&2
-
text=$(cat "$template")
for var in \
theory_traits \
${theory_traits}
-#line 38 "${template}"
-
struct TheoryConstructor {
static void addTheory(TheoryEngine* engine, TheoryId id) {
switch(id) {
${type_enumerator_includes}
-#line 26 "${template}"
using namespace std;
}
Unreachable();
${mk_type_enumerator_cases}
-#line 46 "${template}"
default: Unhandled() << "No type enumerator for type `" << type << "'";
}
Unreachable();