Changeset d60ccbf for src/ResolvExpr


Ignore:
Timestamp:
Aug 12, 2015, 2:27:31 PM (10 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
f32c7f4
Parents:
e45215c (diff), e869d663 (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' into designate

Conflicts:

src/CodeGen/CodeGenerator.h

Location:
src/ResolvExpr
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.cc

    re45215c rd60ccbf  
    343343        }
    344344
     345        /// Adds type variables to the open variable set and marks their assertions
    345346        void makeUnifiableVars( Type *type, OpenVarSet &unifiableVars, AssertionSet &needAssertions ) {
    346347                for ( std::list< TypeDecl* >::const_iterator tyvar = type->get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {
     
    697698                        std::list< Type* >::iterator candidate_end = (*i).expr->get_results().begin();
    698699                        std::advance( candidate_end, castExpr->get_results().size() );
    699                         if ( ! unifyList( (*i).expr->get_results().begin(), candidate_end,
    700                                                          castExpr->get_results().begin(), castExpr->get_results().end(), i->env, needAssertions, haveAssertions, openVars, indexer ) ) continue;
    701700                        Cost thisCost = castCostList( (*i).expr->get_results().begin(), candidate_end,
    702701                                                                                  castExpr->get_results().begin(), castExpr->get_results().end(), indexer, i->env );
  • src/ResolvExpr/CommonType.cc

    re45215c rd60ccbf  
    138138        void CommonType::visit( PointerType *pointerType ) {
    139139                if ( PointerType *otherPointer = dynamic_cast< PointerType* >( type2 ) ) {
    140                         if ( widenFirst && dynamic_cast< VoidType* >( otherPointer->get_base() ) ) {
     140                        if ( widenFirst && dynamic_cast< VoidType* >( otherPointer->get_base() ) && ! isFtype(pointerType->get_base(), indexer) ) {
    141141                                result = otherPointer->clone();
    142142                                result->get_qualifiers() += pointerType->get_qualifiers();
    143                         } else if ( widenSecond && dynamic_cast< VoidType* >( pointerType->get_base() ) ) {
     143                        } else if ( widenSecond && dynamic_cast< VoidType* >( pointerType->get_base() ) && ! isFtype(otherPointer->get_base(), indexer) ) {
    144144                                result = pointerType->clone();
    145145                                result->get_qualifiers() += otherPointer->get_qualifiers();
  • src/ResolvExpr/Cost.h

    re45215c rd60ccbf  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 09:39:50 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun May 17 09:42:04 2015
    13 // Update Count     : 3
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Wed Jul 22 16:43:10 2015
     13// Update Count     : 4
    1414//
    1515
     
    5656
    5757        inline void Cost::incPoly( int inc ) {
    58                 unsafe += inc;
     58                poly += inc;
    5959        }
    6060
    6161        inline void Cost::incSafe( int inc ) {
    62                 unsafe += inc;
     62                safe += inc;
    6363        }
    6464
  • src/ResolvExpr/Resolver.cc

    re45215c rd60ccbf  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 12:17:01 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Jul 15 14:54:04 2015
    13 // Update Count     : 167
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Jul 24 17:33:54 2015
     13// Update Count     : 178
    1414//
    1515
     
    4141
    4242                virtual void visit( ExprStmt *exprStmt );
     43                virtual void visit( AsmExpr *asmExpr );
     44                virtual void visit( AsmStmt *asmStmt );
    4345                virtual void visit( IfStmt *ifStmt );
    4446                virtual void visit( WhileStmt *whileStmt );
     
    209211                        exprStmt->set_expr( newExpr );
    210212                } // if
     213        }
     214
     215        void Resolver::visit( AsmExpr *asmExpr ) {
     216                Expression *newExpr = findVoidExpression( asmExpr->get_operand(), *this );
     217                delete asmExpr->get_operand();
     218                asmExpr->set_operand( newExpr );
     219                if ( asmExpr->get_inout() ) {
     220                        newExpr = findVoidExpression( asmExpr->get_inout(), *this );
     221                        delete asmExpr->get_inout();
     222                        asmExpr->set_inout( newExpr );
     223                } // if
     224        }
     225
     226        void Resolver::visit( AsmStmt *asmStmt ) {
     227                acceptAll( asmStmt->get_input(), *this);
     228                acceptAll( asmStmt->get_output(), *this);
    211229        }
    212230
  • src/ResolvExpr/Resolver.h

    re45215c rd60ccbf  
    2121
    2222namespace ResolvExpr {
     23        /// Checks types and binds syntactic constructs to typed representations
    2324        void resolve( std::list< Declaration * > translationUnit );
    2425        Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer );
  • src/ResolvExpr/typeops.h

    re45215c rd60ccbf  
    117117
    118118        // in Unify.cc
     119        bool isFtype( Type *type, const SymTab::Indexer &indexer );
    119120        bool typesCompatible( Type *, Type *, const SymTab::Indexer &indexer, const TypeEnvironment &env );
    120121        bool typesCompatibleIgnoreQualifiers( Type *, Type *, const SymTab::Indexer &indexer, const TypeEnvironment &env );
Note: See TracChangeset for help on using the changeset viewer.