Lines Matching refs:LHSType
655 ExprResult &RHS, QualType LHSType,
658 int order = S.Context.getFloatingTypeOrder(LHSType, RHSType);
668 RHS = S.ImpCastExprToType(RHS.take(), LHSType, CK_FloatingComplexCast);
669 return LHSType;
716 ExprResult &RHS, QualType LHSType,
720 if (!handleIntegerToComplexFloatConversion(S, RHS, LHS, RHSType, LHSType,
722 return LHSType;
723 if (!handleIntegerToComplexFloatConversion(S, LHS, RHS, LHSType, RHSType,
738 bool LHSComplexFloat = LHSType->isComplexType();
744 LHSType, RHSType,
751 S, LHS, RHS, LHSType, RHSType, /*convertComplexExpr*/!IsCompAssign,
756 S, RHS, LHS, RHSType, LHSType, /*convertComplexExpr*/true,
794 ExprResult &RHS, QualType LHSType,
796 bool LHSFloat = LHSType->isRealFloatingType();
802 int order = S.Context.getFloatingTypeOrder(LHSType, RHSType);
804 RHS = S.ImpCastExprToType(RHS.take(), LHSType, CK_FloatingCast);
805 return LHSType;
815 LHSType, RHSType,
819 return handleIntToFloatConversion(S, RHS, LHS, RHSType, LHSType,
829 ExprResult &RHS, QualType LHSType,
832 const ComplexType *LHSComplexInt = LHSType->getAsComplexIntegerType();
841 RHS = S.ImpCastExprToType(RHS.take(), LHSType, CK_IntegralComplexCast);
842 return LHSType;
855 RHS = S.ImpCastExprToType(RHS.take(), LHSType, CK_IntegralRealToComplex);
856 return LHSType;
873 ExprResult &RHS, QualType LHSType,
876 int order = S.Context.getIntegerTypeOrder(LHSType, RHSType);
877 bool LHSSigned = LHSType->hasSignedIntegerRepresentation();
882 RHS = S.ImpCastExprToType(RHS.take(), LHSType, CK_IntegralCast);
883 return LHSType;
891 RHS = S.ImpCastExprToType(RHS.take(), LHSType, CK_IntegralCast);
892 return LHSType;
896 } else if (S.Context.getIntWidth(LHSType) != S.Context.getIntWidth(RHSType)) {
901 RHS = S.ImpCastExprToType(RHS.take(), LHSType, CK_IntegralCast);
902 return LHSType;
912 S.Context.getCorrespondingUnsignedType(LHSSigned ? LHSType : RHSType);
940 QualType LHSType =
946 if (LHSType == RHSType)
947 return LHSType;
951 if (!LHSType->isArithmeticType() || !RHSType->isArithmeticType())
952 return LHSType;
955 QualType LHSUnpromotedType = LHSType;
956 if (LHSType->isPromotableIntegerType())
957 LHSType = Context.getPromotedIntegerType(LHSType);
960 LHSType = LHSBitfieldPromoteTy;
961 if (LHSType != LHSUnpromotedType && !IsCompAssign)
962 LHS = ImpCastExprToType(LHS.take(), LHSType, CK_IntegralCast);
965 if (LHSType == RHSType)
966 return LHSType;
971 if (LHSType->isComplexType() || RHSType->isComplexType())
972 return handleComplexFloatConversion(*this, LHS, RHS, LHSType, RHSType,
976 if (LHSType->isRealFloatingType() || RHSType->isRealFloatingType())
977 return handleFloatConversion(*this, LHS, RHS, LHSType, RHSType,
981 if (LHSType->isComplexIntegerType() || RHSType->isComplexIntegerType())
982 return handleComplexIntConversion(*this, LHS, RHS, LHSType, RHSType,
986 return handleIntegerConversion(*this, LHS, RHS, LHSType, RHSType,
5150 checkPointerTypesForAssignment(Sema &S, QualType LHSType, QualType RHSType) {
5151 assert(LHSType.isCanonical() && "LHS not canonicalized!");
5157 llvm::tie(lhptee, lhq) = cast<PointerType>(LHSType)->getPointeeType().split();
5273 checkBlockPointerTypesForAssignment(Sema &S, QualType LHSType,
5275 assert(LHSType.isCanonical() && "LHS not canonicalized!");
5281 lhptee = cast<BlockPointerType>(LHSType)->getPointeeType();
5294 if (!S.Context.typesAreBlockPointerCompatible(LHSType, RHSType))
5303 checkObjCPointerTypesForAssignment(Sema &S, QualType LHSType,
5305 assert(LHSType.isCanonical() && "LHS was not canonicalized!");
5308 if (LHSType->isObjCBuiltinType()) {
5310 if (LHSType->isObjCClassType() && !RHSType->isObjCBuiltinType() &&
5316 if (RHSType->isObjCClassType() && !LHSType->isObjCBuiltinType() &&
5317 !LHSType->isObjCQualifiedClassType())
5321 QualType lhptee = LHSType->getAs<ObjCObjectPointerType>()->getPointeeType();
5326 !LHSType->isObjCQualifiedIdType())
5329 if (S.Context.typesAreCompatible(LHSType, RHSType))
5331 if (LHSType->isObjCQualifiedIdType() || RHSType->isObjCQualifiedIdType())
5338 QualType LHSType, QualType RHSType) {
5347 return CheckAssignmentConstraints(LHSType, RHSPtr, K);
5368 Sema::CheckAssignmentConstraints(QualType LHSType, ExprResult &RHS,
5371 QualType OrigLHSType = LHSType;
5375 LHSType = Context.getCanonicalType(LHSType).getUnqualifiedType();
5380 if (LHSType == RHSType) {
5385 if (const AtomicType *AtomicTy = dyn_cast<AtomicType>(LHSType)) {
5393 if (AtomicTy->getValueType() == LHSType) {
5405 // LHSType so that the resulting expression does not have reference
5407 if (const ReferenceType *LHSTypeRef = LHSType->getAs<ReferenceType>()) {
5417 if (LHSType->isExtVectorType()) {
5423 QualType elType = cast<ExtVectorType>(LHSType)->getElementType();
5434 if (LHSType->isVectorType() || RHSType->isVectorType()) {
5435 if (LHSType->isVectorType() && RHSType->isVectorType()) {
5438 if (Context.areCompatibleVectorTypes(LHSType, RHSType)) {
5447 (Context.getTypeSize(LHSType) == Context.getTypeSize(RHSType))) {
5456 if (LHSType->isArithmeticType() && RHSType->isArithmeticType() &&
5457 !(getLangOpts().CPlusPlus && LHSType->isEnumeralType())) {
5458 Kind = PrepareScalarCast(RHS, LHSType);
5463 if (const PointerType *LHSPointer = dyn_cast<PointerType>(LHSType)) {
5467 return checkPointerTypesForAssignment(*this, LHSType, RHSType);
5487 Context.hasSameType(LHSType,
5509 if (isa<BlockPointerType>(LHSType)) {
5513 return checkBlockPointerTypesForAssignment(*this, LHSType, RHSType);
5539 if (isa<ObjCObjectPointerType>(LHSType)) {
5544 checkObjCPointerTypesForAssignment(*this, LHSType, RHSType);
5569 if (LHSType->isObjCClassType() &&
5591 if (LHSType == Context.BoolTy) {
5597 if (LHSType->isIntegerType()) {
5608 if (LHSType == Context.BoolTy) {
5614 if (LHSType->isIntegerType()) {
5623 if (isa<TagType>(LHSType) && isa<TagType>(RHSType)) {
5624 if (Context.typesAreCompatible(LHSType, RHSType)) {
5710 Sema::CheckSingleAssignmentConstraints(QualType LHSType, ExprResult &RHS,
5713 if (!LHSType->isRecordType() && !LHSType->isAtomicType()) {
5719 Res = PerformImplicitConversion(RHS.get(), LHSType.getUnqualifiedType(),
5723 TryImplicitConversion(RHS.get(), LHSType.getUnqualifiedType(),
5731 Res = PerformImplicitConversion(RHS.get(), LHSType.getUnqualifiedType(),
5738 !CheckObjCARCUnavailableWeakConversion(LHSType,
5753 if ((LHSType->isPointerType() ||
5754 LHSType->isObjCObjectPointerType() ||
5755 LHSType->isBlockPointerType())
5758 RHS = ImpCastExprToType(RHS.take(), LHSType, CK_NullToPointer);
5768 if (!LHSType->isReferenceType()) {
5776 CheckAssignmentConstraints(LHSType, RHS, Kind);
5784 if (result != Incompatible && RHS.get()->getType() != LHSType)
5786 LHSType.getNonLValueExprType(Context), Kind);
5811 QualType LHSType =
5817 if (LHSType == RHSType)
5818 return LHSType;
5821 if (LHSType->isVectorType() && RHSType->isVectorType() &&
5822 Context.areCompatibleVectorTypes(LHSType, RHSType)) {
5823 if (LHSType->isExtVectorType()) {
5824 RHS = ImpCastExprToType(RHS.take(), LHSType, CK_BitCast);
5825 return LHSType;
5834 Context.getTypeSize(LHSType) == Context.getTypeSize(RHSType)) {
5839 RHS = ImpCastExprToType(RHS.take(), LHSType, CK_BitCast);
5840 return LHSType;
5849 std::swap(RHSType, LHSType);
5853 if (const ExtVectorType *LV = LHSType->getAs<ExtVectorType>()) {
5860 RHS = ImpCastExprToType(RHS.take(), LHSType, CK_VectorSplat);
5862 return LHSType;
5871 RHS = ImpCastExprToType(RHS.take(), LHSType, CK_VectorSplat);
5873 return LHSType;
6350 QualType LHSType) {
6381 LHSType->hasUnsignedIntegerRepresentation())
6401 << HexResult.str() << LHSType
6407 << HexResult.str() << Result.getMinSignedBits() << LHSType
6444 QualType LHSType = LHS.get()->getType();
6453 DiagnoseBadShiftValues(*this, LHS, RHS, Loc, Opc, LHSType);
6456 return LHSType;
6530 QualType LHSType = LHS.get()->getType();
6532 assert((LHSType->isPointerType() && RHSType->isPointerType()) ||
6533 (LHSType->isMemberPointerType() && RHSType->isMemberPointerType()));
6545 << LHSType << RHSType << T << LHS.get()->getSourceRange()
6576 QualType LHSType = LHS.get()->getType();
6584 if (!LHSType->hasFloatingRepresentation() &&
6585 !(LHSType->isBlockPointerType() && IsRelational) &&
6607 } else if (LHSType->isArrayType() && RHSType->isArrayType() &&
6689 LHSType = LHS.get()->getType();
6696 if (LHSType->isRealType() && RHSType->isRealType())
6700 if (LHSType->hasFloatingRepresentation())
6703 if (LHSType->isArithmeticType() && RHSType->isArithmeticType())
6714 if (LHSType->isPointerType() && RHSType->isPointerType()) { // C99 6.5.8p2
6716 LHSType->castAs<PointerType>()->getPointeeType().getCanonicalType();
6737 RHS = ImpCastExprToType(RHS.take(), LHSType, CK_BitCast);
6753 << LHSType << RHSType << LHS.get()->getSourceRange()
6771 RHS = ImpCastExprToType(RHS.take(), LHSType, CK_BitCast);
6778 if (LHSType->isNullPtrType() && RHSType->isNullPtrType())
6784 ((LHSType->isAnyPointerType() || LHSType->isNullPtrType()) ||
6786 (LHSType->isMemberPointerType() || LHSType->isBlockPointerType())))) {
6787 RHS = ImpCastExprToType(RHS.take(), LHSType,
6788 LHSType->isMemberPointerType()
6806 LHSType->isMemberPointerType() && RHSType->isMemberPointerType()) {
6822 if (!IsRelational && LHSType->isBlockPointerType() &&
6824 QualType lpointee = LHSType->castAs<BlockPointerType>()->getPointeeType();
6830 << LHSType << RHSType << LHS.get()->getSourceRange()
6833 RHS = ImpCastExprToType(RHS.take(), LHSType, CK_BitCast);
6839 && ((LHSType->isBlockPointerType() && RHSType->isPointerType())
6840 || (LHSType->isPointerType() && RHSType->isBlockPointerType()))) {
6844 || (LHSType->isPointerType() && LHSType->castAs<PointerType>()
6847 << LHSType << RHSType << LHS.get()->getSourceRange()
6855 RHS = ImpCastExprToType(RHS.take(), LHSType,
6856 LHSType->isPointerType() ? CK_BitCast
6861 if (LHSType->isObjCObjectPointerType() ||
6863 const PointerType *LPT = LHSType->getAs<PointerType>();
6870 !Context.typesAreCompatible(LHSType, RHSType)) {
6878 RHS = ImpCastExprToType(RHS.take(), LHSType,
6882 if (LHSType->isObjCObjectPointerType() &&
6884 if (!Context.areComparableObjCPointerTypes(LHSType, RHSType))
6890 RHS = ImpCastExprToType(RHS.take(), LHSType, CK_BitCast);
6894 if ((LHSType->isAnyPointerType() && RHSType->isIntegerType()) ||
6895 (LHSType->isIntegerType() && RHSType->isAnyPointerType())) {
6898 if ((LHSIsNull && LHSType->isIntegerType()) ||
6912 << LHSType << RHSType << LHS.get()->getSourceRange()
6918 if (LHSType->isIntegerType())
6922 RHS = ImpCastExprToType(RHS.take(), LHSType,
6929 && LHSType->isBlockPointerType() && RHSType->isIntegerType()) {
6930 RHS = ImpCastExprToType(RHS.take(), LHSType, CK_NullToPointer);
6934 && LHSType->isIntegerType() && RHSType->isBlockPointerType()) {
6975 QualType LHSType = LHS.get()->getType();
6985 if (!LHSType->hasFloatingRepresentation()) {
6999 if (!IsRelational && LHSType->hasFloatingRepresentation()) {
7005 return GetSignedVectorType(LHSType);
7312 QualType LHSType = LHSExpr->getType();
7317 QualType LHSTy(LHSType);
7323 ((Context.isObjCNSObjectType(LHSType) &&
7326 LHSType->isObjCObjectPointerType())))
7330 LHSType->isObjCObjectType())
7332 << LHSType;
7357 if (LHSType.getObjCLifetime() == Qualifiers::OCL_Strong)
7364 ConvTy = CheckAssignmentConstraints(Loc, LHSType, RHSType);
7367 if (DiagnoseAssignmentResult(ConvTy, Loc, LHSType, RHSType,
7381 ? LHSType : LHSType.getUnqualifiedType());