Changes in src/SynTree/FunctionDecl.cc [7baed7d:03e5d14]
- File:
-
- 1 edited
-
src/SynTree/FunctionDecl.cc (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/FunctionDecl.cc
r7baed7d r03e5d14 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Fri May 06 15: 59:48201612 // Last Modified On : Fri May 06 15:41:05 2016 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 ), attribute s( attributes) {23 FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, Attribute attribute ) 24 : Parent( name, sc, linkage ), type( type ), statements( statements ), attribute( attribute ) { 26 25 set_isInline( isInline ); 27 26 set_isNoreturn( isNoreturn ); … … 33 32 34 33 FunctionDecl::FunctionDecl( const FunctionDecl &other ) 35 : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) { 36 cloneAll( other.attributes, attributes ); 34 : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ), attribute( other.attribute ) { 37 35 } 38 36 … … 40 38 delete type; 41 39 delete statements; 42 deleteAll( attributes );43 40 } 44 41 … … 68 65 os << "_Noreturn "; 69 66 } // if 70 71 printAll( attributes, os, indent ); 72 67 switch ( attribute.type ) { 68 case Attribute::Constructor: 69 os << "Global Constructor "; 70 break; 71 case Attribute::Destructor: 72 os << "Global Destructor "; 73 break; 74 default: 75 break; 76 } 77 if ( attribute.priority != Attribute::Default ) { 78 os << "with priority " << attribute.priority << " "; 79 } 73 80 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 74 81 os << DeclarationNode::storageName[ get_storageClass() ] << ' '; … … 93 100 if ( statements ) { 94 101 os << string( indent + 2, ' ' ) << "with body " << endl; 95 os << string( indent + 4, ' ' );96 102 statements->print( os, indent + 4 ); 97 103 } // if … … 111 117 os << "_Noreturn "; 112 118 } // if 113 114 // xxx - should printShort print attributes? 115 119 switch ( attribute.type ) { 120 case Attribute::Constructor: 121 os << " Global Constructor "; 122 break; 123 case Attribute::Destructor: 124 os << " Global Destructor "; 125 break; 126 default: 127 break; 128 } 129 if ( attribute.priority != Attribute::Default ) { 130 os << "with priority " << attribute.priority << " "; 131 } 116 132 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 117 133 os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
Note:
See TracChangeset
for help on using the changeset viewer.