Changeset f1b1e4c for src/ArgTweak


Ignore:
Timestamp:
Jun 1, 2016, 11:54:23 AM (8 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, with_gc
Children:
be945ac
Parents:
70f89d00
Message:

can construct global const objects, except with intrinsic constructors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ArgTweak/FunctionFixer.cc

    r70f89d00 rf1b1e4c  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // FunctionFixer.cc -- 
     7// FunctionFixer.cc --
    88//
    99// Author           : Rodolfo G. Esteves
     
    4242        Expression *FunctionFixer::mutate( UntypedExpr *untypedExpr ) throw ( SemanticError ) {
    4343                assert( untypedExpr != 0 );
    44                 NameExpr *function;
    4544
    46                 if ( ( function = dynamic_cast< NameExpr *>(untypedExpr->get_function()) ) != 0 ) {
     45                if ( NameExpr * function = dynamic_cast< NameExpr *>(untypedExpr->get_function() ) ) {
    4746                        std::list < DeclarationWithType * > options;
    4847                        index->lookupId ( function->get_name(), options );
    4948                        for ( std::list < DeclarationWithType * >::iterator i = options.begin(); i != options.end(); i++ ) {
    50                                 FunctionType *f;
    51                                 if ( ( f = dynamic_cast< FunctionType * > ( (*i)->get_type() ) ) != 0 ) {
     49                                if ( FunctionType * f = dynamic_cast< FunctionType * > ( (*i)->get_type() ) )   {
    5250                                        std::list < DeclarationWithType * > &pars = f->get_parameters();
    53 
    5451                                        bool candidateExists ;
    55                                         for ( std::list < DeclarationWithType * >::iterator p = pars.begin(); p != pars.end(); p++ )
     52                                        for ( std::list < DeclarationWithType * >::iterator p = pars.begin(); p != pars.end(); p++ ) {
    5653                                                if ( ( candidateExists = align( f->get_parameters(), untypedExpr->get_args(), Matcher() ) ) ) break;
    57 
     54                                        }
    5855                                        if ( ! candidateExists ) throw SemanticError("Error in function call");
    5956                                } // if
Note: See TracChangeset for help on using the changeset viewer.