Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/InitTweak.cc

    r77bfc80 rf072892  
    55#include <memory>                  // for __shared_ptr
    66
    7 #include "AST/Expr.hpp"
    8 #include "AST/Stmt.hpp"
    9 #include "AST/Type.hpp"
    107#include "Common/PassVisitor.h"
    118#include "Common/SemanticError.h"  // for SemanticError
     
    2926#include "Tuples/Tuples.h"         // for Tuples::isTtype
    3027
     28class UntypedValofExpr;
     29
    3130namespace InitTweak {
    3231        namespace {
     
    433432                        assert( false );
    434433                }
    435 
    436                 // template<typename CallExpr>
    437                 // const ast::Expr * callArg( const CallExpr * call, unsigned int pos ) {
    438                 //      if( pos >= call->args.size() ) {
    439                 //              assertf( false, "getCallArg for argument that doesn't exist: (%u); %s.",
    440                 //                      pos, toString( call ).c_str() );
    441                 //      }
    442                 //      for ( const ast::Expr * arg : call->args ) {
    443                 //              if ( pos == 0 ) return arg;
    444                 //              --pos;
    445                 //      }
    446                 //      assert( false );
    447                 // }
    448434        }
    449435
     
    465451                        assertf( false, "Unexpected expression type passed to getCallArg: %s", toString( callExpr ).c_str() );
    466452                }
    467         }
    468         const ast::Expr * getCallArg( const ast::Expr * call, unsigned pos ) {
    469                 (void)call;
    470                 (void)pos;
    471                 #warning unimplemented; needs to build AST/Expr.cpp
    472                 assertf(false, "unimplemented; needs to build AST/Expr.cpp");
    473                 // if ( auto app = dynamic_cast< const ast::ApplicationExpr * >( call ) ) {
    474                 //      return callArg( app, pos );
    475                 // } else if ( auto untyped = dynamic_cast< const ast::UntypedExpr * >( call ) ) {
    476                 //      return callArg( untyped, pos );
    477                 // } else if ( auto tupleAssn = dynamic_cast< const ast::TupleAssignExpr * >( call ) ) {
    478                 //      const std::list<ast::ptr<ast::Stmt>>& stmts = tupleAssn->stmtExpr->stmts->kids;
    479                 //      assertf( ! stmts.empty(), "TupleAssignExpr missing statements." );
    480                 //      const ExprStmt * stmt = strict_dynamic_cast< const ast::ExprStmt * >( stmts.back() );
    481                 //      const TupleExpr * tuple = strict_dynamic_cast< const ast::TupleExpr * >( stmt->expr );
    482                 //      assertf( ! tuple->exprs.empty(), "TupleAssignExpr has empty tuple expr.");
    483                 //      return getCallArg( tuple->exprs.front(), pos );
    484                 // } else if ( auto ctor = dynamic_cast< const ast::ImplicitCopyCtorExpr * >( call ) ) {
    485                 //      return getCallArg( ctor->callExpr, pos );
    486                 // } else {
    487                 //      assertf( false, "Unexpected expression type passed to getCallArg: %s",
    488                 //              toString( call ).c_str() );
    489                 // }
    490453        }
    491454
     
    550513                }
    551514        }
    552         const ast::Type* getPointerBase( const ast::Type* t ) {
    553                 (void)t;
    554                 #warning needs to build Type.cpp before inclusion
    555                 assertf(false, "needs to build Type.cpp before inclusion");
    556                 // if ( const auto * p = dynamic_cast< const ast::PointerType * >( t ) ) {
    557                 //      return p->base;
    558                 // } else if ( const auto * a = dynamic_cast< const ast::ArrayType * >( t ) ) {
    559                 //      return a->base;
    560                 // } else if ( const auto * r = dynamic_cast< const ast::ReferenceType * >( t ) ) {
    561                 //      return r->base;
    562                 // } else return nullptr;
    563         }
    564515
    565516        Type * isPointerType( Type * type ) {
Note: See TracChangeset for help on using the changeset viewer.