Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r3a5131ed ra7c90d4  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb 16 14:56:29 2017
    13 // Update Count     : 418
     12// Last Modified On : Sun Mar  5 17:13:33 2017
     13// Update Count     : 475
    1414//
    1515
     
    134134
    135135                handleStorageClass( functionDecl );
    136                 if ( functionDecl->get_isInline() ) {
    137                         output << "inline ";
    138                 } // if
    139                 if ( functionDecl->get_isNoreturn() ) {
    140                         output << "_Noreturn ";
    141                 } // if
     136                DeclarationNode::print_FuncSpec( output, functionDecl->get_funcSpec() );
     137
    142138                output << genType( functionDecl->get_functionType(), mangleName( functionDecl ), pretty );
    143139
     
    835831        }
    836832
    837 
    838833        void CodeGenerator::visit( ReturnStmt * returnStmt ) {
    839834                output << "return ";
     
    899894        }
    900895
    901         void CodeGenerator::handleStorageClass( Declaration * decl ) {
    902                 switch ( decl->get_storageClass() ) {
    903                   case DeclarationNode::Extern:
    904                         output << "extern ";
    905                         break;
    906                   case DeclarationNode::Static:
    907                         output << "static ";
    908                         break;
    909                   case DeclarationNode::Auto:
    910                         // silently drop storage class
    911                         break;
    912                   case DeclarationNode::Register:
    913                         output << "register ";
    914                         break;
    915                   case DeclarationNode::Inline:
    916                         output << "inline ";
    917                         break;
    918                   case DeclarationNode::Fortran:
    919                         output << "fortran ";
    920                         break;
    921                   case DeclarationNode::Noreturn:
    922                         output << "_Noreturn ";
    923                         break;
    924                   case DeclarationNode::Threadlocal:
    925                         output << "_Thread_local ";
    926                         break;
    927                   case DeclarationNode::NoStorageClass:
    928                         break;
    929                 } // switch
    930         }
     896        void CodeGenerator::handleStorageClass( DeclarationWithType * decl ) {
     897                if ( decl->get_storageClasses().any() ) {
     898                        DeclarationNode::print_StorageClass( output, decl->get_storageClasses() );
     899                } // if
     900        } // CodeGenerator::handleStorageClass
    931901
    932902        std::string genName( DeclarationWithType * decl ) {
Note: See TracChangeset for help on using the changeset viewer.