• Home
  • Raw
  • Download

Lines Matching refs:SrcExpr

52       : Self(S), SrcExpr(src), DestType(destType),  in CastOperation()
66 ExprResult SrcExpr; member
120 Self.CheckCastAlign(SrcExpr.get(), DestType, OpRange); in checkCastAlign()
126 Expr *src = SrcExpr.get(); in checkObjCARCConversion()
130 SrcExpr = src; in checkObjCARCConversion()
138 SrcExpr = Self.CheckPlaceholderExpr(SrcExpr.get()); in checkNonOverloadPlaceholders()
139 if (SrcExpr.isInvalid()) in checkNonOverloadPlaceholders()
157 static TryCastResult TryLValueToRValueCast(Sema &Self, Expr *SrcExpr,
162 static TryCastResult TryStaticReferenceDowncast(Sema &Self, Expr *SrcExpr,
181 static TryCastResult TryStaticMemberPointerUpcast(Sema &Self, ExprResult &SrcExpr,
189 static TryCastResult TryStaticImplicitCast(Sema &Self, ExprResult &SrcExpr,
195 static TryCastResult TryStaticCast(Sema &Self, ExprResult &SrcExpr,
202 static TryCastResult TryConstCast(Sema &Self, ExprResult &SrcExpr,
205 static TryCastResult TryReinterpretCast(Sema &Self, ExprResult &SrcExpr,
257 if (Op.SrcExpr.isInvalid()) in BuildCXXNamedCast()
261 Op.ValueKind, Op.SrcExpr.get(), DestTInfo, in BuildCXXNamedCast()
268 if (Op.SrcExpr.isInvalid()) in BuildCXXNamedCast()
272 Op.ValueKind, Op.Kind, Op.SrcExpr.get(), in BuildCXXNamedCast()
280 if (Op.SrcExpr.isInvalid()) in BuildCXXNamedCast()
284 Op.ValueKind, Op.Kind, Op.SrcExpr.get(), in BuildCXXNamedCast()
292 if (Op.SrcExpr.isInvalid()) in BuildCXXNamedCast()
297 Op.ValueKind, Op.Kind, Op.SrcExpr.get(), in BuildCXXNamedCast()
576 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckDynamicCast()
578 SrcExpr = Self.CheckPlaceholderExpr(SrcExpr.get()); in CheckDynamicCast()
579 if (SrcExpr.isInvalid()) // if conversion failed, don't report another error in CheckDynamicCast()
582 QualType OrigSrcType = SrcExpr.get()->getType(); in CheckDynamicCast()
598 SrcExpr = ExprError(); in CheckDynamicCast()
609 SrcExpr = ExprError(); in CheckDynamicCast()
615 SrcExpr = ExprError(); in CheckDynamicCast()
630 << OrigSrcType << SrcExpr.get()->getSourceRange(); in CheckDynamicCast()
631 SrcExpr = ExprError(); in CheckDynamicCast()
635 if (!SrcExpr.get()->isLValue()) { in CheckDynamicCast()
643 if (SrcExpr.get()->isRValue()) in CheckDynamicCast()
644 SrcExpr = Self.CreateMaterializeTemporaryExpr( in CheckDynamicCast()
645 SrcType, SrcExpr.get(), /*IsLValueReference*/ false); in CheckDynamicCast()
653 SrcExpr.get())) { in CheckDynamicCast()
654 SrcExpr = ExprError(); in CheckDynamicCast()
659 << SrcPointee.getUnqualifiedType() << SrcExpr.get()->getSourceRange(); in CheckDynamicCast()
660 SrcExpr = ExprError(); in CheckDynamicCast()
674 SrcExpr = ExprError(); in CheckDynamicCast()
692 SrcExpr = ExprError(); in CheckDynamicCast()
705 << SrcPointee.getUnqualifiedType() << SrcExpr.get()->getSourceRange(); in CheckDynamicCast()
706 SrcExpr = ExprError(); in CheckDynamicCast()
714 SrcExpr = ExprError(); in CheckDynamicCast()
729 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckConstCast()
731 SrcExpr = Self.CheckPlaceholderExpr(SrcExpr.get()); in CheckConstCast()
732 if (SrcExpr.isInvalid()) // if conversion failed, don't report another error in CheckConstCast()
736 if (TryConstCast(Self, SrcExpr, DestType, /*CStyle*/false, msg) != TC_Success in CheckConstCast()
739 << SrcExpr.get()->getType() << DestType << OpRange; in CheckConstCast()
740 SrcExpr = ExprError(); in CheckConstCast()
746 static void DiagnoseReinterpretUpDownCast(Sema &Self, const Expr *SrcExpr, in DiagnoseReinterpretUpDownCast() argument
749 QualType SrcType = SrcExpr->getType(); in DiagnoseReinterpretUpDownCast()
844 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckReinterpretCast()
847 if (SrcExpr.isInvalid()) // if conversion failed, don't report another error in CheckReinterpretCast()
852 TryReinterpretCast(Self, SrcExpr, DestType, in CheckReinterpretCast()
856 if (SrcExpr.isInvalid()) // if conversion failed, don't report another error in CheckReinterpretCast()
858 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) { in CheckReinterpretCast()
861 << OverloadExpr::find(SrcExpr.get()).Expression->getName() in CheckReinterpretCast()
863 Self.NoteAllOverloadCandidates(SrcExpr.get()); in CheckReinterpretCast()
866 diagnoseBadCast(Self, msg, CT_Reinterpret, OpRange, SrcExpr.get(), in CheckReinterpretCast()
869 SrcExpr = ExprError(); in CheckReinterpretCast()
873 DiagnoseReinterpretUpDownCast(Self, SrcExpr.get(), DestType, OpRange); in CheckReinterpretCast()
884 if (SrcExpr.isInvalid()) in CheckStaticCast()
895 Self.ResolveAndFixSingleFunctionTemplateSpecialization(SrcExpr, in CheckStaticCast()
899 if (SrcExpr.isInvalid()) in CheckStaticCast()
903 SrcExpr = Self.IgnoredValueConversions(SrcExpr.get()); in CheckStaticCast()
909 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckStaticCast()
910 if (SrcExpr.isInvalid()) // if conversion failed, don't report another error in CheckStaticCast()
916 = TryStaticCast(Self, SrcExpr, DestType, Sema::CCK_OtherCast, OpRange, msg, in CheckStaticCast()
919 if (SrcExpr.isInvalid()) in CheckStaticCast()
921 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) { in CheckStaticCast()
922 OverloadExpr* oe = OverloadExpr::find(SrcExpr.get()).Expression; in CheckStaticCast()
926 Self.NoteAllOverloadCandidates(SrcExpr.get()); in CheckStaticCast()
928 diagnoseBadCast(Self, msg, CT_Static, OpRange, SrcExpr.get(), DestType, in CheckStaticCast()
931 SrcExpr = ExprError(); in CheckStaticCast()
945 static TryCastResult TryStaticCast(Sema &Self, ExprResult &SrcExpr, in TryStaticCast() argument
975 tcr = TryStaticReferenceDowncast(Self, SrcExpr.get(), DestType, CStyle, in TryStaticCast()
983 tcr = TryLValueToRValueCast(Self, SrcExpr.get(), DestType, CStyle, Kind, in TryStaticCast()
990 tcr = TryStaticImplicitCast(Self, SrcExpr, DestType, CCK, OpRange, msg, in TryStaticCast()
992 if (SrcExpr.isInvalid()) in TryStaticCast()
1005 QualType SrcType = Self.Context.getCanonicalType(SrcExpr.get()->getType()); in TryStaticCast()
1053 tcr = TryStaticMemberPointerUpcast(Self, SrcExpr, SrcType, DestType, CStyle, in TryStaticCast()
1118 Self.CheckTollFreeBridgeStaticCast(DestType, SrcExpr.get(), Kind)) in TryStaticCast()
1135 TryLValueToRValueCast(Sema &Self, Expr *SrcExpr, QualType DestType, in TryLValueToRValueCast() argument
1145 if (!SrcExpr->isGLValue()) in TryLValueToRValueCast()
1154 QualType FromType = SrcExpr->getType(); in TryLValueToRValueCast()
1161 if (Self.CompareReferenceRelationship(SrcExpr->getLocStart(), in TryLValueToRValueCast()
1176 if (!Self.IsDerivedFrom(SrcExpr->getLocStart(), SrcExpr->getType(), in TryLValueToRValueCast()
1189 TryStaticReferenceDowncast(Sema &Self, Expr *SrcExpr, QualType DestType, in TryStaticReferenceDowncast() argument
1207 if (!RValueRef && !SrcExpr->isLValue()) { in TryStaticReferenceDowncast()
1219 Self.Context.getCanonicalType(SrcExpr->getType()), in TryStaticReferenceDowncast()
1221 OpRange, SrcExpr->getType(), DestType, msg, Kind, in TryStaticReferenceDowncast()
1373 TryStaticMemberPointerUpcast(Sema &Self, ExprResult &SrcExpr, QualType SrcType, in TryStaticMemberPointerUpcast() argument
1384 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) { in TryStaticMemberPointerUpcast()
1386 = Self.ResolveAddressOfOverloadedFunction(SrcExpr.get(), DestType, false, in TryStaticMemberPointerUpcast()
1464 FunctionDecl *Fn = Self.ResolveAddressOfOverloadedFunction(SrcExpr.get(), in TryStaticMemberPointerUpcast()
1473 SrcExpr = Self.FixOverloadedFunctionReference(SrcExpr, FoundOverload, Fn); in TryStaticMemberPointerUpcast()
1474 if (!SrcExpr.isUsable()) { in TryStaticMemberPointerUpcast()
1491 TryStaticImplicitCast(Sema &Self, ExprResult &SrcExpr, QualType DestType, in TryStaticImplicitCast() argument
1513 Expr *SrcExprRaw = SrcExpr.get(); in TryStaticImplicitCast()
1537 SrcExpr = Result; in TryStaticImplicitCast()
1543 static TryCastResult TryConstCast(Sema &Self, ExprResult &SrcExpr, in TryConstCast() argument
1547 QualType SrcType = SrcExpr.get()->getType(); in TryConstCast()
1562 if (isa<LValueReferenceType>(DestTypeTmp) && !SrcExpr.get()->isLValue()) { in TryConstCast()
1570 if (isa<RValueReferenceType>(DestTypeTmp) && SrcExpr.get()->isRValue()) { in TryConstCast()
1588 if (SrcExpr.get()->refersToBitField()) { in TryConstCast()
1649 SrcExpr = Self.CreateMaterializeTemporaryExpr(SrcType, SrcExpr.get(), in TryConstCast()
1710 static void DiagnoseCastOfObjCSEL(Sema &Self, const ExprResult &SrcExpr, in DiagnoseCastOfObjCSEL() argument
1712 QualType SrcType = SrcExpr.get()->getType(); in DiagnoseCastOfObjCSEL()
1721 Self.Diag(SrcExpr.get()->getExprLoc(), in DiagnoseCastOfObjCSEL()
1723 << SrcType << DestType << SrcExpr.get()->getSourceRange(); in DiagnoseCastOfObjCSEL()
1729 static void DiagnoseCallingConvCast(Sema &Self, const ExprResult &SrcExpr, in DiagnoseCallingConvCast() argument
1733 QualType SrcType = SrcExpr.get()->getType(); in DiagnoseCallingConvCast()
1748 Expr *Src = SrcExpr.get()->IgnoreParenImpCasts(); in DiagnoseCallingConvCast()
1819 const Expr *SrcExpr, QualType DestType, in checkIntToPointerCast() argument
1821 QualType SrcType = SrcExpr->getType(); in checkIntToPointerCast()
1829 && !SrcExpr->isIntegerConstantExpr(Self.Context) in checkIntToPointerCast()
1870 static TryCastResult TryReinterpretCast(Sema &Self, ExprResult &SrcExpr, in TryReinterpretCast() argument
1878 QualType SrcType = SrcExpr.get()->getType(); in TryReinterpretCast()
1883 ExprResult FixedExpr = SrcExpr; in TryReinterpretCast()
1888 SrcExpr = FixedExpr; in TryReinterpretCast()
1889 SrcType = SrcExpr.get()->getType(); in TryReinterpretCast()
1893 if (!SrcExpr.get()->isGLValue()) { in TryReinterpretCast()
1910 switch (SrcExpr.get()->getObjectKind()) { in TryReinterpretCast()
1922 << OpRange << SrcExpr.get()->getSourceRange(); in TryReinterpretCast()
1923 msg = 0; SrcExpr = ExprError(); in TryReinterpretCast()
2072 checkIntToPointerCast(CStyle, OpRange.getBegin(), SrcExpr.get(), DestType, in TryReinterpretCast()
2104 Kind = Self.PrepareCastToObjCObjectPointer(SrcExpr); in TryReinterpretCast()
2121 DiagnoseCastOfObjCSEL(Self, SrcExpr, DestType); in TryReinterpretCast()
2123 DiagnoseCallingConvCast(Self, SrcExpr, DestType, OpRange); in TryReinterpretCast()
2171 SrcExpr = Self.checkUnknownAnyCast(DestRange, DestType, in CheckCXXCStyleCast()
2172 SrcExpr.get(), Kind, in CheckCXXCStyleCast()
2178 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2190 SrcExpr, /* Decay Function to ptr */ false, in CheckCXXCStyleCast()
2193 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2197 SrcExpr = Self.IgnoredValueConversions(SrcExpr.get()); in CheckCXXCStyleCast()
2202 if (DestType->isDependentType() || SrcExpr.get()->isTypeDependent() || in CheckCXXCStyleCast()
2203 SrcExpr.get()->isValueDependent()) { in CheckCXXCStyleCast()
2210 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckCXXCStyleCast()
2211 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2218 && (SrcExpr.get()->getType()->isIntegerType() in CheckCXXCStyleCast()
2219 || SrcExpr.get()->getType()->isFloatingType())) { in CheckCXXCStyleCast()
2221 SrcExpr = Self.prepareVectorSplat(DestType, SrcExpr.get()); in CheckCXXCStyleCast()
2237 TryCastResult tcr = TryConstCast(Self, SrcExpr, DestType, in CheckCXXCStyleCast()
2239 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2249 tcr = TryStaticCast(Self, SrcExpr, DestType, CCK, OpRange, in CheckCXXCStyleCast()
2251 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2256 tcr = TryReinterpretCast(Self, SrcExpr, DestType, /*CStyle*/true, in CheckCXXCStyleCast()
2258 if (SrcExpr.isInvalid()) in CheckCXXCStyleCast()
2267 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) { in CheckCXXCStyleCast()
2269 FunctionDecl *Fn = Self.ResolveAddressOfOverloadedFunction(SrcExpr.get(), in CheckCXXCStyleCast()
2277 OverloadExpr *OE = OverloadExpr::find(SrcExpr.get()).Expression; in CheckCXXCStyleCast()
2281 Self.NoteAllOverloadCandidates(SrcExpr.get()); in CheckCXXCStyleCast()
2285 OpRange, SrcExpr.get(), DestType, ListInitialization); in CheckCXXCStyleCast()
2293 SrcExpr = ExprError(); in CheckCXXCStyleCast()
2299 static void DiagnoseBadFunctionCast(Sema &Self, const ExprResult &SrcExpr, in DiagnoseBadFunctionCast() argument
2302 SrcExpr.get()->getExprLoc())) in DiagnoseBadFunctionCast()
2305 if (!isa<CallExpr>(SrcExpr.get())) in DiagnoseBadFunctionCast()
2308 QualType SrcType = SrcExpr.get()->getType(); in DiagnoseBadFunctionCast()
2327 Self.Diag(SrcExpr.get()->getExprLoc(), in DiagnoseBadFunctionCast()
2329 << SrcType << DestType << SrcExpr.get()->getSourceRange(); in DiagnoseBadFunctionCast()
2338 SrcExpr = Self.checkUnknownAnyCast(DestRange, DestType, in CheckCStyleCast()
2339 SrcExpr.get(), Kind, in CheckCStyleCast()
2348 SrcExpr = Self.IgnoredValueConversions(SrcExpr.get()); in CheckCStyleCast()
2349 if (SrcExpr.isInvalid()) in CheckCStyleCast()
2358 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) { in CheckCStyleCast()
2361 SrcExpr.get(), DestType, /*Complain=*/true, DAP)) in CheckCStyleCast()
2362 SrcExpr = Self.FixOverloadedFunctionReference(SrcExpr.get(), DAP, FD); in CheckCStyleCast()
2365 assert(SrcExpr.isUsable()); in CheckCStyleCast()
2367 SrcExpr = Self.DefaultFunctionArrayLvalueConversion(SrcExpr.get()); in CheckCStyleCast()
2368 if (SrcExpr.isInvalid()) in CheckCStyleCast()
2370 QualType SrcType = SrcExpr.get()->getType(); in CheckCStyleCast()
2383 << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2384 SrcExpr = ExprError(); in CheckCStyleCast()
2391 SrcExpr = ExprError(); in CheckCStyleCast()
2401 << DestType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2415 << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2421 << SrcType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2422 SrcExpr = ExprError(); in CheckCStyleCast()
2432 if (SrcExpr.get()->EvaluateAsInt(CastInt, Self.Context)) { in CheckCStyleCast()
2439 << CastInt.toString(10) << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2440 SrcExpr = ExprError(); in CheckCStyleCast()
2447 << DestType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2448 SrcExpr = ExprError(); in CheckCStyleCast()
2456 Self.Diag(SrcExpr.get()->getExprLoc(), in CheckCStyleCast()
2458 << SrcType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2459 SrcExpr = ExprError(); in CheckCStyleCast()
2464 SrcExpr = Self.CheckExtVectorCast(OpRange, DestType, SrcExpr.get(), Kind); in CheckCStyleCast()
2472 SrcExpr = Self.prepareVectorSplat(DestType, SrcExpr.get()); in CheckCStyleCast()
2474 SrcExpr = ExprError(); in CheckCStyleCast()
2481 SrcExpr = ExprError(); in CheckCStyleCast()
2490 if (isa<ObjCSelectorExpr>(SrcExpr.get())) { in CheckCStyleCast()
2491 Self.Diag(SrcExpr.get()->getExprLoc(), diag::err_cast_selector_expr); in CheckCStyleCast()
2492 SrcExpr = ExprError(); in CheckCStyleCast()
2500 Self.Diag(SrcExpr.get()->getExprLoc(), in CheckCStyleCast()
2502 << SrcType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2503 SrcExpr = ExprError(); in CheckCStyleCast()
2506 checkIntToPointerCast(/* CStyle */ true, OpRange.getBegin(), SrcExpr.get(), in CheckCStyleCast()
2511 Self.Diag(SrcExpr.get()->getLocStart(), in CheckCStyleCast()
2513 << DestType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2514 SrcExpr = ExprError(); in CheckCStyleCast()
2521 Self.Diag(SrcExpr.get()->getLocStart(), diag::err_opencl_cast_to_half) in CheckCStyleCast()
2522 << DestType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2523 SrcExpr = ExprError(); in CheckCStyleCast()
2531 if (SrcExpr.isInvalid()) in CheckCStyleCast()
2541 Self.Diag(SrcExpr.get()->getLocStart(), in CheckCStyleCast()
2544 << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2550 Self.Diag(SrcExpr.get()->getLocStart(), in CheckCStyleCast()
2552 << 1 << SrcType << DestType << SrcExpr.get()->getSourceRange(); in CheckCStyleCast()
2553 SrcExpr = ExprError(); in CheckCStyleCast()
2558 DiagnoseCastOfObjCSEL(Self, SrcExpr, DestType); in CheckCStyleCast()
2559 DiagnoseCallingConvCast(Self, SrcExpr, DestType, OpRange); in CheckCStyleCast()
2560 DiagnoseBadFunctionCast(Self, SrcExpr, DestType); in CheckCStyleCast()
2561 Kind = Self.PrepareScalarCast(SrcExpr, DestType); in CheckCStyleCast()
2562 if (SrcExpr.isInvalid()) in CheckCStyleCast()
2585 Self.Diag(SrcExpr.get()->getLocStart(), diag::warn_cast_qual2) << in CheckCStyleCast()
2588 Self.Diag(SrcExpr.get()->getLocStart(), diag::warn_cast_qual) << in CheckCStyleCast()
2608 if (Op.SrcExpr.isInvalid()) in BuildCStyleCastExpr()
2612 Op.ValueKind, Op.Kind, Op.SrcExpr.get(), in BuildCStyleCastExpr()
2626 if (Op.SrcExpr.isInvalid()) in BuildCXXFunctionalCastExpr()
2629 auto *SubExpr = Op.SrcExpr.get(); in BuildCXXFunctionalCastExpr()
2637 Op.SrcExpr.get(), &Op.BasePath, LPLoc, RPLoc)); in BuildCXXFunctionalCastExpr()