Home | History | Annotate | Download | only in Sema

Lines Matching refs:FromType

223   // Note that FromType has not necessarily been transformed by the
225 // check for their presence as well as checking whether FromType is
245 QualType FromType = getFromType();
248 // Note that FromType has not necessarily been transformed by the
252 FromType = Context.getArrayDecayedType(FromType);
254 if (Second == ICK_Pointer_Conversion && FromType->isAnyPointerType())
302 QualType FromType = getToType(0);
312 if (FromType->isRealFloatingType() && ToType->isIntegralType(Ctx)) {
314 } else if (FromType->isIntegralType(Ctx) && ToType->isRealFloatingType()) {
346 if (FromType->isRealFloatingType() && ToType->isRealFloatingType() &&
347 Ctx.getFloatingTypeOrder(FromType, ToType) == 1) {
348 // FromType is larger than ToType.
377 if (!FromType->isIntegralOrUnscopedEnumerationType()) {
383 assert(FromType->isIntegralOrUnscopedEnumerationType());
385 const bool FromSigned = FromType->isSignedIntegerOrEnumerationType();
386 const unsigned FromWidth = Ctx.getIntWidth(FromType);
392 // Not all values of FromType can be represented in ToType.
1130 QualType FromType = From->getType();
1131 if (ToType->getAs<RecordType>() && FromType->getAs<RecordType>() &&
1132 (S.Context.hasSameUnqualifiedType(FromType, ToType) ||
1133 S.IsDerivedFrom(FromType, ToType))) {
1136 ICS.Standard.setFromType(FromType);
1146 if (!S.Context.hasSameUnqualifiedType(FromType, ToType))
1203 /// \brief Determine whether the conversion from FromType to ToType is a valid
1205 bool Sema::IsNoReturnConversion(QualType FromType, QualType ToType,
1207 if (Context.hasSameUnqualifiedType(FromType, ToType))
1216 CanQualType CanFrom = Context.getCanonicalType(FromType);
1251 /// \brief Determine whether the conversion from FromType to ToType is a valid
1256 static bool IsVectorConversion(ASTContext &Context, QualType FromType,
1260 if (!ToType->isVectorType() && !FromType->isVectorType())
1264 if (Context.hasSameUnqualifiedType(FromType, ToType))
1271 if (FromType->isExtVectorType())
1275 if (FromType->isArithmeticType()) {
1285 if (ToType->isVectorType() && FromType->isVectorType()) {
1286 if (Context.areCompatibleVectorTypes(FromType, ToType) ||
1288 (Context.getTypeSize(FromType) == Context.getTypeSize(ToType)))) {
1315 QualType FromType = From->getType();
1321 SCS.setFromType(FromType);
1326 if (FromType->isRecordType() || ToType->isRecordType()) {
1337 if (FromType == S.Context.OverloadTy) {
1344 FromType = Fn->getType();
1349 S.ExtractUnqualifiedFunctionType(ToType), FromType)) {
1352 if (!S.IsNoReturnConversion(FromType,
1360 // function and recompute the FromType accordingly. Take advantage of the
1372 FromType = S.Context.getMemberPointerType(FromType, ClassType);
1377 FromType = S.Context.getPointerType(FromType);
1382 FromType,
1393 !FromType->isFunctionType() && !FromType->isArrayType() &&
1394 S.Context.getCanonicalType(FromType) != S.Context.OverloadTy) {
1400 if (const AtomicType *Atomic = FromType->getAs<AtomicType>())
1401 FromType = Atomic->getValueType();
1407 FromType = FromType.getUnqualifiedType();
1408 } else if (FromType->isArrayType()) {
1415 FromType = S.Context.getArrayDecayedType(FromType);
1428 SCS.setAllToTypes(FromType);
1431 } else if (FromType->isFunctionType() && argIsLValue) {
1438 FromType = S.Context.getPointerType(FromType);
1443 SCS.setToType(0, FromType);
1453 if (S.Context.hasSameUnqualifiedType(FromType, ToType)) {
1457 } else if (S.IsIntegralPromotion(From, FromType, ToType)) {
1460 FromType = ToType.getUnqualifiedType();
1461 } else if (S.IsFloatingPointPromotion(FromType, ToType)) {
1464 FromType = ToType.getUnqualifiedType();
1465 } else if (S.IsComplexPromotion(FromType, ToType)) {
1468 FromType = ToType.getUnqualifiedType();
1470 (FromType->isArithmeticType() ||
1471 FromType->isAnyPointerType() ||
1472 FromType->isBlockPointerType() ||
1473 FromType->isMemberPointerType() ||
1474 FromType->isNullPtrType())) {
1477 FromType = S.Context.BoolTy;
1478 } else if (FromType->isIntegralOrUnscopedEnumerationType() &&
1482 FromType = ToType.getUnqualifiedType();
1483 } else if (FromType->isAnyComplexType() && ToType->isComplexType()) {
1486 FromType = ToType.getUnqualifiedType();
1487 } else if ((FromType->isAnyComplexType() && ToType->isArithmeticType()) ||
1488 (ToType->isAnyComplexType() && FromType->isArithmeticType())) {
1491 FromType = ToType.getUnqualifiedType();
1492 } else if (FromType->isRealFloatingType() && ToType->isRealFloatingType()) {
1495 FromType = ToType.getUnqualifiedType();
1496 } else if ((FromType->isRealFloatingType() &&
1498 (FromType->isIntegralOrUnscopedEnumerationType() &&
1502 FromType = ToType.getUnqualifiedType();
1503 } else if (S.IsBlockPointerConversion(FromType, ToType, FromType)) {
1506 S.isObjCWritebackConversion(FromType, ToType, FromType)) {
1508 } else if (S.IsPointerConversion(From, FromType, ToType, InOverloadResolution,
1509 FromType, IncompatibleObjC)) {
1513 FromType = FromType.getUnqualifiedType();
1514 } else if (S.IsMemberPointerConversion(From, FromType, ToType,
1515 InOverloadResolution, FromType)) {
1518 } else if (IsVectorConversion(S.Context, FromType, ToType, SecondICK)) {
1520 FromType = ToType.getUnqualifiedType();
1522 S.Context.typesAreCompatible(ToType, FromType)) {
1525 FromType = ToType.getUnqualifiedType();
1526 } else if (S.IsNoReturnConversion(FromType, ToType, FromType)) {
1533 FromType = ToType;
1543 SCS.setToType(1, FromType);
1549 if (S.IsQualificationConversion(FromType, ToType, CStyle,
1553 FromType = ToType;
1554 CanonFrom = S.Context.getCanonicalType(FromType);
1564 CanonFrom = S.Context.getCanonicalType(FromType);
1571 FromType = ToType;
1575 SCS.setToType(2, FromType);
1611 /// expression From (whose potentially-adjusted type is FromType) to
1614 bool Sema::IsIntegralPromotion(Expr *From, QualType FromType, QualType ToType) {
1626 if (FromType->isPromotableIntegerType() && !FromType->isBooleanType() &&
1627 !FromType->isEnumeralType()) {
1629 (FromType->isSignedIntegerType() ||
1632 (!FromType->isSignedIntegerType() &&
1633 Context.getTypeSize(FromType) < Context.getTypeSize(ToType)))) {
1652 if (const EnumType *FromEnumType = FromType->getAs<EnumType>()) {
1660 !RequireCompleteType(From->getLocStart(), FromType, PDiag()))
1674 if (FromType->isAnyCharacterType() && !FromType->isCharType() &&
1678 bool FromIsSigned = FromType->isSignedIntegerType();
1679 uint64_t FromSize = Context.getTypeSize(FromType);
1714 if (FromType->isIntegralType(Context) &&
1721 (FromType->isSignedIntegerType() && BitWidth <= ToSize)) {
1727 if (FromType->isUnsignedIntegerType() && BitWidth <= ToSize) {
1737 if (FromType->isBooleanType() && To->getKind() == BuiltinType::Int) {
1745 /// FromType to ToType is a floating point promotion (C++ 4.6). If so,
1747 bool Sema::IsFloatingPointPromotion(QualType FromType, QualType ToType) {
1748 if (const BuiltinType *FromBuiltin = FromType->getAs<BuiltinType>())
1779 bool Sema::IsComplexPromotion(QualType FromType, QualType ToType) {
1780 const ComplexType *FromComplex = FromType->getAs<ComplexType>();
1858 /// expression From, which has the (possibly adjusted) type FromType,
1873 bool Sema::IsPointerConversion(Expr *From, QualType FromType, QualType ToType,
1878 if (isObjCPointerConversion(FromType, ToType, ConvertedType,
1890 if (FromType->isBlockPointerType() && ToType->isPointerType() &&
1924 if (FromType->isObjCObjectPointerType() && ToPointeeType->isVoidType() &&
1927 FromType->getAs<ObjCObjectPointerType>(),
1932 const PointerType *FromTypePtr = FromType->getAs<PointerType>();
2026 bool Sema::isObjCPointerConversion(QualType FromType, QualType ToType,
2033 Qualifiers FromQualifiers = FromType.getQualifiers();
2039 FromType->getAs<ObjCObjectPointerType>();
2058 Context.ObjCQualifiedIdTypesAreCompatible(ToType, FromType,
2105 else if (FromType->getAs<BlockPointerType>() &&
2116 if (const PointerType *FromCPtr = FromType->getAs<PointerType>())
2119 FromType->getAs<BlockPointerType>())
2216 /// \param FromType The type we're converting form.
2222 bool Sema::isObjCWritebackConversion(QualType FromType, QualType ToType,
2225 Context.hasSameUnqualifiedType(FromType, ToType))
2243 if (const PointerType *FromPointer = FromType->getAs<PointerType>())
2280 bool Sema::IsBlockPointerConversion(QualType FromType, QualType ToType,
2291 FromType->getAs<BlockPointerType>())
2383 QualType FromType, QualType ToType) {
2385 if (FromType.isNull() || ToType.isNull()) {
2391 if (FromType->isMemberPointerType() && ToType->isMemberPointerType()) {
2392 const MemberPointerType *FromMember = FromType->getAs<MemberPointerType>(),
2399 FromType = FromMember->getPointeeType();
2403 if (FromType->isPointerType())
2404 FromType = FromType->getPointeeType();
2409 FromType = FromType.getNonReferenceType();
2413 if (FromType->isInstantiationDependentType() &&
2414 !FromType->getAs<TemplateSpecializationType>()) {
2420 if (Context.hasSameType(FromType, ToType)) {
2425 const FunctionProtoType *FromFunction = FromType->getAs<FunctionProtoType>(),
2493 QualType FromType = (*N);
2494 if (!Context.hasSameType(ToType, FromType)) {
2496 if (const PointerType *PTFr = FromType->getAs<PointerType>())
2506 FromType->getAs<ObjCObjectPointerType>())
2529 QualType FromType = From->getType();
2542 if (const PointerType *FromPtrType = FromType->getAs<PointerType>()) {
2563 FromType->getAs<ObjCObjectPointerType>()) {
2569 } else if (FromType->isBlockPointerType()) {
2575 if (!FromType->isBlockPointerType())
2588 /// expression From, which has the (possibly adjusted) type FromType, can be
2592 bool Sema::IsMemberPointerConversion(Expr *From, QualType FromType,
2609 const MemberPointerType *FromTypePtr = FromType->getAs<MemberPointerType>();
2639 QualType FromType = From->getType();
2640 const MemberPointerType *FromPtrType = FromType->getAs<MemberPointerType>();
2695 /// an rvalue of type FromType to ToType is a qualification conversion
2702 Sema::IsQualificationConversion(QualType FromType, QualType ToType,
2704 FromType = Context.getCanonicalType(FromType);
2708 // If FromType and ToType are the same type, this is not a
2710 if (FromType.getUnqualifiedType() == ToType.getUnqualifiedType())
2718 while (Context.UnwrapSimilarPointerTypes(FromType, ToType)) {
2727 Qualifiers FromQuals = FromType.getQualifiers();
2769 // We are left with FromType and ToType being the pointee types
2770 // after unwrapping the original FromType and ToType the same number
2771 // of types. If we unwrapped any pointers, and if FromType and
2774 return UnwrappedAnyPointer && Context.hasSameUnqualifiedType(FromType,ToType);
4564 QualType FromType = OrigFromType;
4565 if (const PointerType *PT = FromType->getAs<PointerType>()) {
4566 FromType = PT->getPointeeType();
4573 assert(FromType->isRecordType());
4594 QualType FromTypeCanon = S.Context.getCanonicalType(FromType);
4609 } else if (S.IsDerivedFrom(FromType, ClassType))
4613 FromType, ImplicitParamType);
4626 ICS.setBad(BadConversionSequence::lvalue_ref_to_rvalue, FromType,
4635 ICS.setBad(BadConversionSequence::rvalue_ref_to_lvalue, FromType,
4646 ICS.Standard.setFromType(FromType);