Changeset 6943a987 for src/SynTree
- Timestamp:
- Aug 29, 2016, 10:33:05 AM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, 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, resolv-new, with_gc
- Children:
- 5e644d3e
- Parents:
- 79841be (diff), 413ad05 (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:
-
- 11 edited
-
AggregateDecl.cc (modified) (1 diff)
-
Declaration.cc (modified) (2 diffs)
-
Declaration.h (modified) (7 diffs)
-
DeclarationWithType.cc (modified) (2 diffs)
-
Expression.cc (modified) (3 diffs)
-
FunctionDecl.cc (modified) (3 diffs)
-
Initializer.cc (modified) (1 diff)
-
ObjectDecl.cc (modified) (2 diffs)
-
Statement.cc (modified) (7 diffs)
-
Statement.h (modified) (2 diffs)
-
TypeSubstitution.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/AggregateDecl.cc
r79841be r6943a987 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // AggregateDecl.cc -- 7 // AggregateDecl.cc -- 8 8 // 9 9 // Author : Richard C. Bilson -
src/SynTree/Declaration.cc
r79841be r6943a987 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 Dec 09 14:08:29 201513 // Update Count : 1 211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Aug 18 23:49:57 2016 13 // Update Count : 13 14 14 // 15 15 … … 27 27 static IdMapType idMap; 28 28 29 Declaration::Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec:: Typelinkage )29 Declaration::Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage ) 30 30 : name( name ), storageClass( sc ), linkage( linkage ), isInline( false ), isNoreturn( false ), uniqueId( 0 ) { 31 31 } -
src/SynTree/Declaration.h
r79841be r6943a987 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 Jul 12 21:03:17201613 // Update Count : 3912 // Last Modified On : Thu Aug 18 23:50:24 2016 13 // Update Count : 40 14 14 // 15 15 … … 26 26 class Declaration { 27 27 public: 28 Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec:: Typelinkage );28 Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage ); 29 29 Declaration( const Declaration &other ); 30 30 virtual ~Declaration(); … … 34 34 DeclarationNode::StorageClass get_storageClass() const { return storageClass; } 35 35 void set_storageClass( DeclarationNode::StorageClass newValue ) { storageClass = newValue; } 36 LinkageSpec:: Typeget_linkage() const { return linkage; }37 void set_linkage( LinkageSpec:: TypenewValue ) { linkage = newValue; }36 LinkageSpec::Spec get_linkage() const { return linkage; } 37 void set_linkage( LinkageSpec::Spec newValue ) { linkage = newValue; } 38 38 bool get_isInline() const { return isInline; } 39 39 void set_isInline( bool newValue ) { isInline = newValue; } … … 56 56 std::string name; 57 57 DeclarationNode::StorageClass storageClass; 58 LinkageSpec:: Typelinkage;58 LinkageSpec::Spec linkage; 59 59 bool isInline, isNoreturn; 60 60 UniqueId uniqueId; … … 64 64 class DeclarationWithType : public Declaration { 65 65 public: 66 DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec:: Typelinkage, const std::list< Attribute * > & attributes );66 DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes ); 67 67 DeclarationWithType( const DeclarationWithType &other ); 68 68 virtual ~DeclarationWithType(); … … 97 97 typedef DeclarationWithType Parent; 98 98 public: 99 ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec:: Typelinkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes = std::list< Attribute * >(), bool isInline = false, bool isNoreturn = false );99 ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes = std::list< Attribute * >(), bool isInline = false, bool isNoreturn = false ); 100 100 ObjectDecl( const ObjectDecl &other ); 101 101 virtual ~ObjectDecl(); … … 123 123 typedef DeclarationWithType Parent; 124 124 public: 125 FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec:: Typelinkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, const std::list< Attribute * > attributes = std::list< Attribute * >() );125 FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, const std::list< Attribute * > attributes = std::list< Attribute * >() ); 126 126 FunctionDecl( const FunctionDecl &other ); 127 127 virtual ~FunctionDecl(); -
src/SynTree/DeclarationWithType.cc
r79841be r6943a987 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 : Mon Apr 11 15:35:27201613 // Update Count : 311 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Aug 18 23:50:41 2016 13 // Update Count : 4 14 14 // 15 15 … … 19 19 #include "Common/utility.h" 20 20 21 DeclarationWithType::DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec:: Typelinkage, const std::list< Attribute * > & attributes )21 DeclarationWithType::DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes ) 22 22 : Declaration( name, sc, linkage ), attributes( attributes ) { 23 23 } -
src/SynTree/Expression.cc
r79841be r6943a987 200 200 201 201 OffsetofExpr::OffsetofExpr( const OffsetofExpr &other ) : 202 Expression( other ), type( maybeClone( other.type ) ), member( maybeClone( other.member )) {}202 Expression( other ), type( maybeClone( other.type ) ), member( other.member ) {} 203 203 204 204 OffsetofExpr::~OffsetofExpr() { 205 205 delete type; 206 delete member;207 206 } 208 207 … … 359 358 assert( member ); 360 359 os << std::string( indent + 2, ' ' ); 360 os << (void*)member << " "; 361 361 member->print( os, indent + 2 ); 362 362 os << std::endl; … … 383 383 Expression( _aname ), function(_function), args(_args) {} 384 384 385 UntypedExpr::~UntypedExpr() {} 385 UntypedExpr::~UntypedExpr() { 386 delete function; 387 deleteAll( args ); 388 } 386 389 387 390 void UntypedExpr::print( std::ostream &os, int indent ) const { -
src/SynTree/FunctionDecl.cc
r79841be r6943a987 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 06 15:59:48201613 // Update Count : 1911 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Aug 18 23:50:14 2016 13 // Update Count : 20 14 14 // 15 15 … … 22 22 #include "Common/utility.h" 23 23 24 FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec:: Typelinkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, std::list< Attribute * > attributes )24 FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, std::list< Attribute * > attributes ) 25 25 : Parent( name, sc, linkage, attributes ), type( type ), statements( statements ) { 26 26 set_isInline( isInline ); … … 39 39 delete type; 40 40 delete statements; 41 deleteAll( oldDecls ); 41 42 } 42 43 -
src/SynTree/Initializer.cc
r79841be r6943a987 43 43 44 44 SingleInit::~SingleInit() { 45 delete value; 45 46 deleteAll(designators); 46 47 } -
src/SynTree/ObjectDecl.cc
r79841be r6943a987 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 13 13:23:32201613 // Update Count : 3 011 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Aug 18 23:50:33 2016 13 // Update Count : 31 14 14 // 15 15 … … 22 22 #include "Statement.h" 23 23 24 ObjectDecl::ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec:: Typelinkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes, bool isInline, bool isNoreturn )24 ObjectDecl::ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes, bool isInline, bool isNoreturn ) 25 25 : Parent( name, sc, linkage, attributes ), type( type ), init( init ), bitfieldWidth( bitfieldWidth ) { 26 26 set_isInline( isInline ); -
src/SynTree/Statement.cc
r79841be r6943a987 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Aug 4 11:25:20201613 // Update Count : 6 112 // Last Modified On : Fri Aug 12 13:58:48 2016 13 // Update Count : 62 14 14 // 15 15 … … 124 124 Statement( other ), condition( maybeClone( other.condition ) ), thenPart( maybeClone( other.thenPart ) ), elsePart( maybeClone( other.elsePart ) ) {} 125 125 126 IfStmt::~IfStmt() {} 126 IfStmt::~IfStmt() { 127 delete condition; 128 delete thenPart; 129 delete elsePart; 130 } 127 131 128 132 void IfStmt::print( std::ostream &os, int indent ) const { … … 155 159 delete condition; 156 160 // destroy statements 161 deleteAll( statements ); 157 162 } 158 163 … … 183 188 CaseStmt::~CaseStmt() { 184 189 delete condition; 190 deleteAll( stmts ); 185 191 } 186 192 … … 216 222 WhileStmt::~WhileStmt() { 217 223 delete body; 224 delete condition; 218 225 } 219 226 … … 290 297 TryStmt::~TryStmt() { 291 298 delete block; 299 deleteAll( handlers ); 300 delete finallyBlock; 292 301 } 293 302 … … 309 318 } 310 319 311 CatchStmt::CatchStmt( std::list<Label> labels, Declaration *_decl, Statement *_body, bool isCatchRest) :312 Statement( labels ), decl ( _decl ), body( _body ), catchRest ( isCatchRest) {320 CatchStmt::CatchStmt( std::list<Label> labels, Declaration *_decl, Statement *_body, bool catchAny ) : 321 Statement( labels ), decl ( _decl ), body( _body ), catchRest ( catchAny ) { 313 322 } 314 323 -
src/SynTree/Statement.h
r79841be r6943a987 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Aug 4 11:26:02201613 // Update Count : 6 412 // Last Modified On : Fri Aug 12 13:57:46 2016 13 // Update Count : 65 14 14 // 15 15 … … 314 314 class CatchStmt : public Statement { 315 315 public: 316 CatchStmt( std::list<Label> labels, Declaration *decl, Statement *body, bool isCatchRest= false );316 CatchStmt( std::list<Label> labels, Declaration *decl, Statement *body, bool catchAny = false ); 317 317 CatchStmt( const CatchStmt &other ); 318 318 virtual ~CatchStmt(); -
src/SynTree/TypeSubstitution.h
r79841be r6943a987 169 169 TypeSubstitution sub = TypeSubstitution( formalBegin, formalEnd, actual ); 170 170 for ( std::list< Declaration* >::iterator i = memberBegin; i != memberEnd; ++i ) { 171 Declaration *newdecl = (*i)->clone(); 172 sub.apply( newdecl ); 173 *out++ = newdecl; 171 sub.apply( *i ); 172 *out++ = *i; 174 173 } // for 175 174 }
Note:
See TracChangeset
for help on using the changeset viewer.