Changes in / [97f65d5:3149e7e]


Ignore:
Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixInit.cc

    r97f65d5 r3149e7e  
    11171117                        // xxx - is the size check necessary?
    11181118                        assert( ctorExpr->has_result() && ctorExpr->get_result()->size() == 1 );
    1119 
    1120                         // xxx - ideally we would reuse the temporary generated from the copy constructor passes from within firstArg if it exists and not generate a temporary if it's unnecessary.
    11211119                        ObjectDecl * tmp = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, nullptr, ctorExpr->get_result()->clone(), nullptr );
    11221120                        addDeclaration( tmp );
  • src/InitTweak/InitTweak.cc

    r97f65d5 r3149e7e  
    332332                        return nullptr;
    333333                }
    334         }
    335 
    336         DeclarationWithType * getFunction( Expression * expr ) {
    337                 if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr ) ) {
    338                         return getCalledFunction( appExpr->get_function() );
    339                 } else if ( UntypedExpr * untyped = dynamic_cast< UntypedExpr * > ( expr ) ) {
    340                         return getCalledFunction( untyped->get_function() );
    341                 }
    342                 assertf( false, "getFunction received unknown expression: %s", toString( expr ).c_str() );
    343334        }
    344335
  • src/InitTweak/InitTweak.h

    r97f65d5 r3149e7e  
    5151        bool checkInitDepth( ObjectDecl * objDecl );
    5252
    53         /// returns the declaration of the function called by the expr (must be ApplicationExpr or UntypedExpr)
    54         DeclarationWithType * getFunction( Expression * expr );
    55 
    56         /// Non-Null if expr is a call expression whose target function is intrinsic
    57         ApplicationExpr * isIntrinsicCallExpr( Expression * expr );
     53  /// Non-Null if expr is a call expression whose target function is intrinsic
     54  ApplicationExpr * isIntrinsicCallExpr( Expression * expr );
    5855
    5956        /// True if stmt is a call statement where the function called is intrinsic and takes one parameter.
  • src/Tuples/TupleExpansion.cc

    r97f65d5 r3149e7e  
    2929#include "ResolvExpr/typeops.h"
    3030#include "InitTweak/GenInit.h"
    31 #include "InitTweak/InitTweak.h"
    3231
    3332namespace Tuples {
     
    338337                public:
    339338                        typedef Visitor Parent;
    340                         virtual void visit( ApplicationExpr * appExpr ) {
    341                                 if ( DeclarationWithType * function = InitTweak::getFunction( appExpr ) ) {
    342                                         if ( function->get_linkage() == LinkageSpec::Intrinsic ) {
    343                                                 if ( function->get_name() == "*?" || function->get_name() == "?[?]" ) {
    344                                                         // intrinsic dereference, subscript are pure, but need to recursively look for impurity
    345                                                         Parent::visit( appExpr );
    346                                                         return;
    347                                                 }
    348                                         }
    349                                 }
    350                                 maybeImpure = true;
    351                         }
     339                        virtual void visit( ApplicationExpr * appExpr ) { maybeImpure = true;   }
    352340                        virtual void visit( UntypedExpr * untypedExpr ) { maybeImpure = true; }
    353341                        bool maybeImpure = false;
Note: See TracChangeset for help on using the changeset viewer.