Changeset 2f42718 for src/SynTree
- Timestamp:
- Feb 22, 2019, 10:43:29 AM (7 years ago)
- Branches:
- no_list
- Parents:
- 43e0949
- Location:
- src/SynTree
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Declaration.h
r43e0949 r2f42718 182 182 Type *base; 183 183 std::list< TypeDecl* > parameters; 184 std:: list< DeclarationWithType* > assertions;184 std::vector< DeclarationWithType* > assertions; 185 185 186 186 NamedTypeDecl( const std::string &name, Type::StorageClasses scs, Type *type ); … … 191 191 void set_base( Type *newValue ) { base = newValue; } 192 192 std::list< TypeDecl* >& get_parameters() { return parameters; } 193 std::list< DeclarationWithType* >& get_assertions() { return assertions; }194 193 195 194 virtual std::string typeString() const = 0; -
src/SynTree/FunctionType.cc
r43e0949 r2f42718 39 39 40 40 namespace { 41 bool containsTtype( const std:: list<DeclarationWithType * > & l ) {41 bool containsTtype( const std::vector<DeclarationWithType * > & l ) { 42 42 if ( ! l.empty() ) { 43 43 return Tuples::isTtype( l.back()->get_type() ); -
src/SynTree/TupleExpr.cc
r43e0949 r2f42718 66 66 TupleType * type = strict_dynamic_cast< TupleType * >( tuple->get_result() ); 67 67 assertf( type->size() > index, "TupleIndexExpr index out of bounds: tuple size %d, requested index %d in expr %s", type->size(), index, toString( tuple ).c_str() ); 68 set_result( (*std::next( type-> get_types().begin(), index ))->clone() );68 set_result( (*std::next( type->types.begin(), index ))->clone() ); 69 69 // like MemberExpr, TupleIndexExpr is always an lvalue 70 70 get_result()->set_lvalue( true ); -
src/SynTree/TupleType.cc
r43e0949 r2f42718 25 25 class Attribute; 26 26 27 TupleType::TupleType( const Type::Qualifiers &tq, const std:: list< Type * > & types, const std::vector< Attribute * > & attributes ) : Type( tq, attributes ), types( types ) {27 TupleType::TupleType( const Type::Qualifiers &tq, const std::vector< Type * > & types, const std::vector< Attribute * > & attributes ) : Type( tq, attributes ), types( types ) { 28 28 for ( Type * t : *this ) { 29 29 // xxx - this is very awkward. TupleTypes should contain objects so that members can be named, but if they don't have an initializer node then -
src/SynTree/Type.h
r43e0949 r2f42718 359 359 class FunctionType : public Type { 360 360 public: 361 std:: list<DeclarationWithType*> returnVals;362 std:: list<DeclarationWithType*> parameters;361 std::vector<DeclarationWithType*> returnVals; 362 std::vector<DeclarationWithType*> parameters; 363 363 364 364 // Does the function accept a variable number of arguments following the arguments specified in the parameters list. … … 372 372 virtual ~FunctionType(); 373 373 374 std::list<DeclarationWithType*> & get_returnVals() { return returnVals; }375 std::list<DeclarationWithType*> & get_parameters() { return parameters; }376 374 bool get_isVarArgs() const { return isVarArgs; } 377 375 void set_isVarArgs( bool newValue ) { isVarArgs = newValue; } … … 564 562 class TupleType : public Type { 565 563 public: 566 std:: list<Type *> types;564 std::vector<Type *> types; 567 565 std::list<Declaration *> members; 568 566 569 TupleType( const Type::Qualifiers & tq, const std:: list< Type * > & types, const std::vector< Attribute * > & attributes = std::vector< Attribute * >() );567 TupleType( const Type::Qualifiers & tq, const std::vector< Type * > & types, const std::vector< Attribute * > & attributes = std::vector< Attribute * >() ); 570 568 TupleType( const TupleType& ); 571 569 virtual ~TupleType(); 572 570 573 typedef std:: list<Type*> value_type;571 typedef std::vector< Type * > value_type; 574 572 typedef value_type::iterator iterator; 575 573 576 std::list<Type *> & get_types() { return types; }577 574 virtual unsigned size() const override { return types.size(); }; 578 575
Note:
See TracChangeset
for help on using the changeset viewer.