Changeset 94e0864d for src/ResolvExpr


Ignore:
Timestamp:
Jun 24, 2015, 4:12:31 PM (9 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:
1869adf
Parents:
94b4364 (diff), de62360d (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 resolver

Conflicts:

src/CodeGen/CodeGenerator.cc
src/Parser/ExpressionNode.cc
src/ResolvExpr/Resolver.cc

Location:
src/ResolvExpr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.cc

    r94b4364 r94e0864d  
    1010// Created On       : Sat May 16 23:52:08 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jun  8 14:53:58 2015
    13 // Update Count     : 14
     12// Last Modified On : Mon Jun 22 17:19:54 2015
     13// Update Count     : 17
    1414//
    1515
     
    545545                        NameExpr *fname;
    546546                        if ( ( fname = dynamic_cast<NameExpr *>( untypedExpr->get_function()))
    547                                  && ( fname->get_name() == std::string("LabAddress")) ) {
    548                                 alternatives.push_back( Alternative( untypedExpr, env, Cost()) );
     547                                 && ( fname->get_name() == std::string("&&")) ) {
     548                                alternatives.push_back( Alternative( untypedExpr->clone(), env, Cost()) );
    549549                                return;
    550550                        }
  • src/ResolvExpr/Resolver.cc

    r94b4364 r94e0864d  
    1010// Created On       : Sun May 17 12:17:01 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Tue Jun 16 14:50:11 2015
    13 // Update Count     : 154
     12// Last Modified On : Wed Jun 24 16:08:49 2015
     13// Update Count     : 155
    1414//
    1515
     
    4747                virtual void visit( ChooseStmt *switchStmt );
    4848                virtual void visit( CaseStmt *caseStmt );
     49                virtual void visit( BranchStmt *branchStmt );
    4950                virtual void visit( ReturnStmt *returnStmt );
    5051
     
    268269        void Resolver::visit( CaseStmt *caseStmt ) {
    269270                Visitor::visit( caseStmt );
     271        }
     272
     273        void Resolver::visit( BranchStmt *branchStmt ) {
     274                // must resolve the argument for a computed goto
     275                if ( branchStmt->get_type() == BranchStmt::Goto ) { // check for computed goto statement
     276                        if ( NameExpr * arg = dynamic_cast< NameExpr * >( branchStmt->get_computedTarget() ) ) {
     277                                VoidType v = Type::Qualifiers();                // cast to void * for the alternative finder
     278                                PointerType pt( Type::Qualifiers(), v.clone() );
     279                                CastExpr * castExpr = new CastExpr( arg, pt.clone() );
     280                                Expression * newExpr = findSingleExpression( castExpr, *this ); // find best expression
     281                                branchStmt->set_target( newExpr );
     282                        } // if
     283                } // if
    270284        }
    271285
Note: See TracChangeset for help on using the changeset viewer.