Changes in src/ResolvExpr/Resolver.cc [88d1066:6013bd7]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
r88d1066 r6013bd7 10 10 // Created On : Sun May 17 12:17:01 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Jul 12 17:45:42 201613 // Update Count : 2 0412 // Last Modified On : Thu Mar 23 17:23:14 2017 13 // Update Count : 211 14 14 // 15 15 … … 371 371 void Resolver::visit( SingleInit *singleInit ) { 372 372 if ( singleInit->get_value() ) { 373 #if 0 374 if (NameExpr * ne = dynamic_cast<NameExpr*>(singleInit->get_value())) { 375 string n = ne->get_name(); 376 if (n == "0") { 377 initContext = new BasicType(Type::Qualifiers(), 378 BasicType::SignedInt); 379 } else { 380 DeclarationWithType * decl = lookupId( n ); 381 initContext = decl->get_type(); 382 } 383 } else if (ConstantExpr * e = 384 dynamic_cast<ConstantExpr*>(singleInit->get_value())) { 385 Constant *c = e->get_constant(); 386 initContext = c->get_type(); 387 } else { 388 assert(0); 389 } 390 #endif 373 // // find all the d's 374 // std::list<Expression *> &designators = singleInit->get_designators(); 375 // std::list<Type *> types1{ initContext }, types2; 376 // for ( Expression * expr: designators ) { 377 // cerr << expr << endl; 378 // if ( NameExpr * nexpr = dynamic_cast<NameExpr *>( expr ) ) { 379 // for ( Type * type: types1 ) { 380 // cerr << type << endl; 381 // ReferenceToType * fred = dynamic_cast<ReferenceToType *>(type); 382 // std::list<Declaration *> members; 383 // if ( fred ) { 384 // fred->lookup( nexpr->get_name(), members ); // concatenate identical field name 385 // for ( Declaration * mem: members ) { 386 // if ( DeclarationWithType * dwt = dynamic_cast<DeclarationWithType *>(mem) ) { 387 // types2.push_back( dwt->get_type() ); 388 // } // if 389 // } // for 390 // } // if 391 // } // for 392 // types1 = types2; 393 // types2.clear(); 394 // } // if 395 // } // for 396 // // for ( Type * type: types1 ) { 397 // // cerr << type << endl; 398 // // } // for 399 400 // // O(N^2) checks of d-types with f-types 401 // // find the minimum cost 391 402 CastExpr *castExpr = new CastExpr( singleInit->get_value(), initContext->clone() ); 392 403 Expression *newExpr = findSingleExpression( castExpr, *this ); … … 410 421 } 411 422 } // if 412 // singleInit->get_value()->accept( *this );413 423 } 414 424
Note: See TracChangeset
for help on using the changeset viewer.