@@ -148,14 +148,14 @@ enum class atok_t_vpr_constraints { TOOL_NAME };
148148constexpr const char * atok_lookup_t_vpr_constraints[] = {" tool_name" };
149149
150150/* Internal lexers. These convert the PugiXML node names to input tokens. */
151- inline atok_t_add_atom lex_attr_t_add_atom (const char * in, const std::function<void (const char *)>* report_error) {std::printf ( " lex_attr_t_add_atom 151 errno: %d \n " , errno);
152- unsigned int len = strlen (in);std::printf ( " lex_attr_t_add_atom 152 errno: %d \n " , errno);
151+ inline atok_t_add_atom lex_attr_t_add_atom (const char * in, const std::function<void (const char *)>* report_error) {
152+ unsigned int len = strlen (in);
153153 switch (len) {
154154 case 12 :
155155 switch (*((triehash_uu64*)&in[0 ])) {
156- case onechar (' n' , 0 , 64 ) | onechar (' a' , 8 , 64 ) | onechar (' m' , 16 , 64 ) | onechar (' e' , 24 , 64 ) | onechar (' _' , 32 , 64 ) | onechar (' p' , 40 , 64 ) | onechar (' a' , 48 , 64 ) | onechar (' t' , 56 , 64 ):std::printf ( " lex_attr_t_add_atom 156 errno: %d \n " , errno);
157- switch (*((triehash_uu32*)&in[8 ])) {std::printf ( " lex_attr_t_add_atom 157 errno: %d \n " , errno);
158- case onechar (' t' , 0 , 32 ) | onechar (' e' , 8 , 32 ) | onechar (' r' , 16 , 32 ) | onechar (' n' , 24 , 32 ):std::printf ( " lex_attr_t_add_atom 158 errno: %d \n " , errno);
156+ case onechar (' n' , 0 , 64 ) | onechar (' a' , 8 , 64 ) | onechar (' m' , 16 , 64 ) | onechar (' e' , 24 , 64 ) | onechar (' _' , 32 , 64 ) | onechar (' p' , 40 , 64 ) | onechar (' a' , 48 , 64 ) | onechar (' t' , 56 , 64 ):
157+ switch (*((triehash_uu32*)&in[8 ])) {
158+ case onechar (' t' , 0 , 32 ) | onechar (' e' , 8 , 32 ) | onechar (' r' , 16 , 32 ) | onechar (' n' , 24 , 32 ):
159159 return atok_t_add_atom::NAME_PATTERN;
160160 break ;
161161 default :
@@ -168,8 +168,8 @@ inline atok_t_add_atom lex_attr_t_add_atom(const char* in, const std::function<v
168168 break ;
169169 default :
170170 break ;
171- }std::printf ( " lex_attr_t_add_atom 171 errno: %d \n " , errno);
172- noreturn_report (report_error, (" Found unrecognized attribute " + std::string (in) + " of <add_atom>." ).c_str ());std::printf ( " lex_attr_t_add_atom 172 errno: %d \n " , errno);
171+ }
172+ noreturn_report (report_error, (" Found unrecognized attribute " + std::string (in) + " of <add_atom>." ).c_str ());
173173}
174174
175175inline atok_t_add_region lex_attr_t_add_region (const char * in, const std::function<void (const char *)>* report_error) {
@@ -427,17 +427,13 @@ template<std::size_t N>
427427/* Internal loading functions, which validate and load a PugiXML DOM tree into memory. */
428428inline int load_int (const char * in, const std::function<void (const char *)>* report_error) {
429429 int out;
430- std::printf (" before reading int errno:%d\n " , errno);
431430 errno = 0 ;
432431 out = std::strtol (in, NULL , 10 );
433- if (errno != 0 ) {
434- std::printf (" after reading int errno:%d\n " , errno);
432+ if (errno != 0 )
435433 noreturn_report (report_error, (" Invalid value `" + std::string (in) + " ` when loading into a int." ).c_str ());
436- }
437434 return out;
438435}
439436inline void load_add_region_required_attributes (const pugi::xml_node& root, int * x_high, int * x_low, int * y_high, int * y_low, const std::function<void (const char *)>* report_error) {
440- std::printf (" load_add_region_required_attributes errno: %d\n " , errno);
441437 std::bitset<5 > astate = 0 ;
442438 for (pugi::xml_attribute attr = root.first_attribute (); attr; attr = attr.next_attribute ()) {
443439 atok_t_add_region in = lex_attr_t_add_region (attr.name (), report_error);
@@ -473,23 +469,23 @@ inline void load_add_atom(const pugi::xml_node& root, T& out, Context& context,
473469 (void )root;
474470 (void )out;
475471 (void )context;
476- (void )report_error;std::printf ( " load_add_atom 475 errno: %d \n " , errno);
472+ (void )report_error;
477473 // Update current file offset in case an error is encountered.
478- *offset_debug = root.offset_debug ();std::printf ( " load_add_atom 477 errno: %d \n " , errno);
474+ *offset_debug = root.offset_debug ();
479475
480- for (pugi::xml_attribute attr = root.first_attribute (); attr; attr = attr.next_attribute ()) {std::printf ( " load_add_atom 479 errno: %d \n " , errno);
481- atok_t_add_atom in = lex_attr_t_add_atom (attr.name (), report_error);std::printf ( " load_add_atom 480 errno: %d \n " , errno);
476+ for (pugi::xml_attribute attr = root.first_attribute (); attr; attr = attr.next_attribute ()) {
477+ atok_t_add_atom in = lex_attr_t_add_atom (attr.name (), report_error);
482478 switch (in) {
483- case atok_t_add_atom::NAME_PATTERN:std::printf ( " load_add_atom 482 errno: %d \n " , errno);
484- out.set_add_atom_name_pattern (attr.value (), context);std::printf ( " load_add_atom 483 errno: %d \n " , errno);
479+ case atok_t_add_atom::NAME_PATTERN:
480+ out.set_add_atom_name_pattern (attr.value (), context);
485481 break ;
486482 default :
487483 break ; /* Not possible. */
488484 }
489485 }
490486
491- if (root.first_child ().type () == pugi::node_element) { std::printf ( " load_add_atom 490 errno: %d \n " , errno);
492- noreturn_report (report_error, " Unexpected child element in <add_atom>." );std::printf ( " load_add_atom 491 errno: %d \n " , errno);}
487+ if (root.first_child ().type () == pugi::node_element)
488+ noreturn_report (report_error, " Unexpected child element in <add_atom>." );
493489}
494490
495491template <class T , typename Context>
@@ -505,7 +501,6 @@ inline void load_add_region(const pugi::xml_node& root, T& out, Context& context
505501 atok_t_add_region in = lex_attr_t_add_region (attr.name (), report_error);
506502 switch (in) {
507503 case atok_t_add_region::SUBTILE:
508- std::printf (" out.set_add_region_subtile errno: %d\n " , errno);
509504 out.set_add_region_subtile (load_int (attr.value (), report_error), context);
510505 break ;
511506 case atok_t_add_region::X_HIGH:
@@ -537,46 +532,35 @@ constexpr int gstate_t_partition[NUM_T_PARTITION_STATES][NUM_T_PARTITION_INPUTS]
537532};
538533template <class T , typename Context>
539534inline void load_partition (const pugi::xml_node& root, T& out, Context& context, const std::function<void (const char *)>* report_error, ptrdiff_t* offset_debug) {
540- std::printf (" load_partition errno: %d\n " , errno);
541535 (void )root;
542536 (void )out;
543537 (void )context;
544538 (void )report_error;
545539 // Update current file offset in case an error is encountered.
546540 *offset_debug = root.offset_debug ();
547- std::printf ( " load_partition 546 errno: %d \n " , errno);
541+
548542 for (pugi::xml_attribute attr = root.first_attribute (); attr; attr = attr.next_attribute ()) {
549- std::printf (" load_partition 548 errno: %d\n " , errno);
550543 atok_t_partition in = lex_attr_t_partition (attr.name (), report_error);
551- std::printf (" load_partition 550 errno: %d\n " , errno);
552544 switch (in) {
553545 case atok_t_partition::NAME:
554546 out.set_partition_name (attr.value (), context);
555- std::printf (" load_partition 554 errno: %d\n " , errno);
556547 break ;
557548 default :
558549 break ; /* Not possible. */
559550 }
560551 }
561- std::printf (" load_partition 560 errno: %d\n " , errno);
562552
563553 // Preallocate arrays by counting child nodes (if any)
564554 size_t add_atom_count = 0 ;
565555 size_t add_region_count = 0 ;
566556 {
567557 int next, state = 1 ;
568558 for (pugi::xml_node node = root.first_child (); node; node = node.next_sibling ()) {
569- std::printf (" load_partition 568 errno: %d\n " , errno);
570559 *offset_debug = node.offset_debug ();
571- std::printf (" load_partition 570 errno: %d\n " , errno);
572560 gtok_t_partition in = lex_node_t_partition (node.name (), report_error);
573- std::printf (" load_partition 572 errno: %d\n " , errno);
574561 next = gstate_t_partition[state][(int )in];
575- std::printf (" load_partition 574 errno: %d\n " , errno);
576- if (next == -1 ) {
562+ if (next == -1 )
577563 dfa_error (gtok_lookup_t_partition[(int )in], gstate_t_partition[state], gtok_lookup_t_partition, 2 , report_error);
578- std::printf (" load_partition 577 errno: %d\n " , errno);
579- }
580564 state = next;
581565 switch (in) {
582566 case gtok_t_partition::ADD_ATOM:
@@ -589,68 +573,43 @@ inline void load_partition(const pugi::xml_node& root, T& out, Context& context,
589573 break ; /* Not possible. */
590574 }
591575 }
592- std::printf (" load_partition 591 errno: %d\n " , errno);
593576
594577 out.preallocate_partition_add_atom (context, add_atom_count);
595- std::printf (" load_partition 594 errno: %d\n " , errno);
596578 out.preallocate_partition_add_region (context, add_region_count);
597- std::printf (" load_partition 596 errno: %d\n " , errno);
598579 }
599580 int next, state = 1 ;
600581 for (pugi::xml_node node = root.first_child (); node; node = node.next_sibling ()) {
601- std::printf (" load_partition 600 errno: %d\n " , errno);
602582 *offset_debug = node.offset_debug ();
603- std::printf (" load_partition 602 errno: %d\n " , errno);
604583 gtok_t_partition in = lex_node_t_partition (node.name (), report_error);
605- std::printf (" load_partition 604 errno: %d\n " , errno);
606584 next = gstate_t_partition[state][(int )in];
607- if (next == -1 ) {
585+ if (next == -1 )
608586 dfa_error (gtok_lookup_t_partition[(int )in], gstate_t_partition[state], gtok_lookup_t_partition, 2 , report_error);
609- std::printf (" load_partition 608 errno: %d\n " , errno);
610- }
611587 state = next;
612588 switch (in) {
613589 case gtok_t_partition::ADD_ATOM: {
614- std::printf (" load_partition 613 errno: %d\n " , errno);
615590 auto child_context = out.add_partition_add_atom (context);
616- std::printf (" load_partition 615 errno: %d\n " , errno);
617591 load_add_atom (node, out, child_context, report_error, offset_debug);
618- std::printf (" load_partition 617 errno: %d\n " , errno);
619592 out.finish_partition_add_atom (child_context);
620- std::printf (" load_partition 619 errno: %d\n " , errno);
621593 } break ;
622594 case gtok_t_partition::ADD_REGION: {
623595 int add_region_x_high;
624- std::printf (" load_partition 623 errno: %d\n " , errno);
625596 memset (&add_region_x_high, 0 , sizeof (add_region_x_high));
626- std::printf (" load_partition 625 errno: %d\n " , errno);
627597 int add_region_x_low;
628598 memset (&add_region_x_low, 0 , sizeof (add_region_x_low));
629- std::printf (" load_partition 628 errno: %d\n " , errno);
630599 int add_region_y_high;
631600 memset (&add_region_y_high, 0 , sizeof (add_region_y_high));
632- std::printf (" load_partition 631 errno: %d\n " , errno);
633601 int add_region_y_low;
634602 memset (&add_region_y_low, 0 , sizeof (add_region_y_low));
635- std::printf (" load_partition 634 errno: %d\n " , errno);
636603 load_add_region_required_attributes (node, &add_region_x_high, &add_region_x_low, &add_region_y_high, &add_region_y_low, report_error);
637- std::printf (" load_partition 636 errno: %d\n " , errno);
638604 auto child_context = out.add_partition_add_region (context, add_region_x_high, add_region_x_low, add_region_y_high, add_region_y_low);
639- std::printf (" load_partition 638 errno: %d\n " , errno);
640605 load_add_region (node, out, child_context, report_error, offset_debug);
641- std::printf (" load_partition 640 errno: %d\n " , errno);
642606 out.finish_partition_add_region (child_context);
643- std::printf (" load_partition 642 errno: %d\n " , errno);
644607 } break ;
645608 default :
646609 break ; /* Not possible. */
647610 }
648611 }
649- std::printf (" load_partition 648 errno: %d\n " , errno);
650- if (state != 0 ) {
651- dfa_error (" end of input" , gstate_t_partition[state], gtok_lookup_t_partition, 2 , report_error);
652- std::printf (" load_partition 651 errno: %d\n " , errno);
653- }
612+ if (state != 0 ) dfa_error (" end of input" , gstate_t_partition[state], gtok_lookup_t_partition, 2 , report_error);
654613}
655614
656615constexpr int NUM_T_PARTITION_LIST_STATES = 2 ;
@@ -661,7 +620,6 @@ constexpr int gstate_t_partition_list[NUM_T_PARTITION_LIST_STATES][NUM_T_PARTITI
661620};
662621template <class T , typename Context>
663622inline void load_partition_list (const pugi::xml_node& root, T& out, Context& context, const std::function<void (const char *)>* report_error, ptrdiff_t* offset_debug) {
664- std::printf (" load_partition_list errno: %d\n " , errno);
665623 (void )root;
666624 (void )out;
667625 (void )context;
@@ -717,7 +675,6 @@ inline void load_partition_list(const pugi::xml_node& root, T& out, Context& con
717675
718676template <class T , typename Context>
719677inline void load_vpr_constraints (const pugi::xml_node& root, T& out, Context& context, const std::function<void (const char *)>* report_error, ptrdiff_t* offset_debug) {
720- std::printf (" load_vpr_constraints errno: %d\n " , errno);
721678 (void )root;
722679 (void )out;
723680 (void )context;
0 commit comments