1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606
|
Description: Remove build path from generated header files
Author: Fabian Wolff <fabi.wolff@arcor.de>
Forwarded: https://github.com/CVC4/CVC4/pull/4980
Last-Update: 2020-08-31
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/expr/mkexpr
+++ b/src/expr/mkexpr
@@ -18,6 +18,7 @@
copyright=2010-2014
filename=`basename "$1" | sed 's,_template,,'`
+template_rel="<CVC4>/"$(realpath --relative-to $CMAKE_SOURCE_DIR $1)
cat <<EOF
/********************* */
@@ -26,10 +27,7 @@
** Copyright $copyright New York University and The University of Iowa,
** and as below.
**
- ** This file automatically generated by:
- **
- ** $0 $@
- **
+ ** This file automatically generated
** for the CVC4 project.
**/
@@ -48,7 +46,7 @@
/* THIS FILE IS AUTOMATICALLY GENERATED, DO NOT EDIT ! */
/* Edit the template file instead: */
-/* $1 */
+/* $template_rel */
EOF
@@ -150,9 +148,9 @@
lineno=${BASH_LINENO[0]}
check_theory_seen
typerules="${typerules}
-#line $lineno \"$kf\"
+#line $lineno \"$kf_rel\"
case kind::$1:
-#line $lineno \"$kf\"
+#line $lineno \"$kf_rel\"
typeNode = $2::computeType(nodeManager, n, check);
break;
"
@@ -163,9 +161,9 @@
lineno=${BASH_LINENO[0]}
check_theory_seen
construles="${construles}
-#line $lineno \"$kf\"
+#line $lineno \"$kf_rel\"
case kind::$1:
-#line $lineno \"$kf\"
+#line $lineno \"$kf_rel\"
return $2::computeIsConst(nodeManager, n);
"
}
@@ -218,26 +216,26 @@
fi
mkConst_instantiations="${mkConst_instantiations}
-#line $lineno \"$kf\"
+#line $lineno \"$kf_rel\"
template <> Expr ExprManager::mkConst($2 const& val);
"
mkConst_implementations="${mkConst_implementations}
-#line $lineno \"$kf\"
+#line $lineno \"$kf_rel\"
template <> Expr ExprManager::mkConst($2 const& val) {
-#line $lineno \"$kf\"
+#line $lineno \"$kf_rel \"
return Expr(this, new Node(d_nodeManager->mkConst< $2 >(val)));
}
"
getConst_instantiations="${getConst_instantiations}
-#line $lineno \"$kf\"
+#line $lineno \"$kf_rel\"
template <> $2 const & Expr::getConst< $2 >() const;
"
getConst_implementations="${getConst_implementations}
-#line $lineno \"$kf\"
+#line $lineno \"$kf_rel\"
template <> $2 const & Expr::getConst() const {
-#line $lineno \"$kf\"
+#line $lineno \"$kf_rel\"
PrettyCheckArgument(getKind() == ::CVC4::kind::$1, *this, \"Improper kind for getConst<$2>()\");
-#line $lineno \"$kf\"
+#line $lineno \"$kf_rel\"
return d_node->getConst< $2 >();
}
"
@@ -270,6 +268,7 @@
while [ $# -gt 0 ]; do
kf=$1
+ kf_rel="<CVC4>/"$(realpath --relative-to "$CMAKE_SOURCE_DIR" $kf)
seen_theory=false
seen_endtheory=false
b=$(basename $(dirname "$kf"))
@@ -295,7 +294,7 @@
text=$(cat "$template")
for var in \
includes \
- template \
+ template_rel \
getConst_instantiations \
getConst_implementations \
mkConst_instantiations \
--- a/src/expr/mkkind
+++ b/src/expr/mkkind
@@ -17,6 +17,7 @@
copyright=2010-2014
filename=`basename "$1" | sed 's,_template,,'`
+template_rel="<CVC4>/"$(realpath --relative-to $CMAKE_SOURCE_DIR $1)
cat <<EOF
/********************* */
@@ -25,10 +26,7 @@
** Copyright $copyright New York University and The University of Iowa,
** and as below.
**
- ** This header file automatically generated by:
- **
- ** $0 $@
- **
+ ** This header file automatically generated
** for the CVC4 project.
**/
@@ -47,7 +45,7 @@
/* THIS FILE IS AUTOMATICALLY GENERATED, DO NOT EDIT ! */
/* Edit the template file instead: */
-/* $1 */
+/* $template_rel */
EOF
@@ -257,23 +255,23 @@
"
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}#line $lineno \"$kf_rel\"
case $id: return Cardinality($cardinality);
"
- type_constant_wellfoundednesses="${type_constant_wellfoundednesses}#line $lineno \"$kf\"
+ type_constant_wellfoundednesses="${type_constant_wellfoundednesses}#line $lineno \"$kf_rel\"
case $id: return $wellfoundedness;
"
if [ -n "$groundterm" ]; then
- type_constant_groundterms="${type_constant_groundterms}#line $lineno \"$kf\"
+ type_constant_groundterms="${type_constant_groundterms}#line $lineno \"$kf_rel\"
case $id: return $groundterm;
"
if [ -n "$header" ]; then
- type_properties_includes="${type_properties_includes}#line $lineno \"$kf\"
+ type_properties_includes="${type_properties_includes}#line $lineno \"$kf_rel\"
#include \"$header\"
"
fi
else
- type_constant_groundterms="${type_constant_groundterms}#line $lineno \"$kf\"
+ type_constant_groundterms="${type_constant_groundterms}#line $lineno \"$kf_rel\"
case $id: Unhandled() << tc;
"
fi
@@ -284,11 +282,11 @@
cardinality_computer=$(sed 's,%TYPE%,typeNode,g' <<<"$2")
header=$3
- type_cardinalities="${type_cardinalities}#line $lineno \"$kf\"
+ type_cardinalities="${type_cardinalities}#line $lineno \"$kf_rel\"
case $id: return $cardinality_computer;
"
if [ -n "$header" ]; then
- type_properties_includes="${type_properties_includes}#line $lineno \"$kf\"
+ type_properties_includes="${type_properties_includes}#line $lineno \"$kf_rel\"
#include \"$header\"
"
fi
@@ -314,20 +312,20 @@
fi
fi
- type_wellfoundednesses="${type_wellfoundednesses}#line $lineno \"$kf\"
+ type_wellfoundednesses="${type_wellfoundednesses}#line $lineno \"$kf_rel\"
case $id: return $wellfoundedness_computer;
"
if [ -n "$groundterm_computer" ]; then
- type_groundterms="${type_groundterms}#line $lineno \"$kf\"
+ type_groundterms="${type_groundterms}#line $lineno \"$kf_rel\"
case $id: return $groundterm_computer;
"
else
- type_groundterms="${type_groundterms}#line $lineno \"$kf\"
+ type_groundterms="${type_groundterms}#line $lineno \"$kf_rel\"
case $id: Unhandled() << typeNode;
"
fi
if [ -n "$header" ]; then
- type_properties_includes="${type_properties_includes}#line $lineno \"$kf\"
+ type_properties_includes="${type_properties_includes}#line $lineno \"$kf_rel\"
#include \"$header\"
"
fi
@@ -366,6 +364,7 @@
while [ $# -gt 0 ]; do
kf=$1
+ kf_rel="<CVC4>/"$(realpath --relative-to "$CMAKE_SOURCE_DIR" $kf)
seen_theory=false
seen_endtheory=false
b=$(basename $(dirname "$kf"))
@@ -409,7 +408,7 @@
type_groundterms \
type_constant_groundterms \
type_properties_includes \
- template \
+ template_rel \
; do
eval text="\${text//\\\$\\{$var\\}/\${$var}}"
done
--- a/src/expr/mkmetakind
+++ b/src/expr/mkmetakind
@@ -18,6 +18,7 @@
#
copyright=2010-2014
+template_rel="<CVC4>/"$(realpath --relative-to $CMAKE_SOURCE_DIR $1)
cat <<EOF
/********************* */
@@ -26,10 +27,7 @@
** Copyright $copyright New York University and The University of Iowa,
** and as below.
**
- ** This header file automatically generated by:
- **
- ** $0 $@
- **
+ ** This header file automatically generated
** for the CVC4 project.
**/
@@ -270,19 +268,19 @@
"
metakind_constHashes="${metakind_constHashes}
case kind::$1:
-#line $lineno \"$kf\"
+#line $lineno \"$kf_rel\"
return $3()(nv->getConst< $2 >());
"
metakind_constPrinters="${metakind_constPrinters}
case kind::$1:
-#line $lineno \"$kf\"
+#line $lineno \"$kf_rel\"
out << nv->getConst< $2 >();
break;
"
cname=`echo "$2" | awk 'BEGIN {FS="::"} {print$NF}'`
metakind_constDeleters="${metakind_constDeleters}
case kind::$1:
-#line $lineno \"$kf\"
+#line $lineno \"$kf_rel\"
std::allocator< $2 >().destroy(reinterpret_cast< $2* >(nv->d_children));
break;
"
@@ -301,7 +299,7 @@
operatorKind=$1
applyKind=$2
metakind_operatorKinds="${metakind_operatorKinds}
-#line $lineno \"$kf\"
+#line $lineno \"$kf_rel\"
case kind::$applyKind: return kind::$operatorKind;";
}
@@ -372,6 +370,7 @@
while [ $# -gt 0 ]; do
kf=$1
+ kf_rel="<CVC4>/"$(realpath --relative-to "$CMAKE_SOURCE_DIR" $kf)
seen_theory=false
seen_endtheory=false
b=$(basename $(dirname "$kf"))
@@ -414,7 +413,7 @@
metakind_ubchildren \
metakind_lbchildren \
metakind_operatorKinds \
- template \
+ template_rel \
; do
eval text="\${text//\\\$\\{$var\\}/\${$var}}"
done
--- a/src/expr/CMakeLists.txt
+++ b/src/expr/CMakeLists.txt
@@ -115,6 +115,7 @@
add_custom_command(
OUTPUT kind.h
COMMAND
+ ${CMAKE_COMMAND} -E env CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}
${mkkind_script}
${CMAKE_CURRENT_LIST_DIR}/kind_template.h
${KINDS_FILES}
@@ -125,6 +126,7 @@
add_custom_command(
OUTPUT kind.cpp
COMMAND
+ ${CMAKE_COMMAND} -E env CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}
${mkkind_script}
${CMAKE_CURRENT_LIST_DIR}/kind_template.cpp
${KINDS_FILES}
@@ -135,6 +137,7 @@
add_custom_command(
OUTPUT type_properties.h
COMMAND
+ ${CMAKE_COMMAND} -E env CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}
${mkkind_script}
${CMAKE_CURRENT_LIST_DIR}/type_properties_template.h
${KINDS_FILES}
@@ -145,6 +148,7 @@
add_custom_command(
OUTPUT metakind.h
COMMAND
+ ${CMAKE_COMMAND} -E env CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}
${mkmetakind_script}
${CMAKE_CURRENT_LIST_DIR}/metakind_template.h
${KINDS_FILES}
@@ -155,6 +159,7 @@
add_custom_command(
OUTPUT metakind.cpp
COMMAND
+ ${CMAKE_COMMAND} -E env CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}
${mkmetakind_script}
${CMAKE_CURRENT_LIST_DIR}/metakind_template.cpp
${KINDS_FILES}
@@ -165,6 +170,7 @@
add_custom_command(
OUTPUT expr.h
COMMAND
+ ${CMAKE_COMMAND} -E env CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}
${mkexpr_script}
${CMAKE_CURRENT_LIST_DIR}/expr_template.h
${KINDS_FILES}
@@ -175,6 +181,7 @@
add_custom_command(
OUTPUT expr.cpp
COMMAND
+ ${CMAKE_COMMAND} -E env CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}
${mkexpr_script}
${CMAKE_CURRENT_LIST_DIR}/expr_template.cpp
${KINDS_FILES}
@@ -185,6 +192,7 @@
add_custom_command(
OUTPUT expr_manager.h
COMMAND
+ ${CMAKE_COMMAND} -E env CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}
${mkexpr_script}
${CMAKE_CURRENT_LIST_DIR}/expr_manager_template.h
${KINDS_FILES}
@@ -195,6 +203,7 @@
add_custom_command(
OUTPUT expr_manager.cpp
COMMAND
+ ${CMAKE_COMMAND} -E env CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}
${mkexpr_script}
${CMAKE_CURRENT_LIST_DIR}/expr_manager_template.cpp
${KINDS_FILES}
@@ -205,6 +214,7 @@
add_custom_command(
OUTPUT type_checker.cpp
COMMAND
+ ${CMAKE_COMMAND} -E env CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}
${mkexpr_script}
${CMAKE_CURRENT_LIST_DIR}/type_checker_template.cpp
${KINDS_FILES}
--- a/src/expr/expr_template.cpp
+++ b/src/expr/expr_template.cpp
@@ -33,7 +33,7 @@
// 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}"
+#line 37 "${template_rel}"
using namespace CVC4::kind;
using namespace std;
--- a/src/expr/expr_template.h
+++ b/src/expr/expr_template.h
@@ -43,7 +43,7 @@
// 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}"
+#line 47 "${template_rel}"
namespace CVC4 {
@@ -621,7 +621,7 @@
${getConst_instantiations}
-#line 625 "${template}"
+#line 625 "${template_rel}"
inline size_t ExprHashFunction::operator()(CVC4::Expr e) const {
return (size_t) e.getId();
--- a/src/expr/expr_manager_template.cpp
+++ b/src/expr/expr_manager_template.cpp
@@ -30,7 +30,7 @@
// 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}"
+#line 34 "${template_rel}"
#ifdef CVC4_STATISTICS_ON
#define INC_STAT(kind) \
--- a/src/expr/expr_manager_template.h
+++ b/src/expr/expr_manager_template.h
@@ -32,7 +32,7 @@
// 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}"
+#line 36 "${template_rel}"
namespace CVC4 {
--- a/src/expr/kind_template.cpp
+++ b/src/expr/kind_template.cpp
@@ -69,7 +69,7 @@
std::ostream& operator<<(std::ostream& out, TypeConstant typeConstant) {
switch(typeConstant) {
${type_constant_descriptions}
-#line 73 "${template}"
+#line 73 "${template_rel}"
default:
out << "UNKNOWN_TYPE_CONSTANT";
break;
@@ -85,7 +85,7 @@
case kind::NULL_EXPR:
break;
${kind_to_theory_id}
-#line 89 "${template}"
+#line 89 "${template_rel}"
case kind::LAST_KIND:
break;
}
@@ -97,7 +97,7 @@
switch (typeConstant)
{
${type_constant_to_theory_id}
-#line 101 "${template}"
+#line 101 "${template_rel}"
case LAST_TYPE: break;
}
throw IllegalArgumentException(
--- a/src/expr/kind_template.h
+++ b/src/expr/kind_template.h
@@ -63,7 +63,7 @@
*/
std::ostream& operator<<(std::ostream&, CVC4::Kind) CVC4_PUBLIC;
-#line 67 "${template}"
+#line 67 "${template_rel}"
/** 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
@@ -86,7 +86,7 @@
enum CVC4_PUBLIC TypeConstant
{
${type_constant_list}
-#line 90 "${template}"
+#line 90 "${template_rel}"
LAST_TYPE
}; /* enum TypeConstant */
--- a/src/expr/metakind_template.h
+++ b/src/expr/metakind_template.h
@@ -201,7 +201,7 @@
}/* CVC4::kind namespace */
-#line 205 "${template}"
+#line 205 "${template_rel}"
}/* CVC4 namespace */
--- a/src/expr/type_checker_template.cpp
+++ b/src/expr/type_checker_template.cpp
@@ -14,7 +14,7 @@
** TypeChecker implementation.
**/
-#line 18 "${template}"
+#line 18 "${template_rel}"
#include "expr/node_manager.h"
#include "expr/node_manager_attributes.h"
@@ -23,7 +23,7 @@
${typechecker_includes}
-#line 27 "${template}"
+#line 27 "${template_rel}"
namespace CVC4 {
namespace expr {
@@ -44,7 +44,7 @@
${typerules}
-#line 48 "${template}"
+#line 48 "${template_rel}"
default:
Debug("getType") << "FAILURE" << std::endl;
@@ -68,7 +68,7 @@
switch(n.getKind()) {
${construles}
-#line 72 "${template}"
+#line 72 "${template_rel}"
default:;
}
--- a/src/expr/type_properties_template.h
+++ b/src/expr/type_properties_template.h
@@ -19,7 +19,7 @@
#ifndef CVC4__TYPE_PROPERTIES_H
#define CVC4__TYPE_PROPERTIES_H
-#line 23 "${template}"
+#line 23 "${template_rel}"
#include <sstream>
@@ -31,7 +31,7 @@
${type_properties_includes}
-#line 35 "${template}"
+#line 35 "${template_rel}"
namespace CVC4 {
namespace kind {
@@ -47,7 +47,7 @@
switch (tc)
{
${type_constant_cardinalities}
-#line 51 "${template}"
+#line 51 "${template_rel}"
default: InternalError() << "No cardinality known for type constant " << tc;
}
} /* getCardinality(TypeConstant) */
@@ -64,7 +64,7 @@
case TYPE_CONSTANT:
return getCardinality(typeNode.getConst<TypeConstant>());
${type_cardinalities}
-#line 68 "${template}"
+#line 68 "${template_rel}"
default:
InternalError() << "A theory kinds file did not provide a cardinality "
<< "or cardinality computer for type:\n"
@@ -75,7 +75,7 @@
inline bool isWellFounded(TypeConstant tc) {
switch(tc) {
${type_constant_wellfoundednesses}
-#line 79 "${template}"
+#line 79 "${template_rel}"
default:
InternalError() << "No well-foundedness status known for type constant: "
<< tc;
@@ -88,7 +88,7 @@
case TYPE_CONSTANT:
return isWellFounded(typeNode.getConst<TypeConstant>());
${type_wellfoundednesses}
-#line 92 "${template}"
+#line 92 "${template_rel}"
default:
InternalError() << "A theory kinds file did not provide a well-foundedness "
<< "or well-foundedness computer for type:\n"
@@ -101,7 +101,7 @@
switch (tc)
{
${type_constant_groundterms}
-#line 105 "${template}"
+#line 105 "${template_rel}"
default:
InternalError() << "No ground term known for type constant: " << tc;
}
@@ -115,7 +115,7 @@
case TYPE_CONSTANT:
return mkGroundTerm(typeNode.getConst<TypeConstant>());
${type_groundterms}
-#line 119 "${template}"
+#line 119 "${template_rel}"
default:
InternalError() << "A theory kinds file did not provide a ground term "
<< "or ground term computer for type:\n"
|