• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/clang/lib/Sema/

Lines Matching refs:FromType

226   // Note that FromType has not necessarily been transformed by the
228 // check for their presence as well as checking whether FromType is
248 QualType FromType = getFromType();
251 // Note that FromType has not necessarily been transformed by the
255 FromType = Context.getArrayDecayedType(FromType);
257 if (Second == ICK_Pointer_Conversion && FromType->isAnyPointerType())
316 QualType FromType = getToType(0);
328 if (FromType->isRealFloatingType())
330 if (FromType->isIntegralOrUnscopedEnumerationType())
343 if (FromType->isRealFloatingType() && ToType->isIntegralType(Ctx)) {
345 } else if (FromType->isIntegralOrUnscopedEnumerationType() &&
385 if (FromType->isRealFloatingType() && ToType->isRealFloatingType() &&
386 Ctx.getFloatingTypeOrder(FromType, ToType) == 1) {
387 // FromType is larger than ToType.
422 assert(FromType->isIntegralOrUnscopedEnumerationType());
424 const bool FromSigned = FromType->isSignedIntegerOrEnumerationType();
425 const unsigned FromWidth = Ctx.getIntWidth(FromType);
432 // Not all values of FromType can be represented in ToType.
1448 QualType FromType = From->getType();
1449 if (ToType->getAs<RecordType>() && FromType->getAs<RecordType>() &&
1450 (S.Context.hasSameUnqualifiedType(FromType, ToType) ||
1451 S.IsDerivedFrom(From->getBeginLoc(), FromType, ToType))) {
1454 ICS.Standard.setFromType(FromType);
1464 if (!S.Context.hasSameUnqualifiedType(FromType, ToType))
1525 /// Determine whether the conversion from FromType to ToType is a valid
1528 bool Sema::IsFunctionConversion(QualType FromType, QualType ToType,
1530 if (Context.hasSameUnqualifiedType(FromType, ToType))
1541 CanQualType CanFrom = Context.getCanonicalType(FromType);
1622 /// Determine whether the conversion from FromType to ToType is a valid
1627 static bool IsVectorConversion(Sema &S, QualType FromType,
1631 if (!ToType->isVectorType() && !FromType->isVectorType())
1635 if (S.Context.hasSameUnqualifiedType(FromType, ToType))
1642 if (FromType->isExtVectorType())
1646 if (FromType->isArithmeticType()) {
1659 if (ToType->isVectorType() && FromType->isVectorType()) {
1660 if (S.Context.areCompatibleVectorTypes(FromType, ToType) ||
1661 (S.isLaxVectorConversion(FromType, ToType) &&
1689 QualType FromType = From->getType();
1694 SCS.setFromType(FromType);
1700 (FromType->isRecordType() || ToType->isRecordType()))
1707 if (FromType == S.Context.OverloadTy) {
1714 FromType = Fn->getType();
1715 SCS.setFromType(FromType);
1720 S.ExtractUnqualifiedFunctionType(ToType), FromType)) {
1723 if (!S.IsFunctionConversion(FromType,
1731 // function and recompute the FromType accordingly. Take advantage of the
1743 FromType = S.Context.getMemberPointerType(FromType, ClassType);
1748 FromType = S.Context.getPointerType(FromType);
1755 FromType,
1766 !FromType->isFunctionType() && !FromType->isArrayType() &&
1767 S.Context.getCanonicalType(FromType) != S.Context.OverloadTy) {
1773 if (const AtomicType *Atomic = FromType->getAs<AtomicType>())
1774 FromType = Atomic->getValueType();
1780 FromType = FromType.getUnqualifiedType();
1781 } else if (FromType->isArrayType()) {
1788 FromType = S.Context.getArrayDecayedType(FromType);
1801 SCS.setAllToTypes(FromType);
1804 } else if (FromType->isFunctionType() && argIsLValue) {
1816 FromType = S.Context.getPointerType(FromType);
1821 SCS.setToType(0, FromType);
1831 if (S.Context.hasSameUnqualifiedType(FromType, ToType)) {
1835 } else if (S.IsIntegralPromotion(From, FromType, ToType)) {
1838 FromType = ToType.getUnqualifiedType();
1839 } else if (S.IsFloatingPointPromotion(FromType, ToType)) {
1842 FromType = ToType.getUnqualifiedType();
1843 } else if (S.IsComplexPromotion(FromType, ToType)) {
1846 FromType = ToType.getUnqualifiedType();
1848 (FromType->isArithmeticType() ||
1849 FromType->isAnyPointerType() ||
1850 FromType->isBlockPointerType() ||
1851 FromType->isMemberPointerType())) {
1854 FromType = S.Context.BoolTy;
1855 } else if (FromType->isIntegralOrUnscopedEnumerationType() &&
1859 FromType = ToType.getUnqualifiedType();
1860 } else if (FromType->isAnyComplexType() && ToType->isAnyComplexType()) {
1863 FromType = ToType.getUnqualifiedType();
1864 } else if ((FromType->isAnyComplexType() && ToType->isArithmeticType()) ||
1865 (ToType->isAnyComplexType() && FromType->isArithmeticType())) {
1868 FromType = ToType.getUnqualifiedType();
1869 } else if (FromType->isRealFloatingType() && ToType->isRealFloatingType()) {
1875 if (FromType == S.Context.BFloat16Ty || ToType == S.Context.BFloat16Ty)
1877 if (&S.Context.getFloatTypeSemantics(FromType) !=
1879 bool Float128AndLongDouble = ((FromType == S.Context.Float128Ty &&
1881 (FromType == S.Context.LongDoubleTy &&
1890 FromType = ToType.getUnqualifiedType();
1891 } else if ((FromType->isRealFloatingType() &&
1893 (FromType->isIntegralOrUnscopedEnumerationType() &&
1896 if (FromType->isBFloat16Type() || ToType->isBFloat16Type())
1901 FromType = ToType.getUnqualifiedType();
1902 } else if (S.IsBlockPointerConversion(FromType, ToType, FromType)) {
1905 S.isObjCWritebackConversion(FromType, ToType, FromType)) {
1907 } else if (S.IsPointerConversion(From, FromType, ToType, InOverloadResolution,
1908 FromType, IncompatibleObjC)) {
1912 FromType = FromType.getUnqualifiedType();
1913 } else if (S.IsMemberPointerConversion(From, FromType, ToType,
1914 InOverloadResolution, FromType)) {
1917 } else if (IsVectorConversion(S, FromType, ToType, SecondICK)) {
1919 FromType = ToType.getUnqualifiedType();
1921 S.Context.typesAreCompatible(ToType, FromType)) {
1924 FromType = ToType.getUnqualifiedType();
1929 FromType = ToType;
1939 FromType = ToType;
1944 FromType = ToType;
1948 FromType = ToType;
1953 SCS.setToType(1, FromType);
1958 if (S.IsFunctionConversion(FromType, ToType, FromType)) {
1962 } else if (S.IsQualificationConversion(FromType, ToType, CStyle,
1966 FromType = ToType;
1976 QualType CanonFrom = S.Context.getCanonicalType(FromType);
1981 FromType = ToType;
1985 SCS.setToType(2, FromType);
2057 /// expression From (whose potentially-adjusted type is FromType) to
2060 bool Sema::IsIntegralPromotion(Expr *From, QualType FromType, QualType ToType) {
2072 if (FromType->isPromotableIntegerType() && !FromType->isBooleanType() &&
2073 !FromType->isEnumeralType()) {
2075 (FromType->isSignedIntegerType() ||
2078 Context.getTypeSize(FromType) < Context.getTypeSize(ToType))) {
2103 if (const EnumType *FromEnumType = FromType->getAs<EnumType>()) {
2121 isCompleteType(From->getBeginLoc(), FromType))
2143 if (FromType->isAnyCharacterType() && !FromType->isCharType() &&
2147 bool FromIsSigned = FromType->isSignedIntegerType();
2148 uint64_t FromSize = Context.getTypeSize(FromType);
2187 if (FromType->isIntegralType(Context) &&
2194 (FromType->isSignedIntegerType() && BitWidth <= ToSize)) {
2200 if (FromType->isUnsignedIntegerType() && BitWidth <= ToSize) {
2211 if (FromType->isBooleanType() && To->getKind() == BuiltinType::Int) {
2219 /// FromType to ToType is a floating point promotion (C++ 4.6). If so,
2221 bool Sema::IsFloatingPointPromotion(QualType FromType, QualType ToType) {
2222 if (const BuiltinType *FromBuiltin = FromType->getAs<BuiltinType>())
2255 bool Sema::IsComplexPromotion(QualType FromType, QualType ToType) {
2256 const ComplexType *FromComplex = FromType->getAs<ComplexType>();
2334 /// expression From, which has the (possibly adjusted) type FromType,
2349 bool Sema::IsPointerConversion(Expr *From, QualType FromType, QualType ToType,
2354 if (isObjCPointerConversion(FromType, ToType, ConvertedType,
2366 if (FromType->isBlockPointerType() && ToType->isPointerType() &&
2400 if (FromType->isObjCObjectPointerType() && ToPointeeType->isVoidType() &&
2403 FromType->getAs<ObjCObjectPointerType>(),
2408 const PointerType *FromTypePtr = FromType->getAs<PointerType>();
2501 bool Sema::isObjCPointerConversion(QualType FromType, QualType ToType,
2508 Qualifiers FromQualifiers = FromType.getQualifiers();
2514 FromType->getAs<ObjCObjectPointerType>();
2564 else if (FromType->getAs<BlockPointerType>() &&
2575 if (const PointerType *FromCPtr = FromType->getAs<PointerType>())
2578 FromType->getAs<BlockPointerType>())
2675 /// \param FromType The type we're converting form.
2681 bool Sema::isObjCWritebackConversion(QualType FromType, QualType ToType,
2684 Context.hasSameUnqualifiedType(FromType, ToType))
2702 if (const PointerType *FromPointer = FromType->getAs<PointerType>())
2739 bool Sema::IsBlockPointerConversion(QualType FromType, QualType ToType,
2750 FromType->getAs<BlockPointerType>())
2844 static const FunctionProtoType *tryGetFunctionProtoType(QualType FromType) {
2845 if (auto *FPT = FromType->getAs<FunctionProtoType>())
2848 if (auto *MPT = FromType->getAs<MemberPointerType>())
2858 QualType FromType, QualType ToType) {
2860 if (FromType.isNull() || ToType.isNull()) {
2866 if (FromType->isMemberPointerType() && ToType->isMemberPointerType()) {
2867 const auto *FromMember = FromType->castAs<MemberPointerType>(),
2874 FromType = FromMember->getPointeeType();
2878 if (FromType->isPointerType())
2879 FromType = FromType->getPointeeType();
2884 FromType = FromType.getNonReferenceType();
2888 if (FromType->isInstantiationDependentType() &&
2889 !FromType->getAs<TemplateSpecializationType>()) {
2895 if (Context.hasSameType(FromType, ToType)) {
2900 const FunctionProtoType *FromFunction = tryGetFunctionProtoType(FromType),
2988 QualType FromType = From->getType();
2993 if (Diagnose && !IsCStyleOrFunctionalCast && !FromType->isAnyPointerType() &&
3005 if (const PointerType *FromPtrType = FromType->getAs<PointerType>()) {
3040 FromType->getAs<ObjCObjectPointerType>()) {
3046 } else if (FromType->isBlockPointerType()) {
3052 if (!FromType->isBlockPointerType())
3065 /// expression From, which has the (possibly adjusted) type FromType, can be
3069 bool Sema::IsMemberPointerConversion(Expr *From, QualType FromType,
3086 const MemberPointerType *FromTypePtr = FromType->getAs<MemberPointerType>();
3115 QualType FromType = From->getType();
3116 const MemberPointerType *FromPtrType = FromType->getAs<MemberPointerType>();
3187 /// FromType and \p ToType is permissible, given knowledge about whether every
3189 static bool isQualificationConversionStep(QualType FromType, QualType ToType,
3193 Qualifiers FromQuals = FromType.getQualifiers();
3252 /// an rvalue of type FromType to ToType is a qualification conversion
3259 Sema::IsQualificationConversion(QualType FromType, QualType ToType,
3261 FromType = Context.getCanonicalType(FromType);
3265 // If FromType and ToType are the same type, this is not a
3267 if (FromType.getUnqualifiedType() == ToType.getUnqualifiedType())
3275 while (Context.UnwrapSimilarTypes(FromType, ToType)) {
3277 FromType, ToType, CStyle, !UnwrappedAnyPointer,
3283 // We are left with FromType and ToType being the pointee types
3284 // after unwrapping the original FromType and ToType the same number
3285 // of times. If we unwrapped any pointers, and if FromType and
3288 return UnwrappedAnyPointer && Context.hasSameUnqualifiedType(FromType,ToType);
3879 QualType FromType = SCS.getFromType();
3880 if (!FromType->isEnumeralType())
3883 EnumDecl *Enum = FromType->getAs<EnumType>()->getDecl();
5225 TryObjectArgumentInitialization(Sema &S, SourceLocation Loc, QualType FromType,
5245 if (const PointerType *PT = FromType->getAs<PointerType>()) {
5246 FromType = PT->getPointeeType();
5253 assert(FromType->isRecordType());
5274 QualType FromTypeCanon = S.Context.getCanonicalType(FromType);
5279 FromType, ImplicitParamType);
5288 FromType, ImplicitParamType);
5299 } else if (S.IsDerivedFrom(Loc, FromType, ClassType))
5303 FromType, ImplicitParamType);
5316 ICS.setBad(BadConversionSequence::lvalue_ref_to_rvalue, FromType,
5325 ICS.setBad(BadConversionSequence::rvalue_ref_to_lvalue, FromType,
5336 ICS.Standard.setFromType(FromType);