Changeset e3e16bc for src/SymTab
- Timestamp:
- Sep 13, 2017, 2:34:55 PM (7 years ago)
- 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
- Location:
- src/SymTab
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Autogen.cc
r9f5ecf5 re3e16bc 18 18 #include <cstddef> // for NULL 19 19 #include <algorithm> // for count_if 20 #include <cassert> // for s afe_dynamic_cast, assert, assertf20 #include <cassert> // for strict_dynamic_cast, assert, assertf 21 21 #include <iterator> // for back_insert_iterator, back_inserter 22 22 #include <list> // for list, _List_iterator, list<>::iter... … … 250 250 // parameters) are using in the variable exprs 251 251 assert( ftype->get_parameters().size() == 2 ); 252 ObjectDecl * dstParam = s afe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() );253 ObjectDecl * srcParam = s afe_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() ); 254 254 255 255 VariableExpr * assignVarExpr = new VariableExpr( assignDecl ); … … 307 307 308 308 // assign to destination 309 Expression *dstselect = new MemberExpr( field, new CastExpr( new VariableExpr( dstParam ), s afe_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() ) ); 310 310 genImplicitCall( srcParam, dstselect, func->get_name(), back_inserter( func->get_statements()->get_kids() ), field, forward ); 311 311 } … … 436 436 FunctionType * assignType = dcl->get_functionType(); 437 437 assert( assignType->get_parameters().size() == 2 ); 438 ObjectDecl * srcParam = s afe_dynamic_cast< ObjectDecl * >( assignType->get_parameters().back() );438 ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( assignType->get_parameters().back() ); 439 439 dcl->get_statements()->get_kids().push_back( new ReturnStmt( noLabels, new VariableExpr( srcParam ) ) ); 440 440 } … … 487 487 FunctionType * ftype = funcDecl->get_functionType(); 488 488 assert( ftype->get_parameters().size() == 2 ); 489 ObjectDecl * dstParam = s afe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() );490 ObjectDecl * srcParam = s afe_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() ); 491 491 492 492 makeUnionFieldsAssignment( srcParam, dstParam, back_inserter( funcDecl->get_statements()->get_kids() ) ); … … 700 700 701 701 Type * AutogenTupleRoutines::mutate( TupleType * tupleType ) { 702 tupleType = s afe_dynamic_cast< TupleType * >( Parent::mutate( tupleType ) );702 tupleType = strict_dynamic_cast< TupleType * >( Parent::mutate( tupleType ) ); 703 703 std::string mangleName = SymTab::Mangler::mangleType( tupleType ); 704 704 if ( seenTuples.find( mangleName ) != seenTuples.end() ) return tupleType; … … 768 768 CompoundStmt * AutogenTupleRoutines::mutate( CompoundStmt *compoundStmt ) { 769 769 seenTuples.beginScope(); 770 compoundStmt = s afe_dynamic_cast< CompoundStmt * >( Parent::mutate( compoundStmt ) );770 compoundStmt = strict_dynamic_cast< CompoundStmt * >( Parent::mutate( compoundStmt ) ); 771 771 seenTuples.endScope(); 772 772 return compoundStmt; -
src/SymTab/Indexer.cc
r9f5ecf5 re3e16bc 16 16 #include "Indexer.h" 17 17 18 #include <cassert> // for assert, s afe_dynamic_cast18 #include <cassert> // for assert, strict_dynamic_cast 19 19 #include <iostream> // for operator<<, basic_ostream, ostream 20 20 #include <string> // for string, operator<<, operator!= -
src/SymTab/Validate.cc
r9f5ecf5 re3e16bc 486 486 std::list< DeclarationWithType * > asserts; 487 487 for ( Declaration * decl : inst->baseTrait->members ) { 488 asserts.push_back( s afe_dynamic_cast<DeclarationWithType *>( decl->clone() ) );488 asserts.push_back( strict_dynamic_cast<DeclarationWithType *>( decl->clone() ) ); 489 489 } 490 490 // substitute trait decl parameters for instance parameters … … 530 530 // need to carry over the 'sized' status of each decl in the instance 531 531 for ( auto p : group_iterate( traitDecl->get_parameters(), traitInst->get_parameters() ) ) { 532 TypeExpr * expr = s afe_dynamic_cast< TypeExpr * >( std::get<1>(p) );532 TypeExpr * expr = strict_dynamic_cast< TypeExpr * >( std::get<1>(p) ); 533 533 if ( TypeInstType * inst = dynamic_cast< TypeInstType * >( expr->get_type() ) ) { 534 534 TypeDecl * formalDecl = std::get<0>(p); … … 892 892 for ( size_t i = 0; paramIter != params->end(); ++paramIter, ++i ) { 893 893 if ( i < args.size() ) { 894 TypeExpr * expr = s afe_dynamic_cast< TypeExpr * >( *std::next( args.begin(), i ) );894 TypeExpr * expr = strict_dynamic_cast< TypeExpr * >( *std::next( args.begin(), i ) ); 895 895 sub.add( (*paramIter)->get_name(), expr->get_type()->clone() ); 896 896 } else if ( i == args.size() ) { … … 962 962 if ( retVals.size() > 1 ) { 963 963 // generate a single return parameter which is the tuple of all of the return values 964 TupleType * tupleType = s afe_dynamic_cast< TupleType * >( ResolvExpr::extractResultType( ftype ) );964 TupleType * tupleType = strict_dynamic_cast< TupleType * >( ResolvExpr::extractResultType( ftype ) ); 965 965 // ensure return value is not destructed by explicitly creating an empty ListInit node wherein maybeConstruct is false. 966 966 ObjectDecl * newRet = new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, 0, tupleType, new ListInit( std::list<Initializer*>(), noDesignators, false ) );
Note: See TracChangeset
for help on using the changeset viewer.