Changeset 70a1c3ae for src/Parser
- Timestamp:
- Jan 29, 2019, 4:09:59 PM (7 years ago)
- Branches:
- no_list
- Children:
- bee0694
- Parents:
- ede87c6
- Location:
- src/Parser
- Files:
-
- 4 edited
-
DeclarationNode.cc (modified) (2 diffs)
-
ParseNode.h (modified) (2 diffs)
-
TypeData.cc (modified) (7 diffs)
-
TypeData.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
rede87c6 r70a1c3ae 509 509 510 510 for ( Attribute *attr: reverseIterate( q->attributes ) ) { 511 attributes. push_front(attr->clone() );511 attributes.insert(attributes.begin(), attr->clone() ); 512 512 } // for 513 513 return this; … … 770 770 if ( a ) { 771 771 for ( Attribute *attr: reverseIterate( a->attributes ) ) { 772 attributes. push_front(attr );772 attributes.insert( attributes.begin(), attr ); 773 773 } // for 774 774 a->attributes.clear(); -
src/Parser/ParseNode.h
rede87c6 r70a1c3ae 344 344 LinkageSpec::Spec linkage; 345 345 Expression * asmName = nullptr; 346 std:: list< Attribute * > attributes;346 std::vector< Attribute * > attributes; 347 347 InitializerNode * initializer = nullptr; 348 348 bool extension = false; … … 374 374 375 375 virtual StatementNode * add_label( const std::string * name, DeclarationNode * attr = nullptr ) { 376 stmt->get_labels().emplace_back( * name, nullptr, attr ? std::move( attr->attributes ) : std:: list< Attribute * > {} );376 stmt->get_labels().emplace_back( * name, nullptr, attr ? std::move( attr->attributes ) : std::vector< Attribute * > {} ); 377 377 delete attr; 378 378 delete name; -
src/Parser/TypeData.cc
rede87c6 r70a1c3ae 760 760 761 761 762 AggregateDecl * buildAggregate( const TypeData * td, std:: list< Attribute * > attributes, LinkageSpec::Spec linkage ) {762 AggregateDecl * buildAggregate( const TypeData * td, std::vector< Attribute * > attributes, LinkageSpec::Spec linkage ) { 763 763 assert( td->kind == TypeData::Aggregate ); 764 764 AggregateDecl * at; … … 790 790 791 791 792 ReferenceToType * buildComAggInst( const TypeData * type, std:: list< Attribute * > attributes, LinkageSpec::Spec linkage ) {792 ReferenceToType * buildComAggInst( const TypeData * type, std::vector< Attribute * > attributes, LinkageSpec::Spec linkage ) { 793 793 switch ( type->kind ) { 794 794 case TypeData::Enum: { … … 850 850 assert( td->kind == TypeData::AggregateInst ); 851 851 852 // ReferenceToType * ret = buildComAggInst( td->aggInst.aggregate, std:: list< Attribute * >() );852 // ReferenceToType * ret = buildComAggInst( td->aggInst.aggregate, std::vector< Attribute * >() ); 853 853 ReferenceToType * ret = nullptr; 854 854 TypeData * type = td->aggInst.aggregate; … … 887 887 888 888 889 NamedTypeDecl * buildSymbolic( const TypeData * td, std:: list< Attribute * > attributes, const string & name, Type::StorageClasses scs, LinkageSpec::Spec linkage ) {889 NamedTypeDecl * buildSymbolic( const TypeData * td, std::vector< Attribute * > attributes, const string & name, Type::StorageClasses scs, LinkageSpec::Spec linkage ) { 890 890 assert( td->kind == TypeData::Symbolic ); 891 891 NamedTypeDecl * ret; … … 898 898 buildList( td->symbolic.params, ret->get_parameters() ); 899 899 buildList( td->symbolic.assertions, ret->get_assertions() ); 900 ret->base->attributes. splice( ret->base->attributes.end(), attributes);900 ret->base->attributes.insert( ret->base->attributes.end(), attributes.begin(), attributes.end() ); 901 901 return ret; 902 902 } // buildSymbolic 903 903 904 904 905 EnumDecl * buildEnum( const TypeData * td, std:: list< Attribute * > attributes, LinkageSpec::Spec linkage ) {905 EnumDecl * buildEnum( const TypeData * td, std::vector< Attribute * > attributes, LinkageSpec::Spec linkage ) { 906 906 assert( td->kind == TypeData::Enum ); 907 907 EnumDecl * ret = new EnumDecl( *td->enumeration.name, attributes, linkage ); … … 947 947 948 948 949 Declaration * buildDecl( const TypeData * td, const string &name, Type::StorageClasses scs, Expression * bitfieldWidth, Type::FuncSpecifiers funcSpec, LinkageSpec::Spec linkage, Expression *asmName, Initializer * init, std:: list< Attribute * > attributes ) {949 Declaration * buildDecl( const TypeData * td, const string &name, Type::StorageClasses scs, Expression * bitfieldWidth, Type::FuncSpecifiers funcSpec, LinkageSpec::Spec linkage, Expression *asmName, Initializer * init, std::vector< Attribute * > attributes ) { 950 950 if ( td->kind == TypeData::Function ) { 951 951 if ( td->function.idList ) { // KR function ? … … 1020 1020 param->type = decl->type; // set copy declaration type to parameter type 1021 1021 decl->type = nullptr; // reset declaration type 1022 param->attributes. splice( param->attributes.end(), decl->attributes); // copy and reset attributes from declaration to parameter1022 param->attributes.insert( param->attributes.end(), decl->attributes.begin(), decl->attributes.end() ); // copy and reset attributes from declaration to parameter 1023 1023 } // if 1024 1024 } // for -
src/Parser/TypeData.h
rede87c6 r70a1c3ae 19 19 #include <list> // for list 20 20 #include <string> // for string 21 #include <vector> 21 22 22 23 #include "ParseNode.h" // for DeclarationNode, DeclarationNode::Ag... … … 120 121 ArrayType * buildArray( const TypeData * ); 121 122 ReferenceType * buildReference( const TypeData * ); 122 AggregateDecl * buildAggregate( const TypeData *, std:: list< Attribute * > );123 ReferenceToType * buildComAggInst( const TypeData *, std:: list< Attribute * > attributes, LinkageSpec::Spec linkage );123 AggregateDecl * buildAggregate( const TypeData *, std::vector< Attribute * > ); 124 ReferenceToType * buildComAggInst( const TypeData *, std::vector< Attribute * > attributes, LinkageSpec::Spec linkage ); 124 125 ReferenceToType * buildAggInst( const TypeData * ); 125 126 TypeDecl * buildVariable( const TypeData * ); 126 EnumDecl * buildEnum( const TypeData *, std:: list< Attribute * >, LinkageSpec::Spec );127 EnumDecl * buildEnum( const TypeData *, std::vector< Attribute * >, LinkageSpec::Spec ); 127 128 TypeInstType * buildSymbolicInst( const TypeData * ); 128 129 TupleType * buildTuple( const TypeData * ); 129 130 TypeofType * buildTypeof( const TypeData * ); 130 131 Declaration * buildDecl( const TypeData *, const std::string &, Type::StorageClasses, Expression *, Type::FuncSpecifiers funcSpec, LinkageSpec::Spec, Expression * asmName, 131 Initializer * init = nullptr, std:: list< class Attribute * > attributes = std::list< classAttribute * >() );132 Initializer * init = nullptr, std::vector< Attribute * > attributes = std::vector< Attribute * >() ); 132 133 FunctionType * buildFunction( const TypeData * ); 133 134 void buildKRFunction( const TypeData::Function_t & function );
Note:
See TracChangeset
for help on using the changeset viewer.