Changeset 4e7cc5ce
- Timestamp:
- May 31, 2018, 3:46:59 PM (6 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, with_gc
- Children:
- 5de1e2c
- Parents:
- cf5e5b1
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Alternative.cc
rcf5e5b1 r4e7cc5ce 27 27 28 28 namespace ResolvExpr { 29 Alternative::Alternative() : cost( Cost::zero ), cvtCost( Cost::zero ), expr( 0) {}29 Alternative::Alternative() : cost( Cost::zero ), cvtCost( Cost::zero ), expr( nullptr ) {} 30 30 31 31 Alternative::Alternative( Expression *expr, const TypeEnvironment &env, const Cost& cost ) … … 48 48 } 49 49 50 Alternative::Alternative( Alternative && other ) : cost( other.cost ), cvtCost( other.cvtCost ), expr( other.expr ), env( other.env) {50 Alternative::Alternative( Alternative && other ) : cost( other.cost ), cvtCost( other.cvtCost ), expr( other.expr ), env( std::move( other.env ) ) { 51 51 other.expr = nullptr; 52 52 } … … 58 58 cvtCost = other.cvtCost; 59 59 expr = other.expr; 60 env = other.env;60 env = std::move( other.env ); 61 61 other.expr = nullptr; 62 62 return *this; -
src/ResolvExpr/TypeEnvironment.cc
rcf5e5b1 r4e7cc5ce 50 50 } 51 51 52 EqvClass::EqvClass() : type( 0), allowWidening( true ) {52 EqvClass::EqvClass() : type( nullptr ), allowWidening( true ) { 53 53 } 54 54 … … 159 159 160 160 void TypeEnvironment::print( std::ostream &os, Indenter indent ) const { 161 for ( std::list< EqvClass >::const_iterator i = env.begin(); i != env.end(); ++i) {162 i->print( os, indent );161 for ( const EqvClass & theClass : env ) { 162 theClass.print( os, indent ); 163 163 } // for 164 164 } -
src/SynTree/ReferenceToType.cc
rcf5e5b1 r4e7cc5ce 50 50 51 51 namespace { 52 void doLookup( const std::list< Declaration * > &members, const std::string &name, std::list< Declaration* > &foundDecls ) {53 for ( std::list< Declaration* >::const_iterator i = members.begin(); i != members.end(); ++i) {54 if ( (*i)->get_name()== name ) {55 foundDecls.push_back( *i);52 void doLookup( const std::list< Declaration * > & members, const std::string & name, std::list< Declaration* > & foundDecls ) { 53 for ( Declaration * decl : members ) { 54 if ( decl->name == name ) { 55 foundDecls.push_back( decl ); 56 56 } // if 57 57 } // for … … 60 60 61 61 StructInstType::StructInstType( const Type::Qualifiers & tq, StructDecl * baseStruct, const std::list< Attribute * > & attributes ) : 62 Parent( tq, baseStruct-> get_name(), attributes ), baseStruct( baseStruct ) {}62 Parent( tq, baseStruct->name, attributes ), baseStruct( baseStruct ) {} 63 63 64 64 std::string StructInstType::typeString() const { return "struct"; } … … 84 84 void StructInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const { 85 85 assert( baseStruct ); 86 doLookup( baseStruct-> get_members(), name, foundDecls );86 doLookup( baseStruct->members, name, foundDecls ); 87 87 } 88 88 … … 103 103 104 104 UnionInstType::UnionInstType( const Type::Qualifiers & tq, UnionDecl * baseUnion, const std::list< Attribute * > & attributes ) : 105 Parent( tq, baseUnion-> get_name(), attributes ), baseUnion( baseUnion ) {}105 Parent( tq, baseUnion->name, attributes ), baseUnion( baseUnion ) {} 106 106 107 107 std::string UnionInstType::typeString() const { return "union"; } … … 127 127 void UnionInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const { 128 128 assert( baseUnion ); 129 doLookup( baseUnion-> get_members(), name, foundDecls );129 doLookup( baseUnion->members, name, foundDecls ); 130 130 } 131 131
Note: See TracChangeset
for help on using the changeset viewer.