Changeset fa4805f for src/Parser


Ignore:
Timestamp:
Jun 28, 2017, 4:05:46 PM (7 years ago)
Author:
Andrew Beach <ajbeach@…>
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:
a67b60e
Parents:
16c95e3
Message:

The builtins.cf now includes exception handling functions.

Location:
src/Parser
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    r16c95e3 rfa4805f  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 12:34:05 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar 17 15:46:33 2017
    13 // Update Count     : 1018
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Jun 28 15:27:00 2017
     13// Update Count     : 1019
    1414//
    1515
     
    10631063          case TypeData::Enum:
    10641064          case TypeData::Aggregate: {
    1065                   ReferenceToType * ret = buildComAggInst( type, attributes );
     1065                  ReferenceToType * ret = buildComAggInst( type, attributes, linkage );
    10661066                  buildList( type->aggregate.actuals, ret->get_parameters() );
    10671067                  return ret;
  • src/Parser/LinkageSpec.cc

    r16c95e3 rfa4805f  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 13:22:09 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Oct  2 23:16:21 2016
    13 // Update Count     : 23
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Jun 28 11:51:00 2017
     13// Update Count     : 24
    1414//
    1515
     
    2828        } else if ( *spec == "\"C\"" ) {
    2929                return C;
     30        } else if ( *spec == "\"BuiltinC\"" ) {
     31                return BuiltinC;
    3032        } else {
    3133                throw SemanticError( "Invalid linkage specifier " + *spec );
     
    3638        assert( 0 <= linkage && linkage < LinkageSpec::NoOfSpecs );
    3739        static const char *linkageKinds[LinkageSpec::NoOfSpecs] = {
    38                 "intrinsic", "Cforall", "C", "automatically generated", "compiler built-in",
     40                "intrinsic", "Cforall", "C", "automatically generated", "compiler built-in", "cfa built-in", "c built-in",
    3941        };
    4042        return linkageKinds[linkage];
    4143}
    4244
    43 bool LinkageSpec::isDecoratable( Spec spec ) {
     45bool LinkageSpec::isMangled( Spec spec ) {
    4446        assert( 0 <= spec && spec < LinkageSpec::NoOfSpecs );
    4547        static bool decoratable[LinkageSpec::NoOfSpecs] = {
    46                 //      Intrinsic,      Cforall,        C,              AutoGen,        Compiler
     48                //      Intrinsic,      Cforall,        C,              AutoGen,        Compiler,
    4749                        true,           true,           false,  true,           false,
     50                //      Builtin,        BuiltinC,
     51                        true,           false,
    4852        };
    4953        return decoratable[spec];
     
    5357        assert( 0 <= spec && spec < LinkageSpec::NoOfSpecs );
    5458        static bool generatable[LinkageSpec::NoOfSpecs] = {
    55                 //      Intrinsic,      Cforall,        C,              AutoGen,        Compiler
     59                //      Intrinsic,      Cforall,        C,              AutoGen,        Compiler,
    5660                        true,           true,           true,   true,           false,
     61                //      Builtin,        BuiltinC,
     62                        true,           true,
    5763        };
    5864        return generatable[spec];
     
    6268        assert( spec >= 0 && spec < LinkageSpec::NoOfSpecs );
    6369        static bool overridable[LinkageSpec::NoOfSpecs] = {
    64                 //      Intrinsic,      Cforall,        C,              AutoGen,        Compiler
     70                //      Intrinsic,      Cforall,        C,              AutoGen,        Compiler,
    6571                        true,           false,          false,  true,           false,
     72                //      Builtin,        BuiltinC,
     73                        false,          false,
    6674        };
    6775        return overridable[spec];
     
    7179        assert( spec >= 0 && spec < LinkageSpec::NoOfSpecs );
    7280        static bool builtin[LinkageSpec::NoOfSpecs] = {
    73                 //      Intrinsic,      Cforall,        C,              AutoGen,        Compiler
     81                //      Intrinsic,      Cforall,        C,              AutoGen,        Compiler,
    7482                        true,           false,          false,  false,          true,
     83                //      Builtin,        BuiltinC,
     84                        true,           true,
    7585        };
    7686        return builtin[spec];
  • src/Parser/LinkageSpec.h

    r16c95e3 rfa4805f  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 13:24:28 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Oct  1 23:03:17 2016
    13 // Update Count     : 11
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Jun 28 11:50:00 2017
     13// Update Count     : 12
    1414//
    1515
     
    2626                AutoGen,                                                                                // built by translator (struct assignment)
    2727                Compiler,                                                                               // gcc internal
     28                Builtin,                                                                                // mangled builtins
     29                BuiltinC,                                                                               // non-mangled builtins
    2830                NoOfSpecs
    2931        };
     
    3234        static std::string linkageName( Spec );
    3335 
    34         static bool isDecoratable( Spec );
     36        static bool isMangled( Spec );
    3537        static bool isGeneratable( Spec );
    3638        static bool isOverridable( Spec );
  • src/Parser/TypeData.cc

    r16c95e3 rfa4805f  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 15:12:51 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar 17 15:52:43 2017
    13 // Update Count     : 563
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Jun 28 15:28:00 2017
     13// Update Count     : 564
    1414//
    1515
     
    614614} // buildPointer
    615615
    616 AggregateDecl * buildAggregate( const TypeData * td, std::list< Attribute * > attributes ) {
     616AggregateDecl * buildAggregate( const TypeData * td, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ) {
    617617        assert( td->kind == TypeData::Aggregate );
    618618        AggregateDecl * at;
     
    622622          case DeclarationNode::Monitor:
    623623          case DeclarationNode::Thread:
    624                 at = new StructDecl( *td->aggregate.name, td->aggregate.kind, attributes );
     624                at = new StructDecl( *td->aggregate.name, td->aggregate.kind, attributes, linkage );
    625625                buildForall( td->aggregate.params, at->get_parameters() );
    626626                break;
     
    643643} // buildAggregate
    644644
    645 ReferenceToType * buildComAggInst( const TypeData * type, std::list< Attribute * > attributes ) {
     645ReferenceToType * buildComAggInst( const TypeData * type, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ) {
    646646        switch ( type->kind ) {
    647647          case TypeData::Enum: {
     
    656656                  ReferenceToType * ret;
    657657                  if ( type->aggregate.body ) {
    658                           AggregateDecl * typedecl = buildAggregate( type, attributes );
     658                          AggregateDecl * typedecl = buildAggregate( type, attributes, linkage );
    659659                          switch ( type->aggregate.kind ) {
    660660                                case DeclarationNode::Struct:
     
    802802                return decl->set_asmName( asmName );
    803803        } else if ( td->kind == TypeData::Aggregate ) {
    804                 return buildAggregate( td, attributes );
     804                return buildAggregate( td, attributes, linkage );
    805805        } else if ( td->kind == TypeData::Enum ) {
    806806                return buildEnum( td, attributes );
  • src/Parser/TypeData.h

    r16c95e3 rfa4805f  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 15:18:36 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 08:32:39 2017
    13 // Update Count     : 185
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Jun 28 15:29:00 2017
     13// Update Count     : 186
    1414//
    1515
     
    102102ArrayType * buildArray( const TypeData * );
    103103AggregateDecl * buildAggregate( const TypeData *, std::list< Attribute * > );
    104 ReferenceToType * buildComAggInst( const TypeData *, std::list< Attribute * > attributes );
     104ReferenceToType * buildComAggInst( const TypeData *, std::list< Attribute * > attributes, LinkageSpec::Spec linkage );
    105105ReferenceToType * buildAggInst( const TypeData * );
    106106TypeDecl * buildVariable( const TypeData * );
Note: See TracChangeset for help on using the changeset viewer.