Ignore:
Timestamp:
Jun 24, 2015, 4:04:19 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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, string, with_gc
Children:
94e0864d
Parents:
a1d5d2a
Message:

fix computed goto, fixed -std=, implicit typedefs for enum and aggregates, add _Noreturn _Thread_local

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/FunctionDecl.cc

    ra1d5d2a rde62360d  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jun 13 08:12:20 2015
    13 // Update Count     : 14
     12// Last Modified On : Sat Jun 13 09:10:32 2015
     13// Update Count     : 16
    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 )
    24                 : Parent( name, sc, linkage ), type( type ), statements( statements ), isInline( isInline ) {
     23FunctionDecl::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 ) {
    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 ) {
     32        : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ), isInline( other.isInline ), isNoreturn( other.isNoreturn ) {
    3333}
    3434
     
    6060                os << "inline ";
    6161        } // if
     62        if ( isNoreturn ) {
     63                os << "_Noreturn ";
     64        } // if
    6265        if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
    6366                os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
     
    7073
    7174        if ( ! oldIdents.empty() ) {
    72                 os << string( indent+2, ' ' ) << "with parameter names" << endl;
     75                os << string( indent + 2, ' ' ) << "with parameter names" << endl;
    7376                for ( std::list< std::string >::const_iterator i = oldIdents.begin(); i != oldIdents.end(); ++i ) {
    74                         os << string( indent+4, ' ' ) << *i << endl;
     77                        os << string( indent + 4, ' ' ) << *i << endl;
    7578                } // for
    7679        } // if
    7780
    7881        if ( ! oldDecls.empty() ) {
    79                 os << string( indent+2, ' ' ) << "with parameter declarations" << endl;
    80                 printAll( oldDecls, os, indent+4 );
     82                os << string( indent + 2, ' ' ) << "with parameter declarations" << endl;
     83                printAll( oldDecls, os, indent + 4 );
    8184        } // if
    8285        if ( statements ) {
    83                 os << string( indent+2, ' ' ) << "with body " << endl;
    84                 statements->print( os, indent+4 );
     86                os << string( indent + 2, ' ' ) << "with body " << endl;
     87                statements->print( os, indent + 4 );
    8588        } // if
    8689}
     
    9598        if ( isInline ) {
    9699                os << "inline ";
     100        } // if
     101        if ( isNoreturn ) {
     102                os << "_Noreturn ";
    97103        } // if
    98104        if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
Note: See TracChangeset for help on using the changeset viewer.