Changeset dd020c0 for src/SynTree/FunctionDecl.cc
- Timestamp:
- Mar 3, 2017, 10:12:02 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 8191203
- Parents:
- f37147b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/FunctionDecl.cc
rf37147b rdd020c0 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 16 15:01:52201713 // Update Count : 2312 // Last Modified On : Fri Mar 3 21:29:41 2017 13 // Update Count : 55 14 14 // 15 15 … … 26 26 extern bool translation_unit_nomain; 27 27 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 28 FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, std::list< Attribute * > attributes, DeclarationNode::FuncSpec fs ) 29 : Parent( name, sc, linkage, attributes, fs ), type( type ), statements( statements ) { 30 set_functionSpecifiers( fs ); 31 32 // hack forcing the function "main" to have Cforall linkage to replace main even if it is inside an extern 34 33 if ( name == "main" ) { 35 34 set_linkage( CodeGen::FixMain::mainLinkage() ); … … 65 64 os << LinkageSpec::linkageName( get_linkage() ) << " "; 66 65 } // if 67 if ( get_isInline() ) {68 os << "inline ";69 } // if70 if ( get_isNoreturn() ) {71 os << "_Noreturn ";72 } // if73 66 74 67 printAll( get_attributes(), os, indent ); 75 68 76 69 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 77 os << DeclarationNode::storage Name[ get_storageClass() ] << ' ';70 os << DeclarationNode::storageClassNames[ get_storageClass() ] << ' '; 78 71 } // if 72 DeclarationNode::print_FuncSpec( os, get_funcSpec() ); 73 79 74 if ( get_type() ) { 80 75 get_type()->print( os, indent ); … … 97 92 os << get_name() << ": "; 98 93 } // if 99 if ( get_isInline() ) {100 os << "inline ";101 } // if102 if ( get_isNoreturn() ) {103 os << "_Noreturn ";104 } // if105 94 106 95 // xxx - should printShort print attributes? 107 96 108 97 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 109 os << DeclarationNode::storage Name[ get_storageClass() ] << ' ';98 os << DeclarationNode::storageClassNames[ get_storageClass() ] << ' '; 110 99 } // if 100 DeclarationNode::print_FuncSpec( os, get_funcSpec() ); 101 111 102 if ( get_type() ) { 112 103 get_type()->print( os, indent );
Note: See TracChangeset
for help on using the changeset viewer.