Ignore:
Timestamp:
May 30, 2019, 4:15:08 PM (5 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
a935892, f474e91
Parents:
d76c588 (diff), d88f8b3b (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 plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    rd76c588 r8d70648  
    4545#include "SynTree/Visitor.h"             // for acceptAll, maybeAccept
    4646#include "Tuples/Tuples.h"
     47#include "Validate/FindSpecialDecls.h"   // for SizeType
    4748
    4849using namespace std;
     
    237238                                winner.cost = winner.cvtCost;
    238239                        }
    239                        
     240
    240241                        // produce ambiguous errors, if applicable
    241242                        if ( winners.size() != 1 ) {
     
    257258
    258259                        // xxx - check for ambiguous expressions
    259                        
     260
    260261                        // output selected choice
    261262                        alt = std::move( choice );
     
    421422        void Resolver_old::handlePtrType( PtrType * type ) {
    422423                if ( type->get_dimension() ) {
    423                         findSingleExpression( type->dimension, SymTab::SizeType->clone(), indexer );
     424                        findSingleExpression( type->dimension, Validate::SizeType->clone(), indexer );
    424425                }
    425426        }
     
    446447                // default value expressions have an environment which shouldn't be there and trips up
    447448                // later passes.
    448                 // xxx - it might be necessary to somehow keep the information from this environment, but I 
     449                // xxx - it might be necessary to somehow keep the information from this environment, but I
    449450                // can't currently see how it's useful.
    450451                for ( Declaration * d : functionDecl->type->parameters ) {
     
    797798                initExpr->expr = nullptr;
    798799                std::swap( initExpr->env, newExpr->env );
    799                 // InitExpr may have inferParams in the case where the expression specializes a function 
    800                 // pointer, and newExpr may already have inferParams of its own, so a simple swap is not 
     800                // InitExpr may have inferParams in the case where the expression specializes a function
     801                // pointer, and newExpr may already have inferParams of its own, so a simple swap is not
    801802                // sufficient.
    802803                newExpr->spliceInferParams( initExpr );
    803804                delete initExpr;
    804805
    805                 // get the actual object's type (may not exactly match what comes back from the resolver 
     806                // get the actual object's type (may not exactly match what comes back from the resolver
    806807                // due to conversions)
    807808                Type * initContext = currentObject.getCurrentType();
     
    816817                                        if ( isCharType( pt->get_base() ) ) {
    817818                                                if ( CastExpr * ce = dynamic_cast< CastExpr * >( newExpr ) ) {
    818                                                         // strip cast if we're initializing a char[] with a char *, 
     819                                                        // strip cast if we're initializing a char[] with a char *,
    819820                                                        // e.g.  char x[] = "hello";
    820821                                                        newExpr = ce->get_arg();
     
    839840                // move cursor into brace-enclosed initializer-list
    840841                currentObject.enterListInit();
    841                 // xxx - fix this so that the list isn't copied, iterator should be used to change current 
     842                // xxx - fix this so that the list isn't copied, iterator should be used to change current
    842843                // element
    843844                std::list<Designation *> newDesignations;
    844845                for ( auto p : group_iterate(listInit->get_designations(), listInit->get_initializers()) ) {
    845                         // iterate designations and initializers in pairs, moving the cursor to the current 
     846                        // iterate designations and initializers in pairs, moving the cursor to the current
    846847                        // designated object and resolving the initializer against that object.
    847848                        Designation * des = std::get<0>(p);
Note: See TracChangeset for help on using the changeset viewer.