Changes in src/SynTree/FunctionDecl.cc [a7c90d4:3a5131ed]
- File:
-
- 1 edited
-
src/SynTree/FunctionDecl.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/FunctionDecl.cc
ra7c90d4 r3a5131ed 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 Mar 7 07:54:58201713 // Update Count : 6812 // Last Modified On : Thu Feb 16 15:01:52 2017 13 // Update Count : 23 14 14 // 15 15 … … 26 26 extern bool translation_unit_nomain; 27 27 28 FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClasses scs, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, std::list< Attribute * > attributes, DeclarationNode::FuncSpecifiers fs ) 29 : Parent( name, scs, linkage, attributes, fs ), type( type ), statements( statements ) { 30 // hack forcing the function "main" to have Cforall linkage to replace main even if it is inside an extern 28 FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, std::list< Attribute * > attributes ) 29 : Parent( name, sc, linkage, attributes ), type( type ), statements( statements ) { 30 set_isInline( isInline ); 31 set_isNoreturn( isNoreturn ); 32 // this is a brazen hack to force the function "main" to have Cforall linkage 33 // because we want to replace the main even if it is inside an extern 31 34 if ( name == "main" ) { 32 35 set_linkage( CodeGen::FixMain::mainLinkage() ); … … 35 38 36 39 FunctionDecl::FunctionDecl( const FunctionDecl &other ) 37 : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) {40 : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) { 38 41 } 39 42 … … 62 65 os << LinkageSpec::linkageName( get_linkage() ) << " "; 63 66 } // if 67 if ( get_isInline() ) { 68 os << "inline "; 69 } // if 70 if ( get_isNoreturn() ) { 71 os << "_Noreturn "; 72 } // if 64 73 65 74 printAll( get_attributes(), os, indent ); 66 75 67 DeclarationNode::print_StorageClass( os, get_storageClasses() );68 DeclarationNode::print_FuncSpec( os, get_funcSpec() );69 76 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 77 os << DeclarationNode::storageName[ get_storageClass() ] << ' '; 78 } // if 70 79 if ( get_type() ) { 71 80 get_type()->print( os, indent ); … … 88 97 os << get_name() << ": "; 89 98 } // if 99 if ( get_isInline() ) { 100 os << "inline "; 101 } // if 102 if ( get_isNoreturn() ) { 103 os << "_Noreturn "; 104 } // if 90 105 91 106 // xxx - should printShort print attributes? 92 107 93 DeclarationNode::print_StorageClass( os, get_storageClasses() );94 DeclarationNode::print_FuncSpec( os, get_funcSpec() );95 108 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 109 os << DeclarationNode::storageName[ get_storageClass() ] << ' '; 110 } // if 96 111 if ( get_type() ) { 97 112 get_type()->print( os, indent );
Note:
See TracChangeset
for help on using the changeset viewer.