Changeset 9d1e3f7
- Timestamp:
- Apr 5, 2018, 11:58:01 AM (7 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, with_gc
- Children:
- 10246645, ca37445
- Parents:
- 593370c
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/ErrorObjects.h
r593370c r9d1e3f7 35 35 class SemanticErrorException : public std::exception { 36 36 public: 37 37 SemanticErrorException() = default; 38 38 SemanticErrorException( CodeLocation location, std::string error ); 39 39 ~SemanticErrorException() throw() {} -
src/ResolvExpr/CommonType.cc
r593370c r9d1e3f7 27 27 #include "typeops.h" // for isFtype 28 28 29 // #define DEBUG 29 #define DEBUG 30 #ifdef DEBUG 31 #define PRINT(x) x 32 #else 33 #define PRINT(x) 34 #endif 30 35 31 36 namespace ResolvExpr { … … 70 75 // need unify to bind type variables 71 76 if ( unify( t1, t2, env, have, need, newOpen, indexer, common ) ) { 72 // std::cerr << "unify success: " << widenFirst << " " << widenSecond << std::endl; 77 PRINT( 78 std::cerr << "unify success: " << widenFirst << " " << widenSecond << std::endl; 79 ) 73 80 if ( (widenFirst || t2->get_qualifiers() <= t1->get_qualifiers()) && (widenSecond || t1->get_qualifiers() <= t2->get_qualifiers()) ) { 74 // std::cerr << "widen okay" << std::endl; 81 PRINT( 82 std::cerr << "widen okay" << std::endl; 83 ) 75 84 common->get_qualifiers() |= t1->get_qualifiers(); 76 85 common->get_qualifiers() |= t2->get_qualifiers(); … … 78 87 } 79 88 } 80 // std::cerr << "exact unify failed: " << t1 << " " << t2 << std::endl; 89 PRINT( 90 std::cerr << "exact unify failed: " << t1 << " " << t2 << std::endl; 91 ) 81 92 return nullptr; 82 93 } … … 94 105 // special case where one type has a reference depth of 1 larger than the other 95 106 if ( diff > 0 || diff < 0 ) { 96 // std::cerr << "reference depth diff: " << diff << std::endl; 107 PRINT( 108 std::cerr << "reference depth diff: " << diff << std::endl; 109 ) 97 110 Type * result = nullptr; 98 111 ReferenceType * ref1 = dynamic_cast< ReferenceType * >( type1 ); … … 109 122 if ( result && ref1 ) { 110 123 // formal is reference, so result should be reference 111 // std::cerr << "formal is reference; result should be reference" << std::endl; 124 PRINT( 125 std::cerr << "formal is reference; result should be reference" << std::endl; 126 ) 112 127 result = new ReferenceType( ref1->get_qualifiers(), result ); 113 128 } 114 // std::cerr << "common type of reference [" << type1 << "] and [" << type2 << "] is [" << result << "]" << std::endl; 129 PRINT( 130 std::cerr << "common type of reference [" << type1 << "] and [" << type2 << "] is [" << result << "]" << std::endl; 131 ) 115 132 return result; 116 133 }
Note: See TracChangeset
for help on using the changeset viewer.