Ignore:
Timestamp:
Sep 13, 2017, 2:34:55 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
982832e
Parents:
9f5ecf5
Message:

Renamed safe_dynamic_cast to strict_dynamic_cast

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Autogen.cc

    r9f5ecf5 re3e16bc  
    1818#include <cstddef>                 // for NULL
    1919#include <algorithm>               // for count_if
    20 #include <cassert>                 // for safe_dynamic_cast, assert, assertf
     20#include <cassert>                 // for strict_dynamic_cast, assert, assertf
    2121#include <iterator>                // for back_insert_iterator, back_inserter
    2222#include <list>                    // for list, _List_iterator, list<>::iter...
     
    250250                // parameters) are using in the variable exprs
    251251                assert( ftype->get_parameters().size() == 2 );
    252                 ObjectDecl * dstParam = safe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() );
    253                 ObjectDecl * srcParam = safe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() );
     252                ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() );
     253                ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() );
    254254
    255255                VariableExpr * assignVarExpr = new VariableExpr( assignDecl );
     
    307307
    308308                // assign to destination
    309                 Expression *dstselect = new MemberExpr( field, new CastExpr( new VariableExpr( dstParam ), safe_dynamic_cast< ReferenceType* >( dstParam->get_type() )->get_base()->clone() ) );
     309                Expression *dstselect = new MemberExpr( field, new CastExpr( new VariableExpr( dstParam ), strict_dynamic_cast< ReferenceType* >( dstParam->get_type() )->get_base()->clone() ) );
    310310                genImplicitCall( srcParam, dstselect, func->get_name(), back_inserter( func->get_statements()->get_kids() ), field, forward );
    311311        }
     
    436436                                FunctionType * assignType = dcl->get_functionType();
    437437                                assert( assignType->get_parameters().size() == 2 );
    438                                 ObjectDecl * srcParam = safe_dynamic_cast< ObjectDecl * >( assignType->get_parameters().back() );
     438                                ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( assignType->get_parameters().back() );
    439439                                dcl->get_statements()->get_kids().push_back( new ReturnStmt( noLabels, new VariableExpr( srcParam ) ) );
    440440                        }
     
    487487                FunctionType * ftype = funcDecl->get_functionType();
    488488                assert( ftype->get_parameters().size() == 2 );
    489                 ObjectDecl * dstParam = safe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() );
    490                 ObjectDecl * srcParam = safe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() );
     489                ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() );
     490                ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() );
    491491
    492492                makeUnionFieldsAssignment( srcParam, dstParam, back_inserter( funcDecl->get_statements()->get_kids() ) );
     
    700700
    701701        Type * AutogenTupleRoutines::mutate( TupleType * tupleType ) {
    702                 tupleType = safe_dynamic_cast< TupleType * >( Parent::mutate( tupleType ) );
     702                tupleType = strict_dynamic_cast< TupleType * >( Parent::mutate( tupleType ) );
    703703                std::string mangleName = SymTab::Mangler::mangleType( tupleType );
    704704                if ( seenTuples.find( mangleName ) != seenTuples.end() ) return tupleType;
     
    768768        CompoundStmt * AutogenTupleRoutines::mutate( CompoundStmt *compoundStmt ) {
    769769                seenTuples.beginScope();
    770                 compoundStmt = safe_dynamic_cast< CompoundStmt * >( Parent::mutate( compoundStmt ) );
     770                compoundStmt = strict_dynamic_cast< CompoundStmt * >( Parent::mutate( compoundStmt ) );
    771771                seenTuples.endScope();
    772772                return compoundStmt;
Note: See TracChangeset for help on using the changeset viewer.