Changeset b29f8f3 for src/SymTab


Ignore:
Timestamp:
Jul 29, 2015, 12:07:38 PM (10 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
093f1a0
Parents:
1e8f143 (diff), 51b986f (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 from origin

Location:
src/SymTab
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/AddVisit.h

    r1e8f143 rb29f8f3  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 16:14:32 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun May 17 16:16:38 2015
    13 // Update Count     : 3
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Tue Jul 14 12:26:17 2015
     13// Update Count     : 4
    1414//
    1515
     
    5757        inline void addVisit(ForStmt *forStmt, Visitor &visitor) {
    5858                addVisitStatement( forStmt->get_body(), visitor );
    59                 maybeAccept( forStmt->get_initialization(), visitor );
     59                acceptAll( forStmt->get_initialization(), visitor );
    6060                maybeAccept( forStmt->get_condition(), visitor );
    6161                maybeAccept( forStmt->get_increment(), visitor );
  • src/SymTab/TypeEquality.cc

    r1e8f143 rb29f8f3  
    1010// Created On       : Tue Jul 07 16:28:29 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Thu Jul 09 11:18:46 2015
    13 // Update Count     : 36
     12// Last Modified On : Mon Jul 20 14:16:11 2015
     13// Update Count     : 37
    1414//
    1515
     
    9191                        // and must both have a dimension expression or not have a dimension
    9292                        result = result && arrayType->get_isVarLen() == at->get_isVarLen()
    93                                 && (arrayType->get_dimension() != 0 && at->get_dimension() != 0
    94                                         || arrayType->get_dimension() == 0 && at->get_dimension() == 0);
     93                                && ((arrayType->get_dimension() != 0 && at->get_dimension() != 0)
     94                                        || (arrayType->get_dimension() == 0 && at->get_dimension() == 0));
    9595
    9696                        if ( vlaErr ) {
  • src/SymTab/Validate.cc

    r1e8f143 rb29f8f3  
    1010// Created On       : Sun May 17 21:50:04 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Mon Jul 13 14:38:19 2015
    13 // Update Count     : 184
     12// Last Modified On : Wed Jul 22 13:16:00 2015
     13// Update Count     : 194
    1414//
    1515
     
    169169                virtual TypeDecl *mutate( TypeDecl *typeDecl );
    170170                virtual DeclarationWithType *mutate( FunctionDecl *funcDecl );
    171                 virtual ObjectDecl *mutate( ObjectDecl *objDecl );
     171                virtual DeclarationWithType *mutate( ObjectDecl *objDecl );
    172172                virtual CompoundStmt *mutate( CompoundStmt *compoundStmt );
    173173                virtual Type *mutate( TypeInstType *aggregateUseType );
     
    203203        void validateType( Type *type, const Indexer *indexer ) {
    204204                Pass1 pass1;
     205                Pass2 pass2( false, indexer );
    205206                Pass3 pass3( indexer );
    206207                type->accept( pass1 );
     208                type->accept( pass2 );
    207209                type->accept( pass3 );
    208210        }
     
    403405                        } // for
    404406                } // for
     407
     408                if ( ctx->get_parameters().size() != contextInst->get_parameters().size() ) {
     409                        throw SemanticError( "incorrect number of context parameters: ", contextInst );
     410                } // if
     411
    405412                applySubstitution( ctx->get_parameters().begin(), ctx->get_parameters().end(), contextInst->get_parameters().begin(), ctx->get_members().begin(), ctx->get_members().end(), back_inserter( contextInst->get_members() ) );
    406413        }
     
    534541                init->get_args().push_back( new NameExpr( "0" ) );
    535542                Statement *initStmt = new ExprStmt( noLabels, init );
     543                std::list<Statement *> initList;
     544                initList.push_back( initStmt );
    536545 
    537546                UntypedExpr *cond = new UntypedExpr( new NameExpr( "?<?" ) );
     
    559568                assignExpr->get_args().push_back( srcIndex );
    560569 
    561                 *out++ = new ForStmt( noLabels, initStmt, cond, inc, new ExprStmt( noLabels, assignExpr ) );
     570                *out++ = new ForStmt( noLabels, initList, cond, inc, new ExprStmt( noLabels, assignExpr ) );
    562571        }
    563572
     
    612621                        delete assigns.front();
    613622                        assigns.pop_front();
    614                 }
     623                } // for
    615624
    616625                declsToAdd.insert( declsToAdd.begin(), assigns.begin(), assigns.end() );
     
    827836                                rtt->get_parameters().clear();
    828837                                cloneAll(typeInst->get_parameters(), rtt->get_parameters());
    829                         }
     838                        } // if
    830839                        delete typeInst;
    831840                        return ret;
     
    881890        }
    882891
    883         ObjectDecl *EliminateTypedef::mutate( ObjectDecl * objDecl ) {
     892        DeclarationWithType *EliminateTypedef::mutate( ObjectDecl * objDecl ) {
    884893                TypedefMap oldNames = typedefNames;
    885                 ObjectDecl *ret = Mutator::mutate( objDecl );
     894                DeclarationWithType *ret = Mutator::mutate( objDecl );
     895                if ( FunctionType *funtype = dynamic_cast<FunctionType *>( ret->get_type() ) ) {
     896                        return new FunctionDecl( ret->get_name(), ret->get_storageClass(), ret->get_linkage(), funtype, 0, ret->get_isInline(), ret->get_isNoreturn() );
     897                } else if ( objDecl->get_isInline() || objDecl->get_isNoreturn() ) {
     898                        throw SemanticError( "invalid inline or _Noreturn specification in declaration of ", objDecl );
     899                } // if
    886900                typedefNames = oldNames;
    887901                return ret;
Note: See TracChangeset for help on using the changeset viewer.