Changes in src/SynTree/FunctionDecl.cc [d3b7937:7baed7d]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/FunctionDecl.cc
rd3b7937 r7baed7d 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.