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

Lines Matching defs:LHSType

1037                                              ExprResult &RHS, QualType LHSType,
1041 if (!handleIntegerToComplexFloatConversion(S, RHS, LHS, RHSType, LHSType,
1043 return LHSType;
1044 if (!handleIntegerToComplexFloatConversion(S, LHS, RHS, LHSType, RHSType,
1060 int Order = S.Context.getFloatingTypeOrder(LHSType, RHSType);
1062 auto *LHSComplexType = dyn_cast<ComplexType>(LHSType);
1065 LHSComplexType ? LHSComplexType->getElementType() : LHSType;
1124 ExprResult &RHS, QualType LHSType,
1126 bool LHSFloat = LHSType->isRealFloatingType();
1132 int order = S.Context.getFloatingTypeOrder(LHSType, RHSType);
1134 RHS = S.ImpCastExprToType(RHS.get(), LHSType, CK_FloatingCast);
1135 return LHSType;
1146 if (LHSType->isHalfType() && !S.getLangOpts().NativeHalfType)
1147 LHSType = S.Context.FloatTy;
1149 return handleIntToFloatConversion(S, LHS, RHS, LHSType, RHSType,
1154 return handleIntToFloatConversion(S, RHS, LHS, RHSType, LHSType,
1162 static bool unsupportedTypeConversion(const Sema &S, QualType LHSType,
1167 if (!LHSType->isFloatingType() || !RHSType->isFloatingType() ||
1168 S.Context.getFloatingTypeOrder(LHSType, RHSType) == 0)
1171 assert(LHSType->isFloatingType() && RHSType->isFloatingType() &&
1174 auto *LHSComplex = LHSType->getAs<ComplexType>();
1178 LHSComplex->getElementType() : LHSType;
1219 ExprResult &RHS, QualType LHSType,
1222 int order = S.Context.getIntegerTypeOrder(LHSType, RHSType);
1223 bool LHSSigned = LHSType->hasSignedIntegerRepresentation();
1228 RHS = (*doRHSCast)(S, RHS.get(), LHSType);
1229 return LHSType;
1237 RHS = (*doRHSCast)(S, RHS.get(), LHSType);
1238 return LHSType;
1242 } else if (S.Context.getIntWidth(LHSType) != S.Context.getIntWidth(RHSType)) {
1247 RHS = (*doRHSCast)(S, RHS.get(), LHSType);
1248 return LHSType;
1258 S.Context.getCorrespondingUnsignedType(LHSSigned ? LHSType : RHSType);
1269 ExprResult &RHS, QualType LHSType,
1272 const ComplexType *LHSComplexInt = LHSType->getAsComplexIntegerType();
1302 (S, LHS, RHS, LHSType, RHSEltType, IsCompAssign);
1475 QualType LHSType =
1481 if (const AtomicType *AtomicLHS = LHSType->getAs<AtomicType>())
1482 LHSType = AtomicLHS->getValueType();
1485 if (LHSType == RHSType)
1486 return LHSType;
1490 if (!LHSType->isArithmeticType() || !RHSType->isArithmeticType())
1494 QualType LHSUnpromotedType = LHSType;
1495 if (LHSType->isPromotableIntegerType())
1496 LHSType = Context.getPromotedIntegerType(LHSType);
1499 LHSType = LHSBitfieldPromoteTy;
1500 if (LHSType != LHSUnpromotedType && ACK != ACK_CompAssign)
1501 LHS = ImpCastExprToType(LHS.get(), LHSType, CK_IntegralCast);
1504 if (LHSType == RHSType)
1505 return LHSType;
1509 if(LHSType->isExtIntType() || RHSType->isExtIntType())
1516 if (unsupportedTypeConversion(*this, LHSType, RHSType))
1520 if (LHSType->isComplexType() || RHSType->isComplexType())
1521 return handleComplexFloatConversion(*this, LHS, RHS, LHSType, RHSType,
1525 if (LHSType->isRealFloatingType() || RHSType->isRealFloatingType())
1526 return handleFloatConversion(*this, LHS, RHS, LHSType, RHSType,
1530 if (LHSType->isComplexIntegerType() || RHSType->isComplexIntegerType())
1531 return handleComplexIntConversion(*this, LHS, RHS, LHSType, RHSType,
1534 if (LHSType->isFixedPointType() || RHSType->isFixedPointType())
1535 return handleFixedPointConversion(*this, LHSType, RHSType);
1539 (*this, LHS, RHS, LHSType, RHSType, ACK == ACK_CompAssign);
7871 QualType LHSType =
7876 if (!LHSType->isIntegerType() && !LHSType->isRealFloatingType()) {
7878 << LHSType << LHS.get()->getSourceRange();
7889 if (LHSType == RHSType)
7890 return LHSType;
7893 if (LHSType->isRealFloatingType() || RHSType->isRealFloatingType())
7894 return handleFloatConversion(S, LHS, RHS, LHSType, RHSType,
7899 (S, LHS, RHS, LHSType, RHSType, /*IsCompAssign = */ false);
8642 checkPointerTypesForAssignment(Sema &S, QualType LHSType, QualType RHSType) {
8643 assert(LHSType.isCanonical() && "LHS not canonicalized!");
8650 cast<PointerType>(LHSType)->getPointeeType().split().asPair();
8767 if (RHSType->isFunctionPointerType() && LHSType->isFunctionPointerType())
8784 checkBlockPointerTypesForAssignment(Sema &S, QualType LHSType,
8786 assert(LHSType.isCanonical() && "LHS not canonicalized!");
8792 lhptee = cast<BlockPointerType>(LHSType)->getPointeeType();
8823 S.Context.getQualifiedType(LHSType.getUnqualifiedType(), LQuals),
8826 } else if (!S.Context.typesAreBlockPointerCompatible(LHSType, RHSType))
8835 checkObjCPointerTypesForAssignment(Sema &S, QualType LHSType,
8837 assert(LHSType.isCanonical() && "LHS was not canonicalized!");
8840 if (LHSType->isObjCBuiltinType()) {
8842 if (LHSType->isObjCClassType() && !RHSType->isObjCBuiltinType() &&
8848 if (RHSType->isObjCClassType() && !LHSType->isObjCBuiltinType() &&
8849 !LHSType->isObjCQualifiedClassType())
8853 QualType lhptee = LHSType->castAs<ObjCObjectPointerType>()->getPointeeType();
8858 !LHSType->isObjCQualifiedIdType())
8861 if (S.Context.typesAreCompatible(LHSType, RHSType))
8863 if (LHSType->isObjCQualifiedIdType() || RHSType->isObjCQualifiedIdType())
8870 QualType LHSType, QualType RHSType) {
8879 return CheckAssignmentConstraints(LHSType, RHSPtr, K, /*ConvertRHS=*/false);
8908 Sema::CheckAssignmentConstraints(QualType LHSType, ExprResult &RHS,
8911 QualType OrigLHSType = LHSType;
8915 LHSType = Context.getCanonicalType(LHSType).getUnqualifiedType();
8919 if (LHSType == RHSType) {
8926 if (const AtomicType *AtomicTy = dyn_cast<AtomicType>(LHSType)) {
8942 // LHSType so that the resulting expression does not have reference
8944 if (const ReferenceType *LHSTypeRef = LHSType->getAs<ReferenceType>()) {
8954 if (LHSType->isExtVectorType()) {
8960 RHS = prepareVectorSplat(LHSType, RHS.get());
8967 if (LHSType->isVectorType() || RHSType->isVectorType()) {
8968 if (LHSType->isVectorType() && RHSType->isVectorType()) {
8971 if (Context.areCompatibleVectorTypes(LHSType, RHSType)) {
8979 if (isLaxVectorConversion(RHSType, LHSType)) {
8989 if (LHSType->isScalarType()) {
8992 isLaxVectorConversion(RHSType, LHSType)) {
8994 *VecExpr = ImpCastExprToType(VecExpr->get(), LHSType, CK_BitCast);
9005 if (unsupportedTypeConversion(*this, LHSType, RHSType))
9011 !LHSType->getAs<ComplexType>())
9015 if (LHSType->isArithmeticType() && RHSType->isArithmeticType() &&
9016 !(getLangOpts().CPlusPlus && LHSType->isEnumeralType())) {
9018 Kind = PrepareScalarCast(RHS, LHSType);
9023 if (const PointerType *LHSPointer = dyn_cast<PointerType>(LHSType)) {
9030 else if (Context.hasCvrSimilarType(RHSType, LHSType))
9034 return checkPointerTypesForAssignment(*this, LHSType, RHSType);
9054 Context.hasSameType(LHSType,
9081 if (isa<BlockPointerType>(LHSType)) {
9084 LangAS AddrSpaceL = LHSType->getAs<BlockPointerType>()
9091 return checkBlockPointerTypesForAssignment(*this, LHSType, RHSType);
9117 if (isa<ObjCObjectPointerType>(LHSType)) {
9122 checkObjCPointerTypesForAssignment(*this, LHSType, RHSType);
9147 if (LHSType->isObjCClassType() &&
9158 LHSType->isBlockCompatibleObjCPointerType(Context)) {
9171 if (LHSType == Context.BoolTy) {
9177 if (LHSType->isIntegerType()) {
9188 if (LHSType == Context.BoolTy) {
9194 if (LHSType->isIntegerType()) {
9203 if (isa<TagType>(LHSType) && isa<TagType>(RHSType)) {
9204 if (Context.typesAreCompatible(LHSType, RHSType)) {
9210 if (LHSType->isSamplerT() && RHSType->isIntegerType()) {
9291 Sema::CheckSingleAssignmentConstraints(QualType LHSType, ExprResult &CallerRHS,
9305 if (const auto *LHSPtrType = LHSType->getAs<PointerType>()) {
9317 if (!LHSType->isRecordType() && !LHSType->isAtomicType()) {
9323 RHS = PerformImplicitConversion(RHS.get(), LHSType.getUnqualifiedType(),
9327 TryImplicitConversion(RHS.get(), LHSType.getUnqualifiedType(),
9335 RHS = PerformImplicitConversion(RHS.get(), LHSType.getUnqualifiedType(),
9342 !CheckObjCARCUnavailableWeakConversion(LHSType, RHSType))
9356 RHS.get(), LHSType, /*Complain=*/false, DAP))
9364 if ((LHSType->isPointerType() || LHSType->isObjCObjectPointerType() ||
9365 LHSType->isBlockPointerType()) &&
9371 CheckPointerConversion(RHS.get(), LHSType, Kind, Path,
9374 RHS = ImpCastExprToType(RHS.get(), LHSType, Kind, VK_RValue, &Path);
9380 if (LHSType->isQueueT() && RHS.get()->isNullPointerConstant(
9382 RHS = ImpCastExprToType(RHS.get(), LHSType, CK_NullToPointer);
9392 if (!LHSType->isReferenceType()) {
9400 CheckAssignmentConstraints(LHSType, RHS, Kind, ConvertRHS);
9408 if (result != Incompatible && RHS.get()->getType() != LHSType) {
9409 QualType Ty = LHSType.getNonLValueExprType(Context);
9422 (CheckObjCBridgeRelatedConversions(E->getBeginLoc(), LHSType,
9424 CheckConversionToObjCLiteral(LHSType, E, Diagnose))) {
9492 QualType LHSType = LHS.get()->IgnoreImpCasts()->getType();
9495 bool LHSNatVec = LHSType->isVectorType();
9508 << 1 << LHSType << RHSType << LHS.get()->getSourceRange()
9777 QualType LHSType = LHS.get()->getType().getUnqualifiedType();
9780 const VectorType *LHSVecType = LHSType->getAs<VectorType>();
9792 if (Context.hasSameType(LHSType, RHSType))
9793 return LHSType;
9797 Context.areCompatibleVectorTypes(LHSType, RHSType)) {
9799 RHS = ImpCastExprToType(RHS.get(), LHSType, CK_BitCast);
9800 return LHSType;
9818 RHS = ImpCastExprToType(RHS.get(), LHSType, CK_BitCast);
9819 return LHSType;
9836 LHSVecType->getElementType(), LHSType,
9838 return LHSType;
9841 return LHSType;
9847 LHSType, RHSVecType->getElementType(),
9860 QualType VecType = LHSVecType ? LHSType : RHSType;
9862 QualType OtherType = LHSVecType ? RHSType : LHSType;
9879 *RHSExpr = ImpCastExprToType(RHSExpr->get(), LHSType, CK_BitCast);
9888 (!LHSVecType && !LHSType->isRealType())) {
9890 << LHSType << RHSType
9902 Diag(Loc, diag::err_opencl_implicit_vector_conversion) << LHSType
9913 QualType Scalar = LHSVecType ? RHSType : LHSType;
9914 QualType Vector = LHSVecType ? LHSType : RHSType;
9925 << LHSType << RHSType
10571 QualType LHSType) {
10614 LHSType->hasUnsignedIntegerRepresentation() ||
10647 << HexResult << LHSType
10653 << HexResult.str() << Result.getMinSignedBits() << LHSType
10679 QualType LHSType = LHS.get()->getType();
10682 const VectorType *LHSVecTy = LHSType->getAs<VectorType>();
10683 QualType LHSEleType = LHSVecTy ? LHSVecTy->getElementType() : LHSType;
10714 LHSType = VecTy;
10742 return LHSType;
10777 QualType LHSType = LHS.get()->getType();
10787 if (!LHSType->hasIntegerRepresentation() ||
10793 if (isScopedEnumerationType(LHSType) ||
10798 DiagnoseBadShiftValues(*this, LHS, RHS, Loc, Opc, LHSType);
10801 return LHSType;
10827 QualType LHSType = LHS.get()->getType();
10829 assert(LHSType->isPointerType() || RHSType->isPointerType() ||
10830 LHSType->isMemberPointerType() || RHSType->isMemberPointerType());
10834 if ((LHSType->isAnyPointerType() || LHSType->isMemberPointerType()) &&
11068 QualType LHSType = LHS->getType();
11070 if (LHSType->hasFloatingRepresentation() ||
11071 (LHSType->isBlockPointerType() && !BinaryOperator::isEqualityOp(Opc)) ||
11077 if (Opc == BO_Cmp && LHSType->isArrayType() && RHSType->isArrayType())
11273 QualType LHSType = LHS.get()->getType();
11321 LHSType = RHSType = IntType;
11339 S, Type, LHS.get(), LHSType, LHS.get()->getBeginLoc());
11451 QualType LHSType = LHS.get()->getType();
11453 if ((LHSType->isArithmeticType() || LHSType->isEnumeralType()) &&
11502 if ((LHSType->isIntegerType() && !LHSIsNull) ||
11512 ((LHSType->isFunctionPointerType() && RHSType->isVoidPointerType()) ||
11513 (RHSType->isFunctionPointerType() && LHSType->isVoidPointerType()))) {
11523 RHS = ImpCastExprToType(RHS.get(), LHSType, CK_BitCast);
11539 if ((int)LHSType->isPointerType() + (int)RHSType->isPointerType() >=
11541 (!LangOpts.ObjCAutoRefCount || !(LHSType->isObjCObjectPointerType() ||
11547 } else if (LHSType->isPointerType() &&
11552 LHSType->castAs<PointerType>()->getPointeeType().getCanonicalType();
11566 << LHSType << RHSType << LCanPointeeTy->isIncompleteType()
11572 << LHSType << RHSType << LHS.get()->getSourceRange()
11593 << LHSType << RHSType << 0 /* comparison */
11604 RHS = ImpCastExprToType(RHS.get(), LHSType, Kind);
11614 if (LHSType->isNullPtrType()) {
11615 RHS = ImpCastExprToType(RHS.get(), LHSType, CK_NullToPointer);
11627 (LHSType->isObjCObjectPointerType() || LHSType->isBlockPointerType())) {
11628 RHS = ImpCastExprToType(RHS.get(), LHSType, CK_NullToPointer);
11631 if (!IsOrdered && LHSType->isNullPtrType() &&
11638 ((LHSType->isNullPtrType() && RHSType->isPointerType()) ||
11639 (RHSType->isNullPtrType() && LHSType->isPointerType()))) {
11654 RHS = ImpCastExprToType(RHS.get(), LHSType, CK_NullToPointer);
11666 (LHSType->isMemberPointerType() || RHSType->isMemberPointerType())) {
11675 if (!IsOrdered && LHSType->isBlockPointerType() &&
11677 QualType lpointee = LHSType->castAs<BlockPointerType>()->getPointeeType();
11683 << LHSType << RHSType << LHS.get()->getSourceRange()
11686 RHS = ImpCastExprToType(RHS.get(), LHSType, CK_BitCast);
11692 && ((LHSType->isBlockPointerType() && RHSType->isPointerType())
11693 || (LHSType->isPointerType() && RHSType->isBlockPointerType()))) {
11697 || (LHSType->isPointerType() && LHSType->castAs<PointerType>()
11700 << LHSType << RHSType << LHS.get()->getSourceRange()
11708 RHS = ImpCastExprToType(RHS.get(), LHSType,
11709 LHSType->isPointerType() ? CK_BitCast
11714 if (LHSType->isObjCObjectPointerType() ||
11716 const PointerType *LPT = LHSType->getAs<PointerType>();
11723 !Context.typesAreCompatible(LHSType, RHSType)) {
11741 CheckObjCConversion(SourceRange(), LHSType, E, CCK_ImplicitConversion,
11744 RHS = ImpCastExprToType(E, LHSType,
11749 if (LHSType->isObjCObjectPointerType() &&
11751 if (!Context.areComparableObjCPointerTypes(LHSType, RHSType))
11760 RHS = ImpCastExprToType(RHS.get(), LHSType, CK_BitCast);
11764 if (!IsOrdered && LHSType->isBlockPointerType() &&
11770 LHSType->isBlockCompatibleObjCPointerType(Context) &&
11772 RHS = ImpCastExprToType(RHS.get(), LHSType,
11777 if ((LHSType->isAnyPointerType() && RHSType->isIntegerType()) ||
11778 (LHSType->isIntegerType() && RHSType->isAnyPointerType())) {
11784 } else if ((LHSIsNull && LHSType->isIntegerType()) ||
11802 << LHSType << RHSType << LHS.get()->getSourceRange()
11808 if (LHSType->isIntegerType())
11812 RHS = ImpCastExprToType(RHS.get(), LHSType,
11819 && LHSType->isBlockPointerType() && RHSType->isIntegerType()) {
11820 RHS = ImpCastExprToType(RHS.get(), LHSType, CK_NullToPointer);
11824 && LHSType->isIntegerType() && RHSType->isBlockPointerType()) {
11830 if (LHSType->isClkEventT() && RHSType->isClkEventT()) {
11834 if (LHSType->isQueueT() && RHSType->isQueueT()) {
11843 if (LHSType->isQueueT() && RHSIsNull) {
11844 RHS = ImpCastExprToType(RHS.get(), LHSType, CK_NullToPointer);
11913 QualType LHSType = LHS.get()->getType();
11928 LHSType->hasFloatingRepresentation()) {
12087 QualType LHSType = LHS.get()->getType().getUnqualifiedType();
12090 const MatrixType *LHSMatType = LHSType->getAs<MatrixType>();
12094 if (Context.hasSameType(LHSType, RHSType))
12095 return LHSType;
12104 return LHSType;
12738 QualType LHSType = LHSExpr->getType();
12745 LHSType->isHalfType()) {
12747 << LHSType.getUnqualifiedType();
12757 QualType LHSTy(LHSType);
12763 ((Context.isObjCNSObjectType(LHSType) &&
12766 LHSType->isObjCObjectPointerType())))
12770 LHSType->isObjCObjectType())
12772 << LHSType;
12795 if (LHSType.getObjCLifetime() == Qualifiers::OCL_Strong) {
12805 if (LHSType.getObjCLifetime() == Qualifiers::OCL_Strong ||
12806 LHSType.isNonWeakInMRRWithObjCWeak(Context)) {
12826 ConvTy = CheckAssignmentConstraints(Loc, LHSType, RHSType);
12829 if (DiagnoseAssignmentResult(ConvTy, Loc, LHSType, RHSType,
12835 if (getLangOpts().CPlusPlus20 && LHSType.isVolatileQualified()) {
12846 Diag(Loc, diag::warn_deprecated_compound_assign_volatile) << LHSType;
12858 ? LHSType : LHSType.getUnqualifiedType());