Changeset 353d168 for src/ResolvExpr
- Timestamp:
- Aug 19, 2015, 3:59:45 PM (11 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, stuck-waitfor-destruct, with_gc
- Children:
- 830c21a
- Parents:
- 18997b9 (diff), 4aa0858 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- src/ResolvExpr
- Files:
-
- 6 edited
-
AlternativeFinder.cc (modified) (2 diffs)
-
CastCost.cc (modified) (3 diffs)
-
CommonType.cc (modified) (1 diff)
-
Cost.h (modified) (2 diffs)
-
Resolver.cc (modified) (3 diffs)
-
typeops.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/AlternativeFinder.cc
r18997b9 r353d168 343 343 } 344 344 345 /// Adds type variables to the open variable set and marks their assertions 345 346 void makeUnifiableVars( Type *type, OpenVarSet &unifiableVars, AssertionSet &needAssertions ) { 346 347 for ( std::list< TypeDecl* >::const_iterator tyvar = type->get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) { … … 697 698 std::list< Type* >::iterator candidate_end = (*i).expr->get_results().begin(); 698 699 std::advance( candidate_end, castExpr->get_results().size() ); 699 if ( ! unifyList( (*i).expr->get_results().begin(), candidate_end,700 castExpr->get_results().begin(), castExpr->get_results().end(), i->env, needAssertions, haveAssertions, openVars, indexer ) ) continue;701 700 Cost thisCost = castCostList( (*i).expr->get_results().begin(), candidate_end, 702 701 castExpr->get_results().begin(), castExpr->get_results().end(), indexer, i->env ); -
src/ResolvExpr/CastCost.cc
r18997b9 r353d168 66 66 67 67 void CastCost::visit( BasicType *basicType ) { 68 if ( dynamic_cast< PointerType* >( dest ) ) { 68 PointerType *destAsPointer = dynamic_cast< PointerType* >( dest ); 69 if ( destAsPointer && basicType->isInteger() ) { 69 70 cost = Cost( 1, 0, 0 ); 70 71 } else { … … 77 78 if ( pointerType->get_qualifiers() <= destAsPtr->get_qualifiers() && typesCompatibleIgnoreQualifiers( pointerType->get_base(), destAsPtr->get_base(), indexer, env ) ) { 78 79 cost = Cost( 0, 0, 1 ); 79 } else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {80 if ( destAsBasic->isInteger() ) {81 cost = Cost( 1, 0, 0 );82 } // if83 80 } else { 84 81 TypeEnvironment newEnv( env ); … … 92 89 } // if 93 90 } // if 94 } // if 91 } else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) { 92 if ( destAsBasic->isInteger() ) { 93 cost = Cost( 1, 0, 0 ); 94 } // if 95 } 95 96 } 96 97 } // namespace ResolvExpr -
src/ResolvExpr/CommonType.cc
r18997b9 r353d168 138 138 void CommonType::visit( PointerType *pointerType ) { 139 139 if ( PointerType *otherPointer = dynamic_cast< PointerType* >( type2 ) ) { 140 if ( widenFirst && dynamic_cast< VoidType* >( otherPointer->get_base() ) ) {140 if ( widenFirst && dynamic_cast< VoidType* >( otherPointer->get_base() ) && ! isFtype(pointerType->get_base(), indexer) ) { 141 141 result = otherPointer->clone(); 142 142 result->get_qualifiers() += pointerType->get_qualifiers(); 143 } else if ( widenSecond && dynamic_cast< VoidType* >( pointerType->get_base() ) ) {143 } else if ( widenSecond && dynamic_cast< VoidType* >( pointerType->get_base() ) && ! isFtype(otherPointer->get_base(), indexer) ) { 144 144 result = pointerType->clone(); 145 145 result->get_qualifiers() += otherPointer->get_qualifiers(); -
src/ResolvExpr/Cost.h
r18997b9 r353d168 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 09:39:50 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sun May 17 09:42:04201513 // Update Count : 311 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed Jul 22 16:43:10 2015 13 // Update Count : 4 14 14 // 15 15 … … 56 56 57 57 inline void Cost::incPoly( int inc ) { 58 unsafe+= inc;58 poly += inc; 59 59 } 60 60 61 61 inline void Cost::incSafe( int inc ) { 62 unsafe += inc;62 safe += inc; 63 63 } 64 64 -
src/ResolvExpr/Resolver.cc
r18997b9 r353d168 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 12:17:01 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Wed Jul 15 14:54:04 201513 // Update Count : 1 6711 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 24 17:33:54 2015 13 // Update Count : 178 14 14 // 15 15 … … 41 41 42 42 virtual void visit( ExprStmt *exprStmt ); 43 virtual void visit( AsmExpr *asmExpr ); 44 virtual void visit( AsmStmt *asmStmt ); 43 45 virtual void visit( IfStmt *ifStmt ); 44 46 virtual void visit( WhileStmt *whileStmt ); … … 209 211 exprStmt->set_expr( newExpr ); 210 212 } // if 213 } 214 215 void Resolver::visit( AsmExpr *asmExpr ) { 216 Expression *newExpr = findVoidExpression( asmExpr->get_operand(), *this ); 217 delete asmExpr->get_operand(); 218 asmExpr->set_operand( newExpr ); 219 if ( asmExpr->get_inout() ) { 220 newExpr = findVoidExpression( asmExpr->get_inout(), *this ); 221 delete asmExpr->get_inout(); 222 asmExpr->set_inout( newExpr ); 223 } // if 224 } 225 226 void Resolver::visit( AsmStmt *asmStmt ) { 227 acceptAll( asmStmt->get_input(), *this); 228 acceptAll( asmStmt->get_output(), *this); 211 229 } 212 230 -
src/ResolvExpr/typeops.h
r18997b9 r353d168 117 117 118 118 // in Unify.cc 119 bool isFtype( Type *type, const SymTab::Indexer &indexer ); 119 120 bool typesCompatible( Type *, Type *, const SymTab::Indexer &indexer, const TypeEnvironment &env ); 120 121 bool typesCompatibleIgnoreQualifiers( Type *, Type *, const SymTab::Indexer &indexer, const TypeEnvironment &env );
Note:
See TracChangeset
for help on using the changeset viewer.