Changeset 0b150ec
- Timestamp:
- May 24, 2017, 4:12:28 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 7f623d6f
- Parents:
- 6e206cb
- Location:
- src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/MakeLibCfa.cc
r6e206cb r0b150ec 75 75 case CodeGen::OT_POSTFIXASSIGN: 76 76 case CodeGen::OT_INFIXASSIGN: 77 case CodeGen::OT_CTOR: 78 case CodeGen::OT_DTOR: 77 79 funcDecl->get_statements()->get_kids().push_back( new ReturnStmt( std::list< Label >(), newExpr ) ); 78 80 break; 79 case CodeGen::OT_CTOR:80 // ctors don't return a value81 if ( funcDecl->get_functionType()->get_parameters().size() == 1 ) {82 // intrinsic default constructors should do nothing83 // delete newExpr;84 break;85 } else {86 assert( funcDecl->get_functionType()->get_parameters().size() == 2 );87 // anything else is a single parameter constructor that is effectively a C-style assignment88 // delete newExpr->get_function();89 assert(newExpr->get_args().size()==2);90 newExpr->set_function( new NameExpr( "?=?" ) );91 funcDecl->get_statements()->get_kids().push_back( new ExprStmt( std::list< Label >(), newExpr ) );92 }93 break;94 case CodeGen::OT_DTOR:95 // intrinsic destructors should do nothing96 // delete newExpr;97 break;98 81 case CodeGen::OT_CONSTANT: 99 82 case CodeGen::OT_LABELADDRESS: -
src/ResolvExpr/CastCost.cc
r6e206cb r0b150ec 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // CastCost.cc -- 7 // CastCost.cc -- 8 8 // 9 9 // Author : Richard C. Bilson … … 26 26 public: 27 27 CastCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ); 28 28 29 29 virtual void visit( BasicType *basicType ); 30 30 virtual void visit( PointerType *pointerType ); … … 36 36 NamedTypeDecl *namedType; 37 37 if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) { 38 return castCost( src, eqvClass.type, indexer, env ); 38 if ( eqvClass.type ) { 39 return castCost( src, eqvClass.type, indexer, env ); 40 } else { 41 return Cost::infinity; 42 } 39 43 } else if ( ( namedType = indexer.lookupType( destAsTypeInst->get_name() ) ) ) { 40 44 TypeDecl *type = dynamic_cast< TypeDecl* >( namedType ); -
src/ResolvExpr/ConversionCost.cc
r6e206cb r0b150ec 30 30 /// std::cout << "type inst " << destAsTypeInst->get_name(); 31 31 if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) { 32 return conversionCost( src, eqvClass.type, indexer, env ); 32 if ( eqvClass.type ) { 33 return conversionCost( src, eqvClass.type, indexer, env ); 34 } else { 35 return Cost::infinity; 36 } 33 37 } else if ( ( namedType = indexer.lookupType( destAsTypeInst->get_name() ) ) ) { 34 38 /// std::cout << " found" << std::endl; -
src/ResolvExpr/Resolver.cc
r6e206cb r0b150ec 124 124 } // if 125 125 #endif 126 assert ( finder.get_alternatives().size() == 1);126 assertf( finder.get_alternatives().size() == 1, "findSingleExpression: must have exactly one alternative at the end." ); 127 127 Alternative &choice = finder.get_alternatives().front(); 128 128 Expression *newExpr = choice.expr->clone(); … … 397 397 // // cerr << type << endl; 398 398 // // } // for 399 399 400 400 // // O(N^2) checks of d-types with f-types 401 401 // // find the minimum cost -
src/ResolvExpr/Unify.cc
r6e206cb r0b150ec 344 344 std::cerr << "unifyInexact type 1 is "; 345 345 type1->print( std::cerr ); 346 std::cerr << " type 2 is ";346 std::cerr << " type 2 is "; 347 347 type2->print( std::cerr ); 348 348 std::cerr << std::endl; … … 595 595 TypeExpr *otherParam = dynamic_cast< TypeExpr* >(*jt); 596 596 assertf(otherParam, "Aggregate parameters should be type expressions"); 597 597 598 598 Type* paramTy = param->get_type(); 599 599 Type* otherParamTy = otherParam->get_type(); -
src/SymTab/FixFunction.cc
r6e206cb r0b150ec 24 24 25 25 DeclarationWithType * FixFunction::mutate(FunctionDecl *functionDecl) { 26 ObjectDecl *pointer = new ObjectDecl( functionDecl->get_name(), functionDecl->get_storageClasses(), functionDecl->get_linkage(), 0, new PointerType( Type::Qualifiers(), functionDecl->get_type() ->clone()), 0, functionDecl->get_attributes() );26 ObjectDecl *pointer = new ObjectDecl( functionDecl->get_name(), functionDecl->get_storageClasses(), functionDecl->get_linkage(), 0, new PointerType( Type::Qualifiers(), functionDecl->get_type() ), 0, functionDecl->get_attributes() ); 27 27 functionDecl->get_attributes().clear(); 28 // can't delete function type because it may contain assertions, but can't transfer ownership without a clone since set_type checks for nullptr 29 functionDecl->set_type( functionDecl->get_type()->clone() ); 28 30 delete functionDecl; 29 31 return pointer; -
src/Tuples/TupleExpansion.cc
r6e206cb r0b150ec 332 332 TypeInstType * isTtype( Type * type ) { 333 333 if ( TypeInstType * inst = dynamic_cast< TypeInstType * >( type ) ) { 334 if ( inst->get_baseType() ->get_kind() == TypeDecl::Ttype ) {334 if ( inst->get_baseType() && inst->get_baseType()->get_kind() == TypeDecl::Ttype ) { 335 335 return inst; 336 336 } -
src/prelude/prelude.cf
r6e206cb r0b150ec 309 309 // forall( dtype DT ) signed int ?!=?( const volatile void *, const volatile DT * ); 310 310 311 // forall( dtype DT ) signed int ?==?( const volatile DT *, forall( dtype DT2 )const DT2 *);312 // forall( dtype DT ) signed int ?==?( forall( dtype DT2 )const DT2 *, const volatile DT * );313 // forall( ftype FT ) signed int ?==?( FT *, forall( ftype FT2 )FT2 *);314 // forall( ftype FT ) signed int ?==?( forall( ftype FT2 )FT2 *, FT * );315 // forall( dtype DT ) signed int ?!=?( const volatile DT *, forall( dtype DT2 )const DT2 *);316 // forall( dtype DT ) signed int ?!=?( forall( dtype DT2 )const DT2 *, const volatile DT * );317 // forall( ftype FT ) signed int ?!=?( FT *, forall( ftype FT2 )FT2 *);318 // forall( ftype FT ) signed int ?!=?( forall( ftype FT2 )FT2 *, FT * );311 // forall( dtype DT ) signed int ?==?( const volatile DT *, zero_t ); 312 // forall( dtype DT ) signed int ?==?( zero_t, const volatile DT * ); 313 // forall( ftype FT ) signed int ?==?( FT *, zero_t ); 314 // forall( ftype FT ) signed int ?==?( zero_t, FT * ); 315 // forall( dtype DT ) signed int ?!=?( const volatile DT *, zero_t ); 316 // forall( dtype DT ) signed int ?!=?( zero_t, const volatile DT * ); 317 // forall( ftype FT ) signed int ?!=?( FT *, zero_t ); 318 // forall( ftype FT ) signed int ?!=?( zero_t, FT * ); 319 319 320 320 // ------------------------------------------------------------ … … 447 447 const volatile void * ?=?( const volatile void * volatile *, const volatile void * ); 448 448 449 // forall( dtype DT ) DT * ?=?( DT * *, forall( dtype DT2 ) const DT2 *);450 // forall( dtype DT ) DT * ?=?( DT * volatile *, forall( dtype DT2 ) const DT2 *);451 forall( dtype DT ) const DT * ?=?( const DT * *, forall( dtype DT2 ) const DT2 *);452 forall( dtype DT ) const DT * ?=?( const DT * volatile *, forall( dtype DT2 ) const DT2 *);453 // forall( dtype DT ) volatile DT * ?=?( volatile DT * *, forall( dtype DT2 ) const DT2 *);454 // forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile *, forall( dtype DT2 ) const DT2 *);455 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * *, forall( dtype DT2 ) const DT2 *);456 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile *, forall( dtype DT2 ) const DT2 *);457 458 forall( ftype FT ) FT * ?=?( FT * *, forall( ftype FT2 ) FT2 *);459 forall( ftype FT ) FT * ?=?( FT * volatile *, forall( ftype FT2 ) FT2 *);449 // //forall( dtype DT ) DT * ?=?( DT * *, zero_t ); 450 // //forall( dtype DT ) DT * ?=?( DT * volatile *, zero_t ); 451 // forall( dtype DT ) const DT * ?=?( const DT * *, zero_t ); 452 // forall( dtype DT ) const DT * ?=?( const DT * volatile *, zero_t ); 453 // //forall( dtype DT ) volatile DT * ?=?( volatile DT * *, zero_t ); 454 // //forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile *, ); 455 // forall( dtype DT ) const volatile DT * ?=?( const volatile DT * *, zero_t ); 456 // forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile *, zero_t ); 457 458 // forall( ftype FT ) FT * ?=?( FT * *, zero_t ); 459 // forall( ftype FT ) FT * ?=?( FT * volatile *, zero_t ); 460 460 461 461 forall( dtype T | sized(T) ) T * ?+=?( T * *, ptrdiff_t ); … … 799 799 void ?{}( const volatile void * *, const volatile void * ); 800 800 801 // forall( dtype DT ) void ?{}( DT * *, forall( dtype DT2 ) const DT2 *);802 // forall( dtype DT ) void ?{}( DT * volatile *, forall( dtype DT2 ) const DT2 *);803 forall( dtype DT ) void ?{}( const DT * *, forall( dtype DT2 ) const DT2 *);804 // forall( dtype DT ) void ?{}( volatile DT * *, forall( dtype DT2 ) const DT2 *);805 // forall( dtype DT ) void ?{}( volatile DT * volatile *, forall( dtype DT2 ) const DT2 *);806 forall( dtype DT ) void ?{}( const volatile DT * *, forall( dtype DT2 ) const DT2 *);807 808 forall( ftype FT ) void ?{}( FT * *, forall( ftype FT2 ) FT2 *);801 // //forall( dtype DT ) void ?{}( DT * *, zero_t ); 802 // //forall( dtype DT ) void ?{}( DT * volatile *, zero_t ); 803 // forall( dtype DT ) void ?{}( const DT * *, zero_t ); 804 // //forall( dtype DT ) void ?{}( volatile DT * *, zero_t ); 805 // //forall( dtype DT ) void ?{}( volatile DT * volatile *, zero_t ); 806 // forall( dtype DT ) void ?{}( const volatile DT * *, zero_t ); 807 808 // forall( ftype FT ) void ?{}( FT * *, zero_t ); 809 809 810 810 // default ctors
Note: See TracChangeset
for help on using the changeset viewer.