Changeset f80e0218 for src/SynTree/FunctionDecl.cc
- Timestamp:
- Jun 30, 2016, 4:32:56 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, with_gc
- Children:
- ea29e73
- Parents:
- 1b5c81ed (diff), 84d4d6f (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. - File:
-
- 1 edited
-
src/SynTree/FunctionDecl.cc (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/FunctionDecl.cc
r1b5c81ed rf80e0218 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // FunctionDecl.cc -- 7 // FunctionDecl.cc -- 8 8 // 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 Jul 13 18:11:44 201511 // Last Modified By : Rob Schluntz 12 // Last Modified On : Fri May 06 15:59:48 2016 13 13 // Update Count : 19 14 14 // … … 19 19 #include "Statement.h" 20 20 #include "Type.h" 21 #include "Attribute.h" 21 22 #include "Common/utility.h" 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 ) {24 FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, std::list< Attribute * > attributes ) 25 : Parent( name, sc, linkage ), type( type ), statements( statements ), attributes( attributes ) { 25 26 set_isInline( isInline ); 26 27 set_isNoreturn( isNoreturn ); … … 33 34 FunctionDecl::FunctionDecl( const FunctionDecl &other ) 34 35 : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) { 36 cloneAll( other.attributes, attributes ); 35 37 } 36 38 … … 38 40 delete type; 39 41 delete statements; 42 deleteAll( attributes ); 40 43 } 41 44 … … 52 55 using std::endl; 53 56 using std::string; 54 57 55 58 if ( get_name() != "" ) { 56 59 os << get_name() << ": "; … … 65 68 os << "_Noreturn "; 66 69 } // if 70 71 printAll( attributes, os, indent ); 72 67 73 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 68 74 os << DeclarationNode::storageName[ get_storageClass() ] << ' '; … … 87 93 if ( statements ) { 88 94 os << string( indent + 2, ' ' ) << "with body " << endl; 95 os << string( indent + 4, ' ' ); 89 96 statements->print( os, indent + 4 ); 90 97 } // if … … 94 101 using std::endl; 95 102 using std::string; 96 103 97 104 if ( get_name() != "" ) { 98 105 os << get_name() << ": "; … … 104 111 os << "_Noreturn "; 105 112 } // if 113 114 // xxx - should printShort print attributes? 115 106 116 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 107 117 os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
Note:
See TracChangeset
for help on using the changeset viewer.