Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/FunctionDecl.cc

    rd3b7937 r4e24610  
    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 11:35:09 2016
    1313// Update Count     : 19
    1414//
     
    2121#include "Common/utility.h"
    2222
    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 ) {
     23FunctionDecl::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 ) {
    2525        set_isInline( isInline );
    2626        set_isNoreturn( isNoreturn );
     
    3232
    3333FunctionDecl::FunctionDecl( const FunctionDecl &other )
    34         : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) {
     34        : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ), attribute( other.attribute ) {
    3535}
    3636
     
    5252        using std::endl;
    5353        using std::string;
    54        
     54
    5555        if ( get_name() != "" ) {
    5656                os << get_name() << ": ";
     
    6565                os << "_Noreturn ";
    6666        } // if
     67        switch ( attribute ) {
     68                case Constructor:
     69                        os << "Global Constructor ";
     70                        break;
     71                case Destructor:
     72                        os << "Global Destructor ";
     73                        break;
     74                default:
     75                        break;
     76        }
    6777        if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
    6878                os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
     
    94104        using std::endl;
    95105        using std::string;
    96        
     106
    97107        if ( get_name() != "" ) {
    98108                os << get_name() << ": ";
     
    104114                os << "_Noreturn ";
    105115        } // if
     116        switch ( attribute ) {
     117                case Constructor:
     118                        os << " Global Constructor ";
     119                        break;
     120                case Destructor:
     121                        os << " Global Destructor ";
     122                        break;
     123                default:
     124                        break;
     125        }
    106126        if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
    107127                os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
Note: See TracChangeset for help on using the changeset viewer.