Changeset 58d246a
- Timestamp:
- Mar 24, 2017, 4:31:09 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 6d48157, cb4d825
- Parents:
- 231f01c (diff), f20dffa (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
r231f01c r58d246a 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 -
src/SynTree/Initializer.h
r231f01c r58d246a 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : T ue Apr 12 13:49:13 201613 // Update Count : 1911 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Mar 23 16:12:42 2017 13 // Update Count : 20 14 14 // 15 15 … … 70 70 void set_value( Expression *newValue ) { value = newValue; } 71 71 72 std::list<Expression *> &get_designators() { return designators; } 72 73 void set_designators( std::list<Expression *> &newValue ) { designators = newValue; } 73 std::list<Expression *> &get_designators() { return designators; }74 74 75 75 virtual SingleInit *clone() const { return new SingleInit( *this); } -
src/SynTree/Type.h
r231f01c r58d246a 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 17 09:04:03201713 // Update Count : 14 712 // Last Modified On : Thu Mar 23 16:16:36 2017 13 // Update Count : 149 14 14 // 15 15 … … 331 331 virtual Type *acceptMutator( Mutator & m ) = 0; 332 332 virtual void print( std::ostream & os, int indent = 0 ) const; 333 334 virtual void lookup( const std::string & name, std::list< Declaration* > & foundDecls ) const {} 333 335 protected: 334 336 virtual std::string typeString() const = 0;
Note: See TracChangeset
for help on using the changeset viewer.