Changeset d60ccbf for src/SynTree
- Timestamp:
- Aug 12, 2015, 2:27:31 PM (10 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- f32c7f4
- Parents:
- e45215c (diff), e869d663 (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/SynTree
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/ArrayType.cc
re45215c rd60ccbf 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sat Jun 6 14:11:48201513 // Update Count : 911 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed Aug 12 14:19:07 2015 13 // Update Count : 11 14 14 // 15 15 … … 50 50 } // if 51 51 if ( dimension ) { 52 os << " with dimension of ";53 dimension->print( os, indent);52 os << " with dimension of "; 53 dimension->print( os, 0 ); 54 54 } // if 55 55 } -
src/SynTree/BasicType.cc
re45215c rd60ccbf 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sun Jun 7 08:44:36201513 // Update Count : 511 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed Aug 12 14:15:45 2015 13 // Update Count : 6 14 14 // 15 15 … … 28 28 29 29 Type::print( os, indent ); 30 os << kindNames[ kind ] << ' ';30 os << kindNames[ kind ]; 31 31 } 32 32 -
src/SynTree/Constant.cc
re45215c rd60ccbf 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 : Wed Jun 10 14:41:03201513 // Update Count : 811 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 30 15:18:38 2015 13 // Update Count : 12 14 14 // 15 15 … … 22 22 Constant::Constant( Type *type_, std::string value_ ) : type( type_ ), value( value_ ) {} 23 23 24 Constant::~Constant() {} 24 Constant::Constant( const Constant &other ) { 25 type = other.type->clone(); 26 value = other.value; 27 } 25 28 26 Constant *Constant::clone() const { return 0; } 29 Constant::~Constant() { delete type; } 30 31 Constant *Constant::clone() const { assert( false ); return 0; } 27 32 28 33 void Constant::print( std::ostream &os ) const { -
src/SynTree/Constant.h
re45215c rd60ccbf 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 08:46:37201513 // Update Count : 212 // Last Modified On : Thu Jul 30 15:19:16 2015 13 // Update Count : 5 14 14 // 15 15 … … 24 24 public: 25 25 Constant( Type *type, std::string value ); 26 Constant( const Constant &other ); 26 27 virtual ~Constant(); 27 28 -
src/SynTree/Declaration.cc
re45215c rd60ccbf 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jun 13 08:07:20201513 // Update Count : 912 // Last Modified On : Mon Jul 13 17:58:38 2015 13 // Update Count : 10 14 14 // 15 15 … … 27 27 28 28 Declaration::Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage ) 29 : name( name ), storageClass( sc ), linkage( linkage ), uniqueId( 0 ) {29 : name( name ), storageClass( sc ), linkage( linkage ), isInline( false ), isNoreturn( false ), uniqueId( 0 ) { 30 30 } 31 31 32 32 Declaration::Declaration( const Declaration &other ) 33 : name( other.name ), storageClass( other.storageClass ), linkage( other.linkage), uniqueId( other.uniqueId ) {33 : name( other.name ), storageClass( other.storageClass ), linkage( other.linkage ), isInline( other.isInline ), isNoreturn( other.isNoreturn ), uniqueId( other.uniqueId ) { 34 34 } 35 35 -
src/SynTree/Declaration.h
re45215c rd60ccbf 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jun 13 09:10:31201513 // Update Count : 2 512 // Last Modified On : Mon Jul 13 18:15:59 2015 13 // Update Count : 28 14 14 // 15 15 … … 35 35 LinkageSpec::Type get_linkage() const { return linkage; } 36 36 void set_linkage( LinkageSpec::Type newValue ) { linkage = newValue; } 37 bool get_isInline() const { return isInline; } 38 void set_isInline( bool newValue ) { isInline = newValue; } 39 bool get_isNoreturn() const { return isNoreturn; } 40 void set_isNoreturn( bool newValue ) { isNoreturn = newValue; } 37 41 UniqueId get_uniqueId() const { return uniqueId; } 38 42 … … 50 54 DeclarationNode::StorageClass storageClass; 51 55 LinkageSpec::Type linkage; 56 bool isInline, isNoreturn; 52 57 UniqueId uniqueId; 53 58 }; … … 75 80 typedef DeclarationWithType Parent; 76 81 public: 77 ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init );82 ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init, bool isInline = false, bool isNoreturn = false ); 78 83 ObjectDecl( const ObjectDecl &other ); 79 84 virtual ~ObjectDecl(); … … 89 94 virtual ObjectDecl *clone() const { return new ObjectDecl( *this ); } 90 95 virtual void accept( Visitor &v ) { v.visit( this ); } 91 virtual ObjectDecl*acceptMutator( Mutator &m ) { return m.mutate( this ); }96 virtual DeclarationWithType *acceptMutator( Mutator &m ) { return m.mutate( this ); } 92 97 virtual void print( std::ostream &os, int indent = 0 ) const; 93 98 virtual void printShort( std::ostream &os, int indent = 0 ) const; … … 112 117 CompoundStmt *get_statements() const { return statements; } 113 118 void set_statements( CompoundStmt *newValue ) { statements = newValue; } 114 bool get_isInline() const { return isInline; }115 bool get_isNoreturn() const { return isNoreturn; }116 119 std::list< std::string >& get_oldIdents() { return oldIdents; } 117 120 std::list< Declaration* >& get_oldDecls() { return oldDecls; } … … 125 128 FunctionType *type; 126 129 CompoundStmt *statements; 127 bool isInline, isNoreturn;128 130 std::list< std::string > oldIdents; 129 131 std::list< Declaration* > oldDecls; -
src/SynTree/Expression.cc
re45215c rd60ccbf 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sun Jun 7 08:40:46201513 // Update Count : 1611 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed Aug 12 14:02:45 2015 13 // Update Count : 30 14 14 // 15 15 … … 38 38 Expression::~Expression() { 39 39 delete env; 40 //delete argName; // xxx -- there's a problem in cloning ConstantExpr I still don't know how to fix40 delete argName; // xxx -- there's a problem in cloning ConstantExpr I still don't know how to fix 41 41 deleteAll( results ); 42 42 } … … 72 72 73 73 void ConstantExpr::print( std::ostream &os, int indent ) const { 74 os << "constant expression " ;74 os << std::string( indent, ' ' ) << "constant expression " ; 75 75 constant.print( os ); 76 76 Expression::print( os, indent ); 77 os << std::endl; 77 78 } 78 79 … … 332 333 } 333 334 335 void AsmExpr::print( std::ostream &os, int indent ) const { 336 os << "Asm Expression: " << std::endl; 337 if ( inout ) inout->print( os, indent + 2 ); 338 if ( constraint ) constraint->print( os, indent + 2 ); 339 if ( operand ) operand->print( os, indent + 2 ); 340 } 341 334 342 void UntypedValofExpr::print( std::ostream &os, int indent ) const { 335 343 os << std::string( indent, ' ' ) << "Valof Expression: " << std::endl; -
src/SynTree/Expression.h
re45215c rd60ccbf 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Jun 7 22:03:44201513 // Update Count : 412 // Last Modified On : Fri Jul 24 13:49:28 2015 13 // Update Count : 18 14 14 // 15 15 … … 30 30 31 31 std::list<Type *>& get_results() { return results; } 32 void add_result( Type *t);32 void add_result( Type *t ); 33 33 34 34 TypeSubstitution *get_env() const { return env; } … … 446 446 }; 447 447 448 // AsmExpr represents a GCC 'asm constraint operand' used in an asm statement: [output] "=f" (result) 449 class AsmExpr : public Expression { 450 public: 451 AsmExpr( Expression *inout, ConstantExpr *constraint, Expression *operand ) : inout( inout ), constraint( constraint ), operand( operand ) {} 452 virtual ~AsmExpr() { delete inout; delete constraint; delete operand; }; 453 454 Expression *get_inout() const { return inout; } 455 void set_inout( Expression *newValue ) { inout = newValue; } 456 457 ConstantExpr *get_constraint() const { return constraint; } 458 void set_constraint( ConstantExpr *newValue ) { constraint = newValue; } 459 460 Expression *get_operand() const { return operand; } 461 void set_operand( Expression *newValue ) { operand = newValue; } 462 463 virtual AsmExpr *clone() const { return new AsmExpr( *this ); } 464 virtual void accept( Visitor &v ) { v.visit( this ); } 465 virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); } 466 virtual void print( std::ostream &os, int indent = 0 ) const; 467 private: 468 // https://gcc.gnu.org/onlinedocs/gcc-4.7.1/gcc/Machine-Constraints.html#Machine-Constraints 469 Expression *inout; 470 ConstantExpr *constraint; 471 Expression *operand; 472 }; 473 448 474 // ValofExpr represents a GCC 'lambda expression' 449 475 class UntypedValofExpr : public Expression { -
src/SynTree/FunctionDecl.cc
re45215c rd60ccbf 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jun 13 09:10:32201513 // Update Count : 1 612 // Last Modified On : Mon Jul 13 18:11:44 2015 13 // Update Count : 19 14 14 // 15 15 … … 22 22 23 23 FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn ) 24 : Parent( name, sc, linkage ), type( type ), statements( statements ), isInline( isInline ), isNoreturn( isNoreturn ) { 24 : Parent( name, sc, linkage ), type( type ), statements( statements ) { 25 set_isInline( isInline ); 26 set_isNoreturn( isNoreturn ); 25 27 // this is a brazen hack to force the function "main" to have C linkage 26 28 if ( name == "main" ) { … … 30 32 31 33 FunctionDecl::FunctionDecl( const FunctionDecl &other ) 32 : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) , isInline( other.isInline ), isNoreturn( other.isNoreturn ){34 : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) { 33 35 } 34 36 … … 57 59 os << LinkageSpec::toString( get_linkage() ) << " "; 58 60 } // if 59 if ( isInline) {61 if ( get_isInline() ) { 60 62 os << "inline "; 61 63 } // if 62 if ( isNoreturn) {64 if ( get_isNoreturn() ) { 63 65 os << "_Noreturn "; 64 66 } // if … … 96 98 os << get_name() << ": "; 97 99 } // if 98 if ( isInline) {100 if ( get_isInline() ) { 99 101 os << "inline "; 100 102 } // if 101 if ( isNoreturn) {103 if ( get_isNoreturn() ) { 102 104 os << "_Noreturn "; 103 105 } // if -
src/SynTree/Initializer.cc
re45215c rd60ccbf 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Mon May 18 09:02:45 201513 // Update Count : 211 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed Aug 12 14:05:25 2015 13 // Update Count : 14 14 14 // 15 15 … … 43 43 44 44 void SingleInit::print( std::ostream &os, int indent ) { 45 os << std::endl << std::string(indent, ' ' ) << "Simple Initializer: " ;46 value->print( os, indent+ 2);45 os << std::endl << std::string(indent, ' ' ) << "Simple Initializer: " << std::endl; 46 value->print( os, indent+4 ); 47 47 48 48 if ( ! designators.empty() ) { 49 os << std::endl << std::string(indent + 2, ' ' ) << "designated by: " ;50 for ( std::list < Expression * >::iterator i = designators.begin(); i != designators.end(); i++ ) 49 os << std::endl << std::string(indent + 2, ' ' ) << "designated by: " << std::endl; 50 for ( std::list < Expression * >::iterator i = designators.begin(); i != designators.end(); i++ ) { 51 51 ( *i )->print(os, indent + 4 ); 52 } 52 53 } // if 53 54 } -
src/SynTree/Mutator.cc
re45215c rd60ccbf 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 : Tue Jul 14 12:31:39201513 // Update Count : 211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 25 19:21:33 2015 13 // Update Count : 11 14 14 // 15 15 … … 28 28 Mutator::~Mutator() {} 29 29 30 ObjectDecl*Mutator::mutate( ObjectDecl *objectDecl ) {30 DeclarationWithType *Mutator::mutate( ObjectDecl *objectDecl ) { 31 31 objectDecl->set_type( maybeMutate( objectDecl->get_type(), *this ) ); 32 32 objectDecl->set_init( maybeMutate( objectDecl->get_init(), *this ) ); … … 93 93 exprStmt->set_expr( maybeMutate( exprStmt->get_expr(), *this ) ); 94 94 return exprStmt; 95 } 96 97 Statement *Mutator::mutate( AsmStmt *asmStmt ) { 98 asmStmt->set_instruction( maybeMutate( asmStmt->get_instruction(), *this ) ); 99 mutateAll( asmStmt->get_output(), *this ); 100 mutateAll( asmStmt->get_input(), *this ); 101 mutateAll( asmStmt->get_clobber(), *this ); 102 return asmStmt; 95 103 } 96 104 … … 291 299 typeExpr->set_type( maybeMutate( typeExpr->get_type(), *this ) ); 292 300 return typeExpr; 301 } 302 303 Expression *Mutator::mutate( AsmExpr *asmExpr ) { 304 asmExpr->set_inout( maybeMutate( asmExpr->get_inout(), *this ) ); 305 asmExpr->set_constraint( maybeMutate( asmExpr->get_constraint(), *this ) ); 306 asmExpr->set_operand( maybeMutate( asmExpr->get_operand(), *this ) ); 307 return asmExpr; 293 308 } 294 309 -
src/SynTree/Mutator.h
re45215c rd60ccbf 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 : Fri May 29 16:34:08 201513 // Update Count : 411 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 23 23:24:18 2015 13 // Update Count : 7 14 14 // 15 15 #include <cassert> … … 26 26 virtual ~Mutator(); 27 27 public: 28 virtual ObjectDecl* mutate( ObjectDecl *objectDecl );28 virtual DeclarationWithType* mutate( ObjectDecl *objectDecl ); 29 29 virtual DeclarationWithType* mutate( FunctionDecl *functionDecl ); 30 30 virtual Declaration* mutate( StructDecl *aggregateDecl ); … … 37 37 virtual CompoundStmt* mutate( CompoundStmt *compoundStmt ); 38 38 virtual Statement* mutate( ExprStmt *exprStmt ); 39 virtual Statement* mutate( AsmStmt *asmStmt ); 39 40 virtual Statement* mutate( IfStmt *ifStmt ); 40 41 virtual Statement* mutate( WhileStmt *whileStmt ); … … 70 71 virtual Expression* mutate( SolvedTupleExpr *tupleExpr ); 71 72 virtual Expression* mutate( TypeExpr *typeExpr ); 73 virtual Expression* mutate( AsmExpr *asmExpr ); 72 74 virtual Expression* mutate( UntypedValofExpr *valofExpr ); 73 75 -
src/SynTree/ObjectDecl.cc
re45215c rd60ccbf 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jun 13 08:10:16201513 // Update Count : 1 512 // Last Modified On : Mon Jul 13 18:08:27 2015 13 // Update Count : 16 14 14 // 15 15 … … 20 20 #include "utility.h" 21 21 22 ObjectDecl::ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init )22 ObjectDecl::ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init, bool isInline, bool isNoreturn ) 23 23 : Parent( name, sc, linkage ), type( type ), init( init ), bitfieldWidth( bitfieldWidth ) { 24 set_isInline( isInline ); 25 set_isNoreturn( isNoreturn ); 24 26 } 25 27 -
src/SynTree/Statement.cc
re45215c rd60ccbf 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 : Wed Jul 15 14:57:40 201513 // Update Count : 2711 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 25 12:19:50 2015 13 // Update Count : 53 14 14 // 15 15 … … 42 42 expr->print( os, indent + 2 ); 43 43 } 44 45 46 AsmStmt::AsmStmt( std::list<Label> labels, bool voltile, ConstantExpr *instruction, std::list<Expression *> output, std::list<Expression *> input, std::list<ConstantExpr *> clobber, std::list<Label> gotolabels ) : Statement( labels ), voltile( voltile ), instruction( instruction ), output( output ), input( input ), clobber( clobber ), gotolabels( gotolabels ) {} 47 48 AsmStmt::~AsmStmt() { 49 delete instruction; 50 deleteAll( output ); 51 deleteAll( input ); 52 deleteAll( clobber ); 53 } 54 55 void AsmStmt::print( std::ostream &os, int indent ) const { 56 os << "Assembler Statement:" << endl; 57 os << std::string( indent, ' ' ) << "instruction: " << endl << std::string( indent, ' ' ); 58 instruction->print( os, indent + 2 ); 59 if ( ! output.empty() ) { 60 os << endl << std::string( indent, ' ' ) << "output: " << endl; 61 printAll( output, os, indent + 2 ); 62 } // if 63 if ( ! input.empty() ) { 64 os << std::string( indent, ' ' ) << "input: " << endl << std::string( indent, ' ' ); 65 printAll( input, os, indent + 2 ); 66 } // if 67 if ( ! clobber.empty() ) { 68 os << std::string( indent, ' ' ) << "clobber: " << endl; 69 printAll( clobber, os, indent + 2 ); 70 } // if 71 } 72 44 73 45 74 const char *BranchStmt::brType[] = { "Goto", "Break", "Continue" }; -
src/SynTree/Statement.h
re45215c rd60ccbf 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 : Tue Jul 14 12:14:54201513 // Update Count : 2411 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 25 18:25:37 2015 13 // Update Count : 44 14 14 // 15 15 … … 70 70 }; 71 71 72 class AsmStmt : public Statement { 73 public: 74 AsmStmt( std::list<Label> labels, bool voltile, ConstantExpr *instruction, std::list<Expression *> input, std::list<Expression *> output, std::list<ConstantExpr *> clobber, std::list<Label> gotolabels ); 75 virtual ~AsmStmt(); 76 77 bool get_voltile() { return voltile; } 78 void set_voltile( bool newValue ) { voltile = newValue; } 79 ConstantExpr *get_instruction() { return instruction; } 80 void set_instruction( ConstantExpr *newValue ) { instruction = newValue; } 81 std::list<Expression *> &get_output() { return output; } 82 void set_output( const std::list<Expression *> &newValue ) { output = newValue; } 83 std::list<Expression *> &get_input() { return input; } 84 void set_input( const std::list<Expression *> &newValue ) { input = newValue; } 85 std::list<ConstantExpr *> &get_clobber() { return clobber; } 86 void set_clobber( const std::list<ConstantExpr *> &newValue ) { clobber = newValue; } 87 std::list<Label> &get_gotolabels() { return gotolabels; } 88 void set_gotolabels( const std::list<Label> &newValue ) { gotolabels = newValue; } 89 90 virtual AsmStmt *clone() const { return new AsmStmt( *this ); } 91 virtual void accept( Visitor &v ) { v.visit( this ); } 92 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 93 virtual void print( std::ostream &os, int indent = 0 ) const; 94 private: 95 bool voltile; 96 ConstantExpr *instruction; 97 std::list<Expression *> output, input; 98 std::list<ConstantExpr *> clobber; 99 std::list<Label> gotolabels; 100 }; 101 72 102 class IfStmt : public Statement { 73 103 public: … … 100 130 void set_condition( Expression *newValue ) { condition = newValue; } 101 131 102 std::list<Statement *> & get_branches() { return branches; }132 std::list<Statement *> & get_branches() { return branches; } 103 133 void add_case( CaseStmt * ); 104 134 -
src/SynTree/SynTree.h
re45215c rd60ccbf 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 10:58:22201513 // Update Count : 112 // Last Modified On : Thu Jul 23 23:25:04 2015 13 // Update Count : 3 14 14 // 15 15 … … 40 40 class CompoundStmt; 41 41 class ExprStmt; 42 class AsmStmt; 42 43 class IfStmt; 43 44 class WhileStmt; … … 75 76 class SolvedTupleExpr; 76 77 class TypeExpr; 78 class AsmExpr; 77 79 class UntypedValofExpr; 78 80 -
src/SynTree/Type.cc
re45215c rd60ccbf 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue May 19 16:52:27201513 // Update Count : 212 // Last Modified On : Thu Jul 9 16:45:13 2015 13 // Update Count : 3 14 14 // 15 15 … … 75 75 os << "_Atomic "; 76 76 } // if 77 if ( tq.isAttribute ) { 78 os << "__attribute(( )) "; 79 } // if 77 80 } 78 81 -
src/SynTree/Type.h
re45215c rd60ccbf 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jun 26 16:47:54201513 // Update Count : 1 312 // Last Modified On : Thu Jul 9 16:46:15 2015 13 // Update Count : 14 14 14 // 15 15 … … 25 25 struct Qualifiers { 26 26 Qualifiers(): isConst( false ), isVolatile( false ), isRestrict( false ), isLvalue( false ), isAtomic( false ), isAttribute( false ) {} 27 Qualifiers( bool isConst, bool isVolatile, bool isRestrict, bool isLvalue, bool isAtomic, bool isAttribute ): isConst( isConst ), isVolatile( isVolatile ), isRestrict( isRestrict ), isLvalue( isLvalue ), isAtomic( isAtomic ), isAttribute( isAttribute ) {}27 Qualifiers( bool isConst, bool isVolatile, bool isRestrict, bool isLvalue, bool isAtomic, bool isAttribute ): isConst( isConst ), isVolatile( isVolatile ), isRestrict( isRestrict ), isLvalue( isLvalue ), isAtomic( isAtomic ), isAttribute( isAttribute ) {} 28 28 29 29 Qualifiers &operator+=( const Qualifiers &other ); -
src/SynTree/TypeSubstitution.h
re45215c rd60ccbf 157 157 } 158 158 159 // helper function 159 /// Instantiate each member of the context given the actual parameters specified, and store the 160 /// instantiations for use by the indexer 160 161 template< typename FormalIterator, typename ActualIterator, typename MemberIterator, typename OutputIterator > 161 162 void applySubstitution( FormalIterator formalBegin, FormalIterator formalEnd, ActualIterator actual, MemberIterator memberBegin, MemberIterator memberEnd, OutputIterator out ) { 162 // Instantiate each member of the context given the actual parameters specified, and store the163 // instantiations for use by the indexer164 165 163 TypeSubstitution sub = TypeSubstitution( formalBegin, formalEnd, actual ); 166 164 for ( std::list< Declaration* >::iterator i = memberBegin; i != memberEnd; ++i ) { -
src/SynTree/Visitor.cc
re45215c rd60ccbf 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 : Tue Jul 14 12:31:03201513 // Update Count : 311 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 24 16:11:05 2015 13 // Update Count : 15 14 14 // 15 15 … … 82 82 } 83 83 84 void Visitor::visit( AsmStmt *asmStmt ) { 85 maybeAccept( asmStmt->get_instruction(), *this ); 86 acceptAll( asmStmt->get_output(), *this ); 87 acceptAll( asmStmt->get_input(), *this ); 88 acceptAll( asmStmt->get_clobber(), *this ); 89 } 90 84 91 void Visitor::visit( IfStmt *ifStmt ) { 85 92 maybeAccept( ifStmt->get_condition(), *this ); … … 246 253 } 247 254 255 void Visitor::visit( AsmExpr *asmExpr ) { 256 maybeAccept( asmExpr->get_inout(), *this ); 257 maybeAccept( asmExpr->get_constraint(), *this ); 258 maybeAccept( asmExpr->get_operand(), *this ); 259 } 260 248 261 void Visitor::visit( UntypedValofExpr *valofExpr ) { 249 262 acceptAll( valofExpr->get_results(), *this ); … … 282 295 283 296 void Visitor::visit( StructInstType *aggregateUseType ) { 284 visit( static_cast< ReferenceToType * >( aggregateUseType ) );297 visit( static_cast< ReferenceToType * >( aggregateUseType ) ); 285 298 } 286 299 287 300 void Visitor::visit( UnionInstType *aggregateUseType ) { 288 visit( static_cast< ReferenceToType * >( aggregateUseType ) );301 visit( static_cast< ReferenceToType * >( aggregateUseType ) ); 289 302 } 290 303 291 304 void Visitor::visit( EnumInstType *aggregateUseType ) { 292 visit( static_cast< ReferenceToType * >( aggregateUseType ) );305 visit( static_cast< ReferenceToType * >( aggregateUseType ) ); 293 306 } 294 307 295 308 void Visitor::visit( ContextInstType *aggregateUseType ) { 296 visit( static_cast< ReferenceToType * >( aggregateUseType ) );309 visit( static_cast< ReferenceToType * >( aggregateUseType ) ); 297 310 acceptAll( aggregateUseType->get_members(), *this ); 298 311 } 299 312 300 313 void Visitor::visit( TypeInstType *aggregateUseType ) { 301 visit( static_cast< ReferenceToType * >( aggregateUseType ) );314 visit( static_cast< ReferenceToType * >( aggregateUseType ) ); 302 315 } 303 316 -
src/SynTree/Visitor.h
re45215c rd60ccbf 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 11:15:55201513 // Update Count : 212 // Last Modified On : Thu Jul 23 23:22:23 2015 13 // Update Count : 4 14 14 // 15 15 … … 37 37 virtual void visit( CompoundStmt *compoundStmt ); 38 38 virtual void visit( ExprStmt *exprStmt ); 39 virtual void visit( AsmStmt *asmStmt ); 39 40 virtual void visit( IfStmt *ifStmt ); 40 41 virtual void visit( WhileStmt *whileStmt ); … … 70 71 virtual void visit( SolvedTupleExpr *tupleExpr ); 71 72 virtual void visit( TypeExpr *typeExpr ); 73 virtual void visit( AsmExpr *asmExpr ); 72 74 virtual void visit( UntypedValofExpr *valofExpr ); 73 75
Note:
See TracChangeset
for help on using the changeset viewer.