Ignore:
Timestamp:
Sep 13, 2017, 3:11:24 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
c57ded70, db70fe4
Parents:
d130fe8 (diff), 982832e (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 plg2:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Autogen.cc

    rd130fe8 rba54f7d  
    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...
     
    248248                // parameters) are using in the variable exprs
    249249                assert( ftype->get_parameters().size() == 2 );
    250                 ObjectDecl * dstParam = safe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() );
    251                 ObjectDecl * srcParam = safe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() );
     250                ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() );
     251                ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() );
    252252
    253253                VariableExpr * assignVarExpr = new VariableExpr( assignDecl );
     
    305305
    306306                // assign to destination
    307                 Expression *dstselect = new MemberExpr( field, new CastExpr( new VariableExpr( dstParam ), safe_dynamic_cast< ReferenceType* >( dstParam->get_type() )->get_base()->clone() ) );
     307                Expression *dstselect = new MemberExpr( field, new CastExpr( new VariableExpr( dstParam ), strict_dynamic_cast< ReferenceType* >( dstParam->get_type() )->get_base()->clone() ) );
    308308                genImplicitCall( srcParam, dstselect, func->get_name(), back_inserter( func->get_statements()->get_kids() ), field, forward );
    309309        }
     
    442442                                FunctionType * assignType = dcl->get_functionType();
    443443                                assert( assignType->get_parameters().size() == 2 );
    444                                 ObjectDecl * srcParam = safe_dynamic_cast< ObjectDecl * >( assignType->get_parameters().back() );
     444                                ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( assignType->get_parameters().back() );
    445445                                dcl->get_statements()->get_kids().push_back( new ReturnStmt( noLabels, new VariableExpr( srcParam ) ) );
    446446                        }
     
    493493                FunctionType * ftype = funcDecl->get_functionType();
    494494                assert( ftype->get_parameters().size() == 2 );
    495                 ObjectDecl * dstParam = safe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() );
    496                 ObjectDecl * srcParam = safe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() );
     495                ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() );
     496                ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() );
    497497
    498498                makeUnionFieldsAssignment( srcParam, dstParam, back_inserter( funcDecl->get_statements()->get_kids() ) );
     
    657657                                FunctionType * assignType = dcl->type;
    658658                                assert( assignType->parameters.size() == 2 );
    659                                 ObjectDecl * srcParam = safe_dynamic_cast< ObjectDecl * >( assignType->parameters.back() );
     659                                ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( assignType->parameters.back() );
    660660                                dcl->statements->kids.push_back( new ReturnStmt( noLabels, new VariableExpr( srcParam ) ) );
    661661                        }
     
    735735
    736736        Type * AutogenTupleRoutines::mutate( TupleType * tupleType ) {
    737                 tupleType = safe_dynamic_cast< TupleType * >( Parent::mutate( tupleType ) );
     737                tupleType = strict_dynamic_cast< TupleType * >( Parent::mutate( tupleType ) );
    738738                std::string mangleName = SymTab::Mangler::mangleType( tupleType );
    739739                if ( seenTuples.find( mangleName ) != seenTuples.end() ) return tupleType;
     
    803803        CompoundStmt * AutogenTupleRoutines::mutate( CompoundStmt *compoundStmt ) {
    804804                seenTuples.beginScope();
    805                 compoundStmt = safe_dynamic_cast< CompoundStmt * >( Parent::mutate( compoundStmt ) );
     805                compoundStmt = strict_dynamic_cast< CompoundStmt * >( Parent::mutate( compoundStmt ) );
    806806                seenTuples.endScope();
    807807                return compoundStmt;
Note: See TracChangeset for help on using the changeset viewer.