Changes in / [f4bc57c:d1aa5c0]


Ignore:
Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/InitTweak.cc

    rf4bc57c rd1aa5c0  
    115115
    116116        namespace {
    117                 std::string funcName( Expression * func ) {
     117                template<typename CallExpr>
     118                std::string funcName( CallExpr * expr ) {
     119                        Expression * func = expr->get_function();
    118120                        if ( NameExpr * nameExpr = dynamic_cast< NameExpr * >( func ) ) {
    119121                                return nameExpr->get_name();
    120122                        } else if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( func ) ) {
    121123                                return varExpr->get_var()->get_name();
    122                         }       else if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( func ) ) {
    123                                 return funcName( castExpr->get_arg() );
    124124                        } else {
    125125                                assert( false && "Unexpected expression type being called as a function in call expression" );
     
    130130        std::string getFunctionName( Expression * expr ) {
    131131                if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr ) ) {
    132                         return funcName( appExpr->get_function() );
     132                        return funcName( appExpr );
    133133                } else if ( UntypedExpr * untypedExpr = dynamic_cast< UntypedExpr * > ( expr ) ) {
    134                         return funcName( untypedExpr->get_function() );
     134                        return funcName( untypedExpr );
    135135                } else {
    136                         std::cerr << expr << std::endl;
    137136                        assert( false && "Unexpected expression type passed to getFunctionName" );
    138137                }
  • src/SymTab/Autogen.cc

    rf4bc57c rd1aa5c0  
    482482                ObjectDecl *dst = new ObjectDecl( "_dst", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), typeInst->clone() ), 0 );
    483483                if ( typeDecl->get_base() ) {
    484                         // xxx - generate ctor/dtors for typedecls, e.g.
    485                         // otype T = int *;
    486484                        stmts = new CompoundStmt( std::list< Label >() );
    487485                        UntypedExpr *assign = new UntypedExpr( new NameExpr( "?=?" ) );
Note: See TracChangeset for help on using the changeset viewer.