Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/FunctionDecl.cc

    rde62360d r843054c2  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jun 13 09:10:32 2015
    13 // Update Count     : 16
     12// Last Modified On : Thu May 21 21:31:16 2015
     13// Update Count     : 11
    1414//
    1515
     
    2121#include "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 ), isInline( isInline ), isNoreturn( isNoreturn ) {
     23FunctionDecl::FunctionDecl( const std::string &name, StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline )
     24                : Parent( name, sc, linkage ), type( type ), statements( statements ), isInline( isInline ) {
    2525        // this is a brazen hack to force the function "main" to have C linkage
    2626        if ( name == "main" ) {
     
    3030
    3131FunctionDecl::FunctionDecl( const FunctionDecl &other )
    32         : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ), isInline( other.isInline ), isNoreturn( other.isNoreturn ) {
     32                : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ), isInline( other.isInline ) {
    3333}
    3434
     
    5252       
    5353        if ( get_name() != "" ) {
    54                 os << get_name() << ": ";
     54                os << get_name() << ": a ";
    5555        } // if
    5656        if ( get_linkage() != LinkageSpec::Cforall ) {
     
    6060                os << "inline ";
    6161        } // if
    62         if ( isNoreturn ) {
    63                 os << "_Noreturn ";
    64         } // if
    65         if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
    66                 os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
     62        if ( get_storageClass() != NoStorageClass ) {
     63                os << storageClassName[ get_storageClass() ] << ' ';
    6764        } // if
    6865        if ( get_type() ) {
     
    7370
    7471        if ( ! oldIdents.empty() ) {
    75                 os << string( indent + 2, ' ' ) << "with parameter names" << endl;
     72                os << string( indent+2, ' ' ) << "with parameter names" << endl;
    7673                for ( std::list< std::string >::const_iterator i = oldIdents.begin(); i != oldIdents.end(); ++i ) {
    77                         os << string( indent + 4, ' ' ) << *i << endl;
     74                        os << string( indent+4, ' ' ) << *i << endl;
    7875                } // for
    7976        } // if
    8077
    8178        if ( ! oldDecls.empty() ) {
    82                 os << string( indent + 2, ' ' ) << "with parameter declarations" << endl;
    83                 printAll( oldDecls, os, indent + 4 );
     79                os << string( indent+2, ' ' ) << "with parameter declarations" << endl;
     80                printAll( oldDecls, os, indent+4 );
    8481        } // if
    8582        if ( statements ) {
    86                 os << string( indent + 2, ' ' ) << "with body " << endl;
    87                 statements->print( os, indent + 4 );
     83                os << string( indent+2, ' ' ) << "with body " << endl;
     84                statements->print( os, indent+4 );
    8885        } // if
    8986}
     
    9491       
    9592        if ( get_name() != "" ) {
    96                 os << get_name() << ": ";
     93                os << get_name() << ": a ";
    9794        } // if
    9895        if ( isInline ) {
    9996                os << "inline ";
    10097        } // if
    101         if ( isNoreturn ) {
    102                 os << "_Noreturn ";
    103         } // if
    104         if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
    105                 os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
     98        if ( get_storageClass() != NoStorageClass ) {
     99                os << storageClassName[ get_storageClass() ] << ' ';
    106100        } // if
    107101        if ( get_type() ) {
Note: See TracChangeset for help on using the changeset viewer.