Changeset df5b2c8


Ignore:
Timestamp:
Aug 4, 2021, 1:24:51 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
5541ea3d
Parents:
1e567ab (diff), da602aec (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src/ControlStruct
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/ControlStruct/ExceptDecl.cc

    r1e567ab rdf5b2c8  
    1010// Created On       : Tue Jul 20 04:10:50 2021
    1111// Last Modified By : Henry Xue
    12 // Last Modified On : Mon Jul 26 12:55:28 2021
    13 // Update Count     : 3
     12// Last Modified On : Tue Aug 03 10:42:26 2021
     13// Update Count     : 4
    1414//
    1515
     
    278278        cloneAll( forallClause, structDecl->parameters );
    279279        return structDecl;
     280}
     281
     282ObjectDecl * ehmTypeIdExtern(
     283        const std::string & exceptionName,
     284        const std::list< Expression *> & parameters
     285) {
     286        StructInstType * typeIdType = new StructInstType(
     287                Type::Const,
     288                Virtual::typeIdType( exceptionName )
     289        );
     290        cloneAll( parameters, typeIdType->parameters );
     291        return new ObjectDecl(
     292                Virtual::typeIdName( exceptionName ),
     293                Type::Extern,
     294                LinkageSpec::Cforall,
     295                nullptr,
     296                typeIdType,
     297                nullptr,
     298                { new Attribute( "cfa_linkonce" ) }
     299        );
    280300}
    281301
     
    421441
    422442                if ( objectDecl->get_storageClasses().is_extern ) { // if extern
     443                        if ( !parameters.empty() ) { // forall variant
     444                                declsToAddBefore.push_back( ehmTypeIdExtern( exceptionName, parameters ) );
     445                        }
    423446                        return ehmExternVtable( exceptionName, parameters, tableName );
    424447                }
  • src/ControlStruct/ExceptTranslate.cc

    r1e567ab rdf5b2c8  
    99// Author           : Andrew Beach
    1010// Created On       : Wed Jun 14 16:49:00 2017
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Jun 24 11:18:00 2020
    13 // Update Count     : 17
     11// Last Modified By : Henry Xue
     12// Last Modified On : Tue Aug 03 10:05:51 2021
     13// Update Count     : 18
    1414//
    1515
     
    320320                                static_cast<ObjectDecl *>( handler->get_decl() );
    321321                        ObjectDecl * local_except = handler_decl->clone();
    322                         local_except->set_init(
    323                                 new ListInit({ new SingleInit(
    324                                         new VirtualCastExpr( nameOf( except_obj ),
    325                                                 local_except->get_type()
    326                                                 )
    327                                         ) })
     322                        VirtualCastExpr * vcex = new VirtualCastExpr(
     323                                nameOf( except_obj ),
     324                                local_except->get_type()
    328325                                );
     326                        vcex->location = handler->location;
     327                        local_except->set_init( new ListInit({ new SingleInit( vcex ) }) );
    329328                        block->push_back( new DeclStmt( local_except ) );
    330329
     
    392391
    393392                // Check for type match.
    394                 Expression * cond = UntypedExpr::createAssign( nameOf( local_except ),
    395                         new VirtualCastExpr( nameOf( except_obj ),
    396                                 local_except->get_type()->clone() ) );
     393                VirtualCastExpr * vcex = new VirtualCastExpr(
     394                        nameOf( except_obj ),
     395                        local_except->get_type()->clone()
     396                        );
     397                vcex->location = modded_handler->location;
     398                Expression * cond = UntypedExpr::createAssign(
     399                        nameOf( local_except ), vcex );
    397400
    398401                // Add the check on the conditional if it is provided.
Note: See TracChangeset for help on using the changeset viewer.