Changeset 66d12f7
- Timestamp:
- Jul 30, 2016, 2:31:17 AM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- ac911f4
- Parents:
- 2750cde
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r2750cde r66d12f7 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 15 15:53:15201613 // Update Count : 3 0612 // Last Modified On : Sat Jul 30 01:48:20 2016 13 // Update Count : 329 14 14 // 15 15 … … 472 472 } 473 473 } else { 474 nameExpr->accept( *this ); 475 output << "("; 476 genCommaList( untypedExpr->get_args().begin(), untypedExpr->get_args().end() ); 477 output << ")"; 474 if ( nameExpr->get_name() != "Range" ) { 475 nameExpr->accept( *this ); 476 output << "("; 477 genCommaList( untypedExpr->get_args().begin(), untypedExpr->get_args().end() ); 478 output << ")"; 479 } else { 480 genFredList( untypedExpr->get_args().begin(), untypedExpr->get_args().end() ); 481 // output << (*(untypedExpr->get_args().begin()))->accept( *this );// << " ... " << (*untypedExpr->get_args().end())->accept( *this ).getname(); 482 } // if 478 483 } // if 479 484 } else { -
src/CodeGen/CodeGenerator.h
r2750cde r66d12f7 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jul 4 17:12:40201613 // Update Count : 3 412 // Last Modified On : Sat Jul 30 01:23:43 2016 13 // Update Count : 36 14 14 // 15 15 … … 90 90 91 91 template< class Iterator > void genCommaList( Iterator begin, Iterator end ); 92 template< class Iterator > void genFredList( Iterator begin, Iterator end ); 92 93 93 94 struct Indenter { … … 118 119 void handleAggregate( AggregateDecl *aggDecl ); 119 120 void handleTypedef( NamedTypeDecl *namedType ); 120 }; 121 }; // CodeGenerator 121 122 122 123 template< class Iterator > … … 128 129 if ( begin == end ) return; 129 130 output << ", "; 131 } // for 132 } 133 134 template< class Iterator > 135 void CodeGenerator::genFredList( Iterator begin, Iterator end ) { 136 if ( begin == end ) return; 137 138 for ( ;; ) { 139 (*begin++)->accept( *this ); 140 if ( begin == end ) return; 141 output << " ... "; 130 142 } // for 131 143 } -
src/ControlStruct/CaseRangeMutator.cc
r2750cde r66d12f7 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Jul 12 17:35:13201613 // Update Count : 912 // Last Modified On : Thu Jul 28 01:56:47 2016 13 // Update Count : 14 14 14 // 15 15 … … 71 71 NameExpr *nmfunc; 72 72 if ( ( nmfunc = dynamic_cast< NameExpr *>( cond->get_function() )) != 0 ) { 73 if ( nmfunc->get_name() == std::string("Range")) {73 if ( nmfunc->get_name() == "Range" ) { 74 74 assert( cond->get_args().size() == 2 ); 75 75 std::list<Expression *>::iterator i = cond->get_args().begin(); 76 76 Expression *lo = *i, *hi = *(++i ); // "unnecessary" temporaries 77 fillRange( lo, hi );77 //fillRange( lo, hi ); 78 78 } // if 79 79 } // if … … 82 82 assert( ! tcond->get_exprs().empty() ); 83 83 for ( std::list< Expression * >::iterator i = tcond->get_exprs().begin(); i != tcond->get_exprs().end(); i++ ) 84 newCaseLabels.push_back( *i ); 84 newCaseLabels.push_back( *i ); // do I need to clone them? 85 85 } // if 86 86 … … 99 99 100 100 if ( ce_lo && ce_hi ) { 101 std::cout << ce_lo->get_constant()->get_value() << " " << ce_hi->get_constant()->get_value() << std::endl; 101 102 c_lo = ce_lo->get_constant(); c_hi = ce_hi->get_constant(); 102 103 } /* else { … … 109 110 if ( ! ty_lo || ! ty_hi ) 110 111 return; // one of them is not a constant 111 112 #if 0 112 113 switch ( ty_lo->get_kind() ) { 113 114 case BasicType::Char: … … 176 177 break; 177 178 } // switch 178 179 #endif 179 180 /* End: */{ 180 181 // invalid range, signal a warning (it still generates the two case labels) 181 newCaseLabels.push_back( lo );182 newCaseLabels.push_back( hi );182 // newCaseLabels.push_back( lo ); 183 // newCaseLabels.push_back( hi ); 183 184 return; 184 185 }
Note: See TracChangeset
for help on using the changeset viewer.