Changeset bee0694 for src/SynTree
- Timestamp:
- Jan 29, 2019, 4:15:27 PM (7 years ago)
- Branches:
- no_list
- Children:
- bbbc067
- Parents:
- 70a1c3ae
- Location:
- src/SynTree
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Label.h
r70a1c3ae rbee0694 49 49 inline std::ostream & operator<<( std::ostream & out, const Label & l ) { return out << l.get_name(); } 50 50 51 static const std:: list< Label >noLabels;51 static const std::vector< Label > noLabels; 52 52 53 53 // Local Variables: // -
src/SynTree/Statement.cc
r70a1c3ae rbee0694 32 32 using std::endl; 33 33 34 Statement::Statement( const std:: list<Label>& labels ) : labels( labels ) {}34 Statement::Statement( const std::vector< Label > & labels ) : labels( labels ) {} 35 35 36 36 void Statement::print( std::ostream & os, Indenter indent ) const { … … 60 60 61 61 62 AsmStmt::AsmStmt( bool voltile, Expression *instruction, std::list<Expression *> output, std::list<Expression *> input, std::list<ConstantExpr *> clobber, std:: list<Label>gotolabels ) : Statement(), voltile( voltile ), instruction( instruction ), output( output ), input( input ), clobber( clobber ), gotolabels( gotolabels ) {}62 AsmStmt::AsmStmt( bool voltile, Expression *instruction, std::list<Expression *> output, std::list<Expression *> input, std::list<ConstantExpr *> clobber, std::vector< Label > gotolabels ) : Statement(), voltile( voltile ), instruction( instruction ), output( output ), input( input ), clobber( clobber ), gotolabels( gotolabels ) {} 63 63 64 64 AsmStmt::AsmStmt( const AsmStmt & other ) : Statement( other ), voltile( other.voltile ), instruction( maybeClone( other.instruction ) ), gotolabels( other.gotolabels ) { … … 223 223 } 224 224 225 CaseStmt * CaseStmt::makeDefault( const std:: list<Label>& labels, std::list<Statement *> stmts ) {225 CaseStmt * CaseStmt::makeDefault( const std::vector< Label > & labels, std::list<Statement *> stmts ) { 226 226 CaseStmt * stmt = new CaseStmt( nullptr, stmts, true ); 227 227 stmt->labels = labels; … … 511 511 512 512 513 NullStmt::NullStmt( const std:: list<Label>& labels ) : Statement( labels ) {513 NullStmt::NullStmt( const std::vector< Label > & labels ) : Statement( labels ) { 514 514 } 515 515 -
src/SynTree/Statement.h
r70a1c3ae rbee0694 35 35 class Statement : public BaseSyntaxNode { 36 36 public: 37 std:: list<Label>labels;38 39 Statement( const std:: list<Label>& labels = {} );37 std::vector< Label > labels; 38 39 Statement( const std::vector< Label > & labels = {} ); 40 40 virtual ~Statement(); 41 41 42 std:: list<Label>& get_labels() { return labels; }43 const std:: list<Label>& get_labels() const { return labels; }42 std::vector< Label > & get_labels() { return labels; } 43 const std::vector< Label > & get_labels() const { return labels; } 44 44 45 45 virtual Statement *clone() const override = 0; … … 70 70 class NullStmt : public Statement { 71 71 public: 72 NullStmt( const std:: list<Label>& labels = {} );72 NullStmt( const std::vector< Label > & labels = {} ); 73 73 74 74 virtual NullStmt *clone() const override { return new NullStmt( *this ); } … … 101 101 std::list<Expression *> output, input; 102 102 std::list<ConstantExpr *> clobber; 103 std:: list<Label>gotolabels;104 105 AsmStmt( bool voltile, Expression *instruction, std::list<Expression *> output, std::list<Expression *> input, std::list<ConstantExpr *> clobber, std:: list<Label>gotolabels );103 std::vector< Label > gotolabels; 104 105 AsmStmt( bool voltile, Expression *instruction, std::list<Expression *> output, std::list<Expression *> input, std::list<ConstantExpr *> clobber, std::vector< Label > gotolabels ); 106 106 AsmStmt( const AsmStmt &other ); 107 107 virtual ~AsmStmt(); … … 117 117 std::list<ConstantExpr *> & get_clobber() { return clobber; } 118 118 void set_clobber( const std::list<ConstantExpr *> &newValue ) { clobber = newValue; } 119 std:: list<Label>& get_gotolabels() { return gotolabels; }120 void set_gotolabels( const std:: list<Label>&newValue ) { gotolabels = newValue; }119 std::vector< Label > & get_gotolabels() { return gotolabels; } 120 void set_gotolabels( const std::vector< Label > &newValue ) { gotolabels = newValue; } 121 121 122 122 virtual AsmStmt * clone() const { return new AsmStmt( *this ); } … … 196 196 virtual ~CaseStmt(); 197 197 198 static CaseStmt * makeDefault( const std:: list<Label>& labels = {}, std::list<Statement *> stmts = std::list<Statement *>() );198 static CaseStmt * makeDefault( const std::vector< Label > & labels = {}, std::list<Statement *> stmts = std::list<Statement *>() ); 199 199 200 200 bool isDefault() const { return _isDefault; }
Note:
See TracChangeset
for help on using the changeset viewer.