Changeset d60ccbf for src/ResolvExpr
- Timestamp:
- Aug 12, 2015, 2:27:31 PM (10 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, string, with_gc
- Children:
- f32c7f4
- Parents:
- e45215c (diff), e869d663 (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)
-
CommonType.cc (modified) (1 diff)
-
Cost.h (modified) (2 diffs)
-
Resolver.cc (modified) (3 diffs)
-
Resolver.h (modified) (1 diff)
-
typeops.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/AlternativeFinder.cc
re45215c rd60ccbf 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/CommonType.cc
re45215c rd60ccbf 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
re45215c rd60ccbf 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
re45215c rd60ccbf 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/Resolver.h
re45215c rd60ccbf 21 21 22 22 namespace ResolvExpr { 23 /// Checks types and binds syntactic constructs to typed representations 23 24 void resolve( std::list< Declaration * > translationUnit ); 24 25 Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer ); -
src/ResolvExpr/typeops.h
re45215c rd60ccbf 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.