Ignore:
Timestamp:
Jun 30, 2016, 4:32:56 PM (10 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
ea29e73
Parents:
1b5c81ed (diff), 84d4d6f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into gc_noraii

Conflicts:

Jenkinsfile
src/SymTab/Validate.cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/FunctionDecl.cc

    r1b5c81ed rf80e0218  
    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 "Attribute.h"
    2122#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 ), type( type ), statements( statements ), attributes( attributes ) {
    2526        set_isInline( isInline );
    2627        set_isNoreturn( isNoreturn );
     
    3334FunctionDecl::FunctionDecl( const FunctionDecl &other )
    3435        : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) {
     36                cloneAll( other.attributes, attributes );
    3537}
    3638
     
    3840        delete type;
    3941        delete statements;
     42        deleteAll( attributes );
    4043}
    4144
     
    5255        using std::endl;
    5356        using std::string;
    54        
     57
    5558        if ( get_name() != "" ) {
    5659                os << get_name() << ": ";
     
    6568                os << "_Noreturn ";
    6669        } // if
     70
     71        printAll( attributes, os, indent );
     72
    6773        if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
    6874                os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
     
    8793        if ( statements ) {
    8894                os << string( indent + 2, ' ' ) << "with body " << endl;
     95                os << string( indent + 4, ' ' );
    8996                statements->print( os, indent + 4 );
    9097        } // if
     
    94101        using std::endl;
    95102        using std::string;
    96        
     103
    97104        if ( get_name() != "" ) {
    98105                os << get_name() << ": ";
     
    104111                os << "_Noreturn ";
    105112        } // if
     113
     114        // xxx - should printShort print attributes?
     115
    106116        if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
    107117                os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
Note: See TracChangeset for help on using the changeset viewer.