Lines Matching defs:type2

365   bool Equal(TypeHandle type1, TypeHandle type2) {
367 type1->Is(type2) && type2->Is(type1) &&
368 Rep::IsBitset(type1) == Rep::IsBitset(type2) &&
369 Rep::IsClass(type1) == Rep::IsClass(type2) &&
370 Rep::IsConstant(type1) == Rep::IsConstant(type2) &&
371 Rep::IsContext(type1) == Rep::IsContext(type2) &&
372 Rep::IsArray(type1) == Rep::IsArray(type2) &&
373 Rep::IsFunction(type1) == Rep::IsFunction(type2) &&
374 Rep::IsUnion(type1) == Rep::IsUnion(type2) &&
375 type1->NumClasses() == type2->NumClasses() &&
376 type1->NumConstants() == type2->NumConstants() &&
378 Rep::AsBitset(type1) == Rep::AsBitset(type2)) &&
380 Rep::AsClass(type1) == Rep::AsClass(type2)) &&
382 Rep::AsConstant(type1) == Rep::AsConstant(type2)) &&
385 Rep::Length(Rep::AsUnion(type1)) == Rep::Length(Rep::AsUnion(type2)));
388 void CheckEqual(TypeHandle type1, TypeHandle type2) {
389 CHECK(Equal(type1, type2));
392 void CheckSub(TypeHandle type1, TypeHandle type2) {
393 CHECK(type1->Is(type2));
394 CHECK(!type2->Is(type1));
395 if (Rep::IsBitset(type1) && Rep::IsBitset(type2)) {
396 CHECK_NE(Rep::AsBitset(type1), Rep::AsBitset(type2));
400 void CheckUnordered(TypeHandle type1, TypeHandle type2) {
401 CHECK(!type1->Is(type2));
402 CHECK(!type2->Is(type1));
403 if (Rep::IsBitset(type1) && Rep::IsBitset(type2)) {
404 CHECK_NE(Rep::AsBitset(type1), Rep::AsBitset(type2));
408 void CheckOverlap(TypeHandle type1, TypeHandle type2, TypeHandle mask) {
409 CHECK(type1->Maybe(type2));
410 CHECK(type2->Maybe(type1));
411 if (Rep::IsBitset(type1) && Rep::IsBitset(type2)) {
413 Rep::AsBitset(type1) & Rep::AsBitset(type2) & Rep::AsBitset(mask));
417 void CheckDisjoint(TypeHandle type1, TypeHandle type2, TypeHandle mask) {
418 CHECK(!type1->Is(type2));
419 CHECK(!type2->Is(type1));
420 CHECK(!type1->Maybe(type2));
421 CHECK(!type2->Maybe(type1));
422 if (Rep::IsBitset(type1) && Rep::IsBitset(type2)) {
424 Rep::AsBitset(type1) & Rep::AsBitset(type2) & Rep::AsBitset(mask));
440 TypeHandle type2 = *it2;
441 TypeHandle union12 = T.Union(type1, type2);
442 CHECK(!(this->IsBitset(type1) && this->IsBitset(type2)) ||
451 TypeHandle type2 = *it2;
452 TypeHandle intersect12 = T.Intersect(type1, type2);
453 CHECK(!(this->IsBitset(type1) && this->IsBitset(type2)) ||
462 TypeHandle type2 = *it2;
463 TypeHandle union12 = T.Union(type1, type2);
464 CHECK(!(this->IsBitset(type2) && type1->Is(type2)) ||
473 TypeHandle type2 = *it2;
474 TypeHandle union12 = T.Union(type1, type2);
475 if (this->IsBitset(type1) && this->IsBitset(type2)) {
477 this->AsBitset(type1) | this->AsBitset(type2),
487 TypeHandle type2 = *it2;
488 TypeHandle intersect12 = T.Intersect(type1, type2);
489 if (this->IsBitset(type1) && this->IsBitset(type2)) {
491 this->AsBitset(type1) & this->AsBitset(type2),
519 TypeHandle type2 = T.Class(map2);
520 CHECK(Equal(type1, type2) == (*map1 == *map2));
546 TypeHandle type2 = T.Constant(value2);
547 CHECK(Equal(type1, type2) == (*value1 == *value2));
610 TypeHandle type2 = T.Random();
612 TypeHandle array2 = T.Array1(type2);
613 CHECK(Equal(array1, array2) == Equal(type1, type2));
624 TypeHandle type2 = T.Random();
626 TypeHandle function0 = T.Function0(type1, type2);
627 TypeHandle function1 = T.Function1(type1, type2, type3);
628 TypeHandle function2 = T.Function2(type1, type2, type3);
641 TypeHandle type2 = T.Random();
643 TypeHandle function0 = T.Function0(type1, type2);
644 TypeHandle function1 = T.Function1(type1, type2, type3);
645 TypeHandle function2 = T.Function2(type1, type2, type3);
652 CheckEqual(type2, function0->AsFunction()->Receiver());
653 CheckEqual(type2, function1->AsFunction()->Receiver());
656 CheckEqual(type2, function2->AsFunction()->Parameter(0));
667 TypeHandle type2 = T.Random();
669 TypeHandle function01 = T.Function0(type1, type2);
671 TypeHandle function03 = T.Function0(type3, type2);
672 TypeHandle function11 = T.Function1(type1, type2, type2);
673 TypeHandle function12 = T.Function1(type1, type2, type3);
674 TypeHandle function21 = T.Function2(type1, type2, type2);
675 TypeHandle function22 = T.Function2(type1, type2, type3);
676 TypeHandle function23 = T.Function2(type1, type3, type2);
677 CHECK(Equal(function01, function02) == Equal(type2, type3));
679 CHECK(Equal(function11, function12) == Equal(type2, type3));
680 CHECK(Equal(function21, function22) == Equal(type2, type3));
681 CHECK(Equal(function21, function23) == Equal(type2, type3));
825 TypeHandle type2 = *it2;
827 CHECK(!(type1->Is(type2) && type2->Is(type3)) || type1->Is(type3));
836 TypeHandle type2 = *it2;
837 CHECK((type1->Is(type2) && type2->Is(type1)) == Equal(type1, type2));
988 TypeHandle type2 = *it2;
990 CHECK(!(type1->NowIs(type2) && type2->NowIs(type3)) ||
1000 TypeHandle type2 = *it2;
1001 CHECK((type1->NowIs(type2) && type2->NowIs(type1)) ==
1002 Equal(type1, type2));
1010 TypeHandle type2 = *it2;
1011 CHECK(!type1->Is(type2) || type1->NowIs(type2));
1148 TypeHandle type2 = *it2;
1149 CHECK(type1->Maybe(type2) == type2->Maybe(type1));
1157 TypeHandle type2 = *it2;
1158 CHECK(!type1->Maybe(type2) ||
1159 (type1->IsInhabited() && type2->IsInhabited()));
1167 TypeHandle type2 = *it2;
1168 TypeHandle intersect12 = T.Intersect(type1, type2);
1169 CHECK(!type1->Maybe(type2) || intersect12->IsInhabited());
1177 TypeHandle type2 = *it2;
1178 CHECK(!(type1->Is(type2) && type1->IsInhabited()) ||
1179 type1->Maybe(type2));
1315 TypeHandle type2 = *it2;
1316 TypeHandle union12 = T.Union(type1, type2);
1317 TypeHandle union21 = T.Union(type2, type1);
1327 TypeHandle type2 = *it2;
1329 TypeHandle union12 = T.Union(type1, type2);
1330 TypeHandle union23 = T.Union(type2, type3);
1342 TypeHandle type2 = *it2;
1343 TypeHandle union12 = T.Union(type1, type2);
1345 CHECK(type2->Is(union12));
1353 TypeHandle type2 = *it2;
1354 TypeHandle union12 = T.Union(type1, type2);
1355 if (type1->Is(type2)) CheckEqual(union12, type2);
1366 TypeHandle type2 = *it2;
1369 TypeHandle union23 = T.Union(type2, type3);
1370 CHECK(!type1->Is(type2) || union13->Is(union23));
1380 TypeHandle type2 = *it2;
1382 TypeHandle union12 = T.Union(type1, type2);
1383 CHECK(!(type1->Is(type3) && type2->Is(type3)) || union12->Is(type3));
1393 TypeHandle type2 = *it2;
1395 TypeHandle union23 = T.Union(type2, type3);
1396 CHECK(!(type1->Is(type2) || type1->Is(type3)) || type1->Is(union23));
1543 TypeHandle type2 = *it2;
1544 TypeHandle intersect12 = T.Intersect(type1, type2);
1545 TypeHandle intersect21 = T.Intersect(type2, type1);
1556 TypeHandle type2 = *it2;
1558 TypeHandle intersect12 = T.Intersect(type1, type2);
1559 TypeHandle intersect23 = T.Intersect(type2, type3);
1571 TypeHandle type2 = *it2;
1572 TypeHandle intersect12 = T.Intersect(type1, type2);
1574 CHECK(intersect12->Is(type2));
1582 TypeHandle type2 = *it2;
1583 TypeHandle intersect12 = T.Intersect(type1, type2);
1584 if (type1->Is(type2)) CheckEqual(intersect12, type1);
1595 TypeHandle type2 = *it2;
1598 TypeHandle intersect23 = T.Intersect(type2, type3);
1599 CHECK(!type1->Is(type2) || intersect13->Is(intersect23));
1609 TypeHandle type2 = *it2;
1611 TypeHandle intersect12 = T.Intersect(type1, type2);
1612 CHECK(!(type1->Is(type3) || type2->Is(type3)) ||
1623 TypeHandle type2 = *it2;
1625 TypeHandle intersect23 = T.Intersect(type2, type3);
1626 CHECK(!(type1->Is(type2) && type1->Is(type3)) ||
1736 TypeHandle type2 = *it2;
1738 TypeHandle union12 = T.Union(type1, type2);
1740 TypeHandle intersect23 = T.Intersect(type2, type3);
1756 TypeHandle type2 = *it2;
1758 TypeHandle intersect12 = T.Intersect(type1, type2);
1760 TypeHandle union23 = T.Union(type2, type3);
1775 TypeHandle2 type2 = T2.template Convert<Type>(type1);
1776 TypeHandle type3 = T.template Convert<Type2>(type2);
1785 TypeHandle type2 = *it2;
1787 HType htype2 = HType::FromType<Type>(type2);
1788 CHECK(!type1->Is(type2) || htype1.IsSubtypeOf(htype2));