Changeset 66d12f7 for src/ControlStruct
- Timestamp:
- Jul 30, 2016, 2:31:17 AM (9 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.