Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    rcbce272 r307a732  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 12:17:01 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Tus Aug  8 16:06:00 2017
    13 // Update Count     : 212
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Mar 23 17:23:14 2017
     13// Update Count     : 211
    1414//
    1515
     
    7171                virtual void visit( ReturnStmt *returnStmt ) override;
    7272                virtual void visit( ThrowStmt *throwStmt ) override;
    73                 virtual void visit( CatchStmt *catchStmt ) override;
    7473
    7574                virtual void visit( SingleInit *singleInit ) override;
     
    369368
    370369        void Resolver::visit( ThrowStmt *throwStmt ) {
    371                 // TODO: Replace *exception type with &exception type.
    372370                if ( throwStmt->get_expr() ) {
    373                         StructDecl * exception_decl =
    374                                 lookupStruct( "__cfaehm__base_exception_t" );
    375                         assert( exception_decl );
    376                         Expression * wrapped = new CastExpr(
    377                                 throwStmt->get_expr(),
    378                                 new PointerType(
    379                                         noQualifiers,
    380                                         new StructInstType(
    381                                                 noQualifiers,
    382                                                 exception_decl
    383                                                 )
    384                                         )
    385                                 );
     371                        Expression * wrapped = new CastExpr( throwStmt->get_expr(), new BasicType( Type::Qualifiers(), BasicType::SignedInt ) );
    386372                        Expression * newExpr = findSingleExpression( wrapped, *this );
    387373                        throwStmt->set_expr( newExpr );
    388                 }
    389         }
    390 
    391         void Resolver::visit( CatchStmt *catchStmt ) {
    392                 if ( catchStmt->get_cond() ) {
    393                         Expression * wrapped = new CastExpr(
    394                                 catchStmt->get_cond(),
    395                                 new BasicType( noQualifiers, BasicType::Bool )
    396                                 );
    397                         catchStmt->set_cond( findSingleExpression( wrapped, *this ) );
    398374                }
    399375        }
Note: See TracChangeset for help on using the changeset viewer.