Changes in / [334ebc23:971ae89]


Ignore:
Location:
src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r334ebc23 r971ae89  
    258258             
    259259                                  case OT_CALL:
    260                                   case OT_CTOR:
    261                                   case OT_DTOR:
    262                                         // there are no intrinsic definitions of the function call operator or constructors or destructors
     260                                        // there are no intrinsic definitions of the function call operator
    263261                                        assert( false );
    264262                                        break;
  • src/CodeGen/OperatorTable.cc

    r334ebc23 r971ae89  
    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 : Wed Jun 24 16:17:34 2015
    13 // Update Count     : 7
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Tue Jun 23 17:41:14 2015
     13// Update Count     : 5
    1414//
    1515
     
    2121                const OperatorInfo tableValues[] = {
    2222                        {       "?[?]",         "",             "_operator_index",                              OT_INDEX                        },
    23                         {       "?{}",          "",             "_constructor",                                 OT_CTOR                         },
    24                         {       "-?{}",         "",             "_destructor",                                  OT_DTOR                         }, // -?{}, !?{}, $?{}, ??{}, ?destroy, ?delete
    2523                        {       "?()",          "",             "_operator_call",                               OT_CALL                         },
    2624                        {       "?++",          "++",   "_operator_postincr",                   OT_POSTFIXASSIGN        },
  • src/CodeGen/OperatorTable.h

    r334ebc23 r971ae89  
    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 : Wed Jun 24 16:17:57 2015
    13 // Update Count     : 5
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Tue Jun 23 16:09:27 2015
     13// Update Count     : 3
    1414//
    1515
     
    2222        enum OperatorType {
    2323                OT_INDEX,
    24                 OT_CTOR,
    25                 OT_DTOR,
    2624                OT_CALL,
    2725                OT_PREFIX,
  • src/MakeLibCfa.cc

    r334ebc23 r971ae89  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sat May 16 10:33:33 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Fri Jul 03 18:11:37 2015
    13 // Update Count     : 18
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Jun 26 16:52:59 2015
     13// Update Count     : 14
    1414//
    1515
     
    7777                                break;
    7878                        }
    79                   case CodeGen::OT_CTOR:
    80                   case CodeGen::OT_DTOR:
    8179                  case CodeGen::OT_CONSTANT:
    8280                  case CodeGen::OT_LABELADDRESS:
  • src/Parser/LinkageSpec.cc

    r334ebc23 r971ae89  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 13:22:09 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Aug 19 15:53:05 2015
    13 // Update Count     : 5
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Sat May 16 13:23:21 2015
     13// Update Count     : 2
    1414//
    1515
     
    7979}
    8080
    81 
    82 bool LinkageSpec::isOverridable( Type t ) {
    83         switch ( t ) {
    84           case Intrinsic:
    85           case AutoGen:
    86                 return true;
    87           case Cforall:
    88           case C:
    89           case Compiler:
    90                 return false;
    91         }
    92         assert( false );
    93         return false;
    94 }
    95 
    9681bool LinkageSpec::isBuiltin( Type t ) {
    9782        switch ( t ) {
  • src/Parser/LinkageSpec.h

    r334ebc23 r971ae89  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 13:24:28 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Tue Aug 18 14:11:55 2015
    13 // Update Count     : 5
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Sat May 16 13:26:14 2015
     13// Update Count     : 3
    1414//
    1515
     
    3434        static bool isGeneratable( Type );
    3535        static bool isOverloadable( Type );
    36         static bool isOverridable( Type );
    3736        static bool isBuiltin( Type );
    3837};
  • src/Parser/ParseNode.h

    r334ebc23 r971ae89  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Aug 19 15:59:27 2015
    13 // Update Count     : 174
     12// Last Modified On : Wed Aug 12 13:27:11 2015
     13// Update Count     : 172
    1414//
    1515
     
    180180                                Assign, MulAssn, DivAssn, ModAssn, PlusAssn, MinusAssn, LSAssn, RSAssn, AndAssn,
    181181                                ERAssn, OrAssn, Index, FieldSel, PFieldSel, Range,
    182                                 UnPlus, UnMinus, AddressOf, PointTo, Neg, BitNeg, Incr, IncrPost, Decr, DecrPost, LabelAddress,
    183                                 Ctor, Dtor,
     182                                UnPlus, UnMinus, AddressOf, PointTo, Neg, BitNeg, Incr, IncrPost, Decr, DecrPost, LabelAddress
    184183        };
    185184
  • src/SymTab/IdTable.cc

    r334ebc23 r971ae89  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 17:04:02 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Aug 19 15:47:58 2015
    13 // Update Count     : 38
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Sun May 17 17:07:43 2015
     13// Update Count     : 3
    1414//
    1515
     
    5252                if ( decl->get_linkage() == LinkageSpec::C ) {
    5353                        manglename = name;
    54                 } else if ( LinkageSpec::isOverridable( decl->get_linkage() ) ) {
    55                         // mangle the name without including the appropriate suffix
    56                         // this will make it so that overridable routines are placed
    57                         // into the same "bucket" as their user defined versions.
    58                         manglename = Mangler::mangle( decl, false );
    5954                } else {
    6055                        manglename = Mangler::mangle( decl );
     
    6964                        std::stack< DeclEntry >& entry = it->second;
    7065                        if ( ! entry.empty() && entry.top().second == scopeLevel ) {
    71                                 // typesCompatible doesn't really do the right thing here. When checking compatibility of function types,
    72                                 // we should ignore outermost pointer qualifiers, except _Atomic?
    73 
    7466                                if ( decl->get_linkage() != LinkageSpec::C || ResolvExpr::typesCompatible( decl->get_type(), entry.top().first->get_type(), Indexer() ) ) {
    7567                                        FunctionDecl *newentry = dynamic_cast< FunctionDecl* >( decl );
    7668                                        FunctionDecl *old = dynamic_cast< FunctionDecl* >( entry.top().first );
    77                                         if ( LinkageSpec::isOverridable( old->get_linkage() ) ) {
    78                                                 // new definition shadows the autogenerated one, even at the same scope
    79                                                 declTable[ manglename ].push( DeclEntry( decl, scopeLevel ) );
    80                                         } else if ( newentry && old && newentry->get_statements() && old->get_statements() ) {
    81                                                 throw SemanticError( "duplicate function definition for 1 ", decl );
     69                                        if ( newentry && old && newentry->get_statements() && old->get_statements() ) {
     70                                                throw SemanticError( "duplicate function definition for ", decl );
    8271                                        } else {
    83                                                 // two objects with the same mangled name defined in the same scope.
    84                                                 // both objects must be marked extern for this to be okay
    8572                                                ObjectDecl *newobj = dynamic_cast< ObjectDecl* >( decl );
    8673                                                ObjectDecl *oldobj = dynamic_cast< ObjectDecl* >( entry.top().first );
    87                                                 if ( newobj && oldobj && newobj->get_storageClass() != DeclarationNode::Extern && oldobj->get_storageClass() != DeclarationNode::Extern ) {
     74                                                if ( newobj && oldobj && newobj->get_init() && oldobj->get_init() ) {
    8875                                                        throw SemanticError( "duplicate definition for ", decl );
    8976                                                } // if
    9077                                        } // if
    9178                                } else {
    92                                         // C definitions with the same name but incompatible types
    93                                         throw SemanticError( "duplicate definition for 2 ", decl );
     79                                        throw SemanticError( "duplicate definition for ", decl );
    9480                                } // if
    9581                        } else {
     
    9884                } // if
    9985                // ensure the set of routines with C linkage cannot be overloaded
    100                 // this ensures that no two declarations with the same unmangled name both have C linkage
    10186                for ( InnerTableType::iterator i = declTable.begin(); i != declTable.end(); ++i ) {
    10287                        if ( ! i->second.empty() && i->second.top().first->get_linkage() == LinkageSpec::C && declTable.size() > 1 ) {
  • src/SymTab/Mangler.cc

    r334ebc23 r971ae89  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 21:40:29 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Aug 19 15:52:24 2015
    13 // Update Count     : 19
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Mon Jun  8 15:12:12 2015
     13// Update Count     : 8
    1414//
    1515
     
    3030
    3131namespace SymTab {
    32         Mangler::Mangler( bool mangleOverridable ) : nextVarNum( 0 ), isTopLevel( true ), mangleOverridable( mangleOverridable ) {
     32        Mangler::Mangler() : nextVarNum( 0 ), isTopLevel( true ) {
    3333        }
    3434
     
    4141                nextVarNum = rhs.nextVarNum;
    4242                isTopLevel = rhs.isTopLevel;
    43                 mangleOverridable = rhs.mangleOverridable;
    4443        }
    4544
     
    6059                mangleName << "__";
    6160                maybeAccept( declaration->get_type(), *this );
    62                 if ( mangleOverridable && LinkageSpec::isOverridable( declaration->get_linkage() ) ) {
    63                         // want to be able to override autogenerated and intrinsic routines,
    64                         // so they need a different name mangling
    65                         if ( declaration->get_linkage() == LinkageSpec::AutoGen ) {
    66                                 mangleName << "autogen__";
    67                         } else if ( declaration->get_linkage() == LinkageSpec::Intrinsic ) {
    68                                 mangleName << "intrinsic__";
    69                         } else {
    70                                 // if we add another kind of overridable function, this has to change
    71                                 assert( false );
    72                         } // if
    73                 }
    7461                isTopLevel = wasTopLevel;
    7562        }
     
    227214                                varNums[ (*i )->get_name() ] = std::pair< int, int >( nextVarNum++, (int )(*i )->get_kind() );
    228215                                for ( std::list< DeclarationWithType* >::iterator assert = (*i )->get_assertions().begin(); assert != (*i )->get_assertions().end(); ++assert ) {
    229                                         Mangler sub_mangler( mangleOverridable );
     216                                        Mangler sub_mangler;
    230217                                        sub_mangler.nextVarNum = nextVarNum;
    231218                                        sub_mangler.isTopLevel = false;
  • src/SymTab/Mangler.h

    r334ebc23 r971ae89  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 21:44:03 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Aug 19 15:48:46 2015
    13 // Update Count     : 14
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Mon Jun  8 14:47:14 2015
     13// Update Count     : 5
    1414//
    1515
     
    2525          public:
    2626                template< typename SynTreeClass >
    27             static std::string mangle( SynTreeClass *decl, bool mangleOverridable = true ); // interface to clients
     27            static std::string mangle( SynTreeClass *decl ); // interface to clients
    2828
    2929///   using Visitor::visit;
     
    5050                int nextVarNum;
    5151                bool isTopLevel;
    52                 bool mangleOverridable;
    5352 
    54                 Mangler( bool mangleOverridable );
     53                Mangler();
    5554                Mangler( const Mangler & );
    5655 
     
    6261
    6362        template< typename SynTreeClass >
    64         std::string Mangler::mangle( SynTreeClass *decl, bool mangleOverridable ) {
    65                 Mangler mangler( mangleOverridable );
     63        std::string Mangler::mangle( SynTreeClass *decl ) {
     64                Mangler mangler;
    6665                maybeAccept( decl, mangler );
    6766                return mangler.get_mangleName();
Note: See TracChangeset for help on using the changeset viewer.