Changeset dd020c0 for src/CodeGen


Ignore:
Timestamp:
Mar 3, 2017, 10:12:02 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
8191203
Parents:
f37147b
Message:

first attempt to create function specifiers

Location:
src/CodeGen
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    rf37147b rdd020c0  
    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 : Fri Mar  3 21:18:47 2017
     13// Update Count     : 465
    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 ) {
     896        void CodeGenerator::handleStorageClass( DeclarationWithType * decl ) {
    902897                switch ( decl->get_storageClass() ) {
     898                        //output << DeclarationNode::storageClassNames[decl->get_storageClass()] << ' ';
    903899                  case DeclarationNode::Extern:
    904900                        output << "extern ";
     
    913909                        output << "register ";
    914910                        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;
    924911                  case DeclarationNode::Threadlocal:
    925                         output << "_Thread_local ";
    926                         break;
     912                        output << "_Thread_local ";
     913                        break;
    927914                  case DeclarationNode::NoStorageClass:
    928915                        break;
     916                  default:
     917                        assert( false );
    929918                } // switch
    930         }
     919        } // CodeGenerator::handleStorageClass
    931920
    932921        std::string genName( DeclarationWithType * decl ) {
  • src/CodeGen/CodeGenerator.h

    rf37147b rdd020c0  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb  9 15:06:21 2017
    13 // Update Count     : 49
     12// Last Modified On : Wed Mar  1 16:20:04 2017
     13// Update Count     : 50
    1414//
    1515
     
    123123
    124124                void printDesignators( std::list< Expression * > & );
    125                 void handleStorageClass( Declaration *decl );
     125                void handleStorageClass( DeclarationWithType *decl );
    126126                void handleAggregate( AggregateDecl *aggDecl );
    127127                void handleTypedef( NamedTypeDecl *namedType );
  • src/CodeGen/FixNames.cc

    rf37147b rdd020c0  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Mon Apr 11 15:38:10 2016
    13 // Update Count     : 1
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Mar  3 21:52:17 2017
     13// Update Count     : 6
    1414//
    1515
     
    4444                        LinkageSpec::Cforall,
    4545                        main_type = new FunctionType( Type::Qualifiers(), true ),
    46                         nullptr, false, false
     46                        nullptr
    4747                ) };
    4848                main_type->get_returnVals().push_back(
     
    5050                );
    5151
    52                 auto&& name = SymTab::Mangler::mangle( mainDecl.get() );
     52                auto && name = SymTab::Mangler::mangle( mainDecl.get() );
    5353                // std::cerr << name << std::endl;
    5454                return name;
     
    6161                        LinkageSpec::Cforall,
    6262                        main_type = new FunctionType( Type::Qualifiers(), false ),
    63                         nullptr, false, false
     63                        nullptr
    6464                ) };
    6565                main_type->get_returnVals().push_back(
Note: See TracChangeset for help on using the changeset viewer.