Changes in src/InitTweak/InitTweak.cc [77bfc80:f072892]
- File:
-
- 1 edited
-
src/InitTweak/InitTweak.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/InitTweak.cc
r77bfc80 rf072892 5 5 #include <memory> // for __shared_ptr 6 6 7 #include "AST/Expr.hpp"8 #include "AST/Stmt.hpp"9 #include "AST/Type.hpp"10 7 #include "Common/PassVisitor.h" 11 8 #include "Common/SemanticError.h" // for SemanticError … … 29 26 #include "Tuples/Tuples.h" // for Tuples::isTtype 30 27 28 class UntypedValofExpr; 29 31 30 namespace InitTweak { 32 31 namespace { … … 433 432 assert( false ); 434 433 } 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 // }448 434 } 449 435 … … 465 451 assertf( false, "Unexpected expression type passed to getCallArg: %s", toString( callExpr ).c_str() ); 466 452 } 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.cpp472 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 // }490 453 } 491 454 … … 550 513 } 551 514 } 552 const ast::Type* getPointerBase( const ast::Type* t ) {553 (void)t;554 #warning needs to build Type.cpp before inclusion555 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 }564 515 565 516 Type * isPointerType( Type * type ) {
Note:
See TracChangeset
for help on using the changeset viewer.