Changes in src/SynTree/FunctionDecl.cc [7baed7d:d3b7937]
- File:
-
- 1 edited
-
src/SynTree/FunctionDecl.cc (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/FunctionDecl.cc
r7baed7d rd3b7937 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 : Rob Schluntz12 // Last Modified On : Fri May 06 15:59:48 201611 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jul 13 18:11:44 2015 13 13 // Update Count : 19 14 14 // … … 19 19 #include "Statement.h" 20 20 #include "Type.h" 21 #include "Attribute.h"22 21 #include "Common/utility.h" 23 22 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 ){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 ) { 26 25 set_isInline( isInline ); 27 26 set_isNoreturn( isNoreturn ); … … 34 33 FunctionDecl::FunctionDecl( const FunctionDecl &other ) 35 34 : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) { 36 cloneAll( other.attributes, attributes );37 35 } 38 36 … … 40 38 delete type; 41 39 delete statements; 42 deleteAll( attributes );43 40 } 44 41 … … 55 52 using std::endl; 56 53 using std::string; 57 54 58 55 if ( get_name() != "" ) { 59 56 os << get_name() << ": "; … … 68 65 os << "_Noreturn "; 69 66 } // if 70 71 printAll( attributes, os, indent );72 73 67 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 74 68 os << DeclarationNode::storageName[ get_storageClass() ] << ' '; … … 93 87 if ( statements ) { 94 88 os << string( indent + 2, ' ' ) << "with body " << endl; 95 os << string( indent + 4, ' ' );96 89 statements->print( os, indent + 4 ); 97 90 } // if … … 101 94 using std::endl; 102 95 using std::string; 103 96 104 97 if ( get_name() != "" ) { 105 98 os << get_name() << ": "; … … 111 104 os << "_Noreturn "; 112 105 } // if 113 114 // xxx - should printShort print attributes?115 116 106 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 117 107 os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
Note:
See TracChangeset
for help on using the changeset viewer.