Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/FunctionDecl.cc

    r1db21619 rf9cebb5  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // FunctionDecl.cc -- 
     7// FunctionDecl.cc --
    88//
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jul 13 18:11:44 2015
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Fri May 06 15:59:48 2016
    1313// Update Count     : 19
    1414//
     
    1919#include "Statement.h"
    2020#include "Type.h"
    21 #include "utility.h"
     21#include "Attribute.h"
     22#include "Common/utility.h"
    2223
    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 ) {
     24FunctionDecl::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, attributes ), type( type ), statements( statements ) {
    2526        set_isInline( isInline );
    2627        set_isNoreturn( isNoreturn );
     
    5253        using std::endl;
    5354        using std::string;
    54        
     55
    5556        if ( get_name() != "" ) {
    5657                os << get_name() << ": ";
     
    6566                os << "_Noreturn ";
    6667        } // if
     68
     69        printAll( get_attributes(), os, indent );
     70
    6771        if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
    6872                os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
     
    8791        if ( statements ) {
    8892                os << string( indent + 2, ' ' ) << "with body " << endl;
     93                os << string( indent + 4, ' ' );
    8994                statements->print( os, indent + 4 );
    9095        } // if
     
    9499        using std::endl;
    95100        using std::string;
    96        
     101
    97102        if ( get_name() != "" ) {
    98103                os << get_name() << ": ";
     
    104109                os << "_Noreturn ";
    105110        } // if
     111
     112        // xxx - should printShort print attributes?
     113
    106114        if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
    107115                os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
Note: See TracChangeset for help on using the changeset viewer.