reference, declaration → definition definition → references, declarations, derived classes, virtual overrides reference to multiple definitions → definitions unreferenced |
238 : CGF(cgf), Builder(CGF.Builder), IgnoreResultAssign(ira), 252 llvm::Type *ConvertType(QualType T) { return CGF.ConvertType(T); } 253 LValue EmitLValue(const Expr *E) { return CGF.EmitLValue(E); } 255 return CGF.EmitCheckedLValue(E, TCK); 262 return CGF.EmitLoadOfLValue(LV, Loc).getScalarVal(); 280 if (isa<ParmVarDecl>(VD) && !CGF.SanOpts.has(SanitizerKind::Alignment)) 295 Value *AlignmentValue = CGF.EmitScalarExpr(AVAttr->getAlignment()); 297 CGF.EmitAlignmentAssumption(V, E, AVAttr->getLocation(), AlignmentCI); 393 Value *Zero = CGF.CGM.getNullPointer(cast<llvm::PointerType>(V->getType()), QT); 422 ApplyDebugLocation DL(CGF, E); 427 S->dump(CGF.getContext().getSourceManager()); 445 return CGF.EmitCoawaitExpr(*S).getScalarVal(); 448 return CGF.EmitCoyieldExpr(*S).getScalarVal(); 482 llvm::Value *V = CGF.GetAddrOfLabel(E->getLabel()); 491 return CGF.EmitPseudoObjectRValue(E).getScalarVal(); 496 return EmitLoadOfLValue(CGF.getOrCreateOpaqueLValueMapping(E), 500 return CGF.getOrCreateOpaqueRValueMapping(E).getScalarVal(); 505 if (CodeGenFunction::ConstantEmission Constant = CGF.tryEmitAsConstant(E)) 506 return CGF.emitScalarConstant(Constant, E); 511 return CGF.EmitObjCSelectorExpr(E); 514 return CGF.EmitObjCProtocolExpr(E); 523 return CGF.EmitObjCMessageExpr(E).getScalarVal(); 527 LValue LV = CGF.EmitObjCIsaExpr(E); 528 Value *V = CGF.EmitLoadOfLValue(LV, E->getExprLoc()).getScalarVal(); 537 if (Version <= CGF.CGM.getTarget().getPlatformMinVersion()) 542 llvm::ConstantInt::get(CGF.CGM.Int32Ty, Version.getMajor()), 543 llvm::ConstantInt::get(CGF.CGM.Int32Ty, Min ? *Min : 0), 544 llvm::ConstantInt::get(CGF.CGM.Int32Ty, SMin ? *SMin : 0), 547 return CGF.EmitBuiltinAvailable(Args); 562 assert(CGF.getArrayInitIndex() && 564 return CGF.getArrayInitIndex(); 571 CGF.CGM.EmitExplicitCastExprType(E, &CGF); 571 CGF.CGM.EmitExplicitCastExprType(E, &CGF); 577 if (E->getCallReturnType(CGF.getContext())->isReferenceType()) 580 Value *V = CGF.EmitCallExpr(E).getScalarVal(); 616 return CGF.CGM.getMemberPointerConstant(E); 644 auto &Ctx = CGF.getContext(); 646 SLE->EvaluateInContext(Ctx, CGF.CurSourceLocExprScope.getDefaultExpr()); 647 return ConstantEmitter(CGF.CGM, &CGF) 647 return ConstantEmitter(CGF.CGM, &CGF) 652 CodeGenFunction::CXXDefaultArgExprScope Scope(CGF, DAE); 656 CodeGenFunction::CXXDefaultInitExprScope Scope(CGF, DIE); 660 return CGF.LoadCXXThis(); 665 return CGF.EmitCXXNewExpr(E); 668 CGF.EmitCXXDeleteExpr(E); 694 CGF.EmitScalarExpr(E->getBase()); 703 CGF.EmitCXXThrowExpr(E); 714 switch (CGF.getLangOpts().getSignedOverflowBehavior()) { 718 if (!CGF.SanOpts.has(SanitizerKind::SignedIntegerOverflow)) 722 if (CanElideOverflowCheck(CGF.getContext(), Ops)) 729 CGF.SanOpts.has(SanitizerKind::UnsignedIntegerOverflow) && 730 !CanElideOverflowCheck(CGF.getContext(), Ops)) 830 return CGF.EmitObjCStringLiteral(E); 833 return CGF.EmitObjCBoxedExpr(E); 836 return CGF.EmitObjCArrayLiteral(E); 839 return CGF.EmitObjCDictionaryLiteral(E); 859 return CGF.CGM.getCXXABI().EmitMemberPointerIsNotNull(CGF, Src, MPT); 859 return CGF.CGM.getCXXABI().EmitMemberPointerIsNotNull(CGF, Src, MPT); 878 CodeGenFunction::SanitizerScope SanScope(&CGF); 884 CGF.getContext().getFloatTypeSemantics(OrigSrcType); 889 unsigned Width = CGF.getContext().getIntWidth(DstType); 920 CGF.getContext().getFloatTypeSemantics(SrcType); 932 llvm::Constant *StaticArgs[] = {CGF.EmitCheckSourceLocation(Loc), 933 CGF.EmitCheckTypeDescriptor(OrigSrcType), 934 CGF.EmitCheckTypeDescriptor(DstType)}; 935 CGF.EmitCheck(std::make_pair(Check, SanitizerKind::FloatCastOverflow), 982 if (!CGF.SanOpts.hasOneOf(SanitizerKind::ImplicitIntegerTruncation)) 1003 if (CGF.SanOpts.has(SanitizerKind::ImplicitIntegerSignChange) && 1007 CodeGenFunction::SanitizerScope SanScope(&CGF); 1016 if (!CGF.SanOpts.has(Check.second.second)) 1020 CGF.EmitCheckSourceLocation(Loc), CGF.EmitCheckTypeDescriptor(SrcType), 1020 CGF.EmitCheckSourceLocation(Loc), CGF.EmitCheckTypeDescriptor(SrcType), 1021 CGF.EmitCheckTypeDescriptor(DstType), 1023 CGF.EmitCheck(Check.second, SanitizerHandler::ImplicitConversion, StaticArgs, 1090 if (!CGF.SanOpts.has(SanitizerKind::ImplicitIntegerSignChange)) 1122 if (CGF.SanOpts.has(SanitizerKind::ImplicitSignedIntegerTruncation) && 1131 CodeGenFunction::SanitizerScope SanScope(&CGF); 1147 if (CGF.SanOpts.has(SanitizerKind::ImplicitSignedIntegerTruncation) && 1160 CGF.EmitCheckSourceLocation(Loc), CGF.EmitCheckTypeDescriptor(SrcType), 1160 CGF.EmitCheckSourceLocation(Loc), CGF.EmitCheckTypeDescriptor(SrcType), 1161 CGF.EmitCheckTypeDescriptor(DstType), 1164 CGF.EmitCheck(Checks, SanitizerHandler::ImplicitConversion, StaticArgs, 1206 SrcType = CGF.getContext().getCanonicalType(SrcType); 1207 DstType = CGF.getContext().getCanonicalType(DstType); 1223 if (SrcType->isHalfType() && !CGF.getContext().getLangOpts().NativeHalfType) { 1226 if (CGF.getContext().getTargetInfo().useFP16ConversionIntrinsics()) 1228 CGF.CGM.getIntrinsic(llvm::Intrinsic::convert_from_fp16, DstTy), 1234 if (CGF.getContext().getTargetInfo().useFP16ConversionIntrinsics()) { 1236 CGF.CGM.getIntrinsic(llvm::Intrinsic::convert_from_fp16, 1237 CGF.CGM.FloatTy), 1240 Src = Builder.CreateFPExt(Src, CGF.CGM.FloatTy, "conv"); 1242 SrcType = CGF.getContext().FloatTy; 1243 SrcTy = CGF.FloatTy; 1267 llvm::Type *MiddleTy = CGF.CGM.getDataLayout().getIntPtrType(DstPT); 1340 if (CGF.SanOpts.has(SanitizerKind::FloatCastOverflow) && 1346 if (DstType->isHalfType() && !CGF.getContext().getLangOpts().NativeHalfType) { 1351 if (CGF.getContext().getTargetInfo().useFP16ConversionIntrinsics()) 1353 CGF.CGM.getIntrinsic(llvm::Intrinsic::convert_to_fp16, SrcTy), Src); 1357 DstTy = CGF.FloatTy; 1387 if (CGF.getContext().getTargetInfo().useFP16ConversionIntrinsics()) { 1390 CGF.CGM.getIntrinsic(llvm::Intrinsic::convert_to_fp16, CGF.CGM.FloatTy), 1390 CGF.CGM.getIntrinsic(llvm::Intrinsic::convert_to_fp16, CGF.CGM.FloatTy), 1412 CGF.getContext().getFixedPointSemantics(SrcTy); 1414 CGF.getContext().getFixedPointSemantics(DstTy); 1447 CGF.getLLVMContext(), APInt::getLowBitsSet(ResultWidth, SrcScale)); 1478 CGF.getLLVMContext(), 1488 CGF.getLLVMContext(), 1525 return CGF.EmitFromMemory(CGF.CGM.EmitNullConstant(Ty), Ty); 1525 return CGF.EmitFromMemory(CGF.CGM.EmitNullConstant(Ty), Ty); 1534 assert(CGF.IsSanitizerScope); 1543 StaticData.push_back(CGF.EmitCheckSourceLocation(Info.E->getExprLoc())); 1547 StaticData.push_back(CGF.EmitCheckTypeDescriptor(UO->getType())); 1555 CGF.EmitCheckTypeDescriptor(BO->getLHS()->getType())); 1557 CGF.EmitCheckTypeDescriptor(BO->getRHS()->getType())); 1561 StaticData.push_back(CGF.EmitCheckTypeDescriptor(Info.Ty)); 1570 StaticData.push_back(CGF.EmitCheckTypeDescriptor(Info.Ty)); 1576 CGF.EmitCheck(Checks, Check, StaticData, DynamicData); 1584 CGF.ErrorUnsupported(E, "scalar expression"); 1587 return llvm::UndefValue::get(CGF.ConvertType(E->getType())); 1593 Value *LHS = CGF.EmitScalarExpr(E->getExpr(0)); 1594 Value *RHS = CGF.EmitScalarExpr(E->getExpr(1)); 1619 Value *IIndx = llvm::ConstantInt::get(CGF.SizeTy, i); 1628 Value* V1 = CGF.EmitScalarExpr(E->getExpr(0)); 1629 Value* V2 = CGF.EmitScalarExpr(E->getExpr(1)); 1633 llvm::APSInt Idx = E->getShuffleMaskIdx(CGF.getContext(), i-2); 1636 indices.push_back(llvm::UndefValue::get(CGF.Int32Ty)); 1649 Value *Src = CGF.EmitScalarExpr(E->getSrcExpr()); 1651 SrcType = CGF.getContext().getCanonicalType(SrcType); 1652 DstType = CGF.getContext().getCanonicalType(DstType); 1720 if (CodeGenFunction::ConstantEmission Constant = CGF.tryEmitAsConstant(E)) { 1721 CGF.EmitIgnoredExpr(E->getBase()); 1722 return CGF.emitScalarConstant(Constant, E); 1725 if (E->EvaluateAsInt(Result, CGF.getContext(), Expr::SE_AllowSideEffects)) { 1727 CGF.EmitIgnoredExpr(E->getBase()); 1751 if (CGF.SanOpts.has(SanitizerKind::ArrayBounds)) 1752 CGF.EmitBoundsCheck(E, E->getBase(), Idx, IdxTy, /*Accessed*/true); 1782 CGF.ErrorUnsupported(E, "GNU array range designator extension"); 1826 Args.push_back(getAsInt32(C, CGF.Int32Ty)); 1827 Args.resize(ResElts, llvm::UndefValue::get(CGF.Int32Ty)); 1836 Args.push_back(getMaskElt(SVV, j, 0, CGF.Int32Ty)); 1838 Args.resize(ResElts, llvm::UndefValue::get(CGF.Int32Ty)); 1876 CGF.Int32Ty)); 1882 Args.push_back(getMaskElt(SVI, j, Offset, CGF.Int32Ty)); 1883 Args.resize(ResElts, llvm::UndefValue::get(CGF.Int32Ty)); 1897 Args.resize(ResElts, llvm::UndefValue::get(CGF.Int32Ty)); 1907 Args.resize(ResElts, llvm::UndefValue::get(CGF.Int32Ty)); 1976 Addr = Builder.CreateElementBitCast(Addr, CGF.ConvertTypeForMem(DestTy)); 1977 LValue LV = CGF.MakeAddrLValue(Addr, DestTy); 1982 LValue SourceLVal = CGF.EmitLValue(E); 1984 CGF.ConvertTypeForMem(DestTy)); 1985 LValue DestLV = CGF.MakeAddrLValue(Addr, DestTy); 2003 if (CGF.SanOpts.has(SanitizerKind::CFIUnrelatedCast)) { 2005 CGF.EmitVTablePtrCheckForCast(PT->getPointeeType(), Src, 2011 if (CGF.CGM.getCodeGenOpts().StrictVTablePointers) { 2032 CGF.getDebugInfo()-> 2039 if (E->EvaluateAsRValue(Result, CGF.getContext()) && 2046 return CGF.CGM.getNullPointer(cast<llvm::PointerType>( 2051 return CGF.CGM.getTargetCodeGenInfo().performAddrSpaceCast( 2052 CGF, Visit(E), E->getType()->getPointeeType().getAddressSpace(), 2065 Address Base = CGF.EmitPointerWithAlignment(E); 2067 CGF.GetAddressOfDerivedClass(Base, DerivedClassDecl, 2069 CGF.ShouldNullCheckClassCastValue(CE)); 2073 if (CGF.sanitizePerformTypeCheck()) 2074 CGF.EmitTypeCheck(CodeGenFunction::TCK_DowncastPointer, CE->getExprLoc(), 2077 if (CGF.SanOpts.has(SanitizerKind::CFIDerivedCast)) 2078 CGF.EmitVTablePtrCheckForCast( 2089 return CGF.EmitPointerWithAlignment(CE).getPointer(); 2093 Address V = CGF.EmitPointerWithAlignment(E); 2095 return CGF.EmitDynamicCast(V, DCE); 2099 return CGF.EmitArrayToPointerDecay(E).getPointer(); 2105 CGF.EmitIgnoredExpr(E); 2107 return CGF.CGM.getNullPointer(cast<llvm::PointerType>(ConvertType(DestTy)), 2112 CGF.EmitIgnoredExpr(E); 2115 return CGF.CGM.getCXXABI().EmitNullMemberPointer(MPT); 2129 return CGF.CGM.getCXXABI().EmitMemberPointerConversion(CGF, CE, Src); 2129 return CGF.CGM.getCXXABI().EmitMemberPointerConversion(CGF, CE, Src); 2133 return CGF.EmitARCRetainScalarExpr(E); 2135 return CGF.EmitObjCConsumeObject(E->getType(), Visit(E)); 2137 return CGF.EmitARCReclaimReturnedObject(E, /*allowUnsafe*/ Ignored); 2139 return CGF.EmitARCExtendBlockObject(E); 2142 return CGF.EmitBlockCopyAndAutorelease(Visit(E), E->getType()); 2155 assert(CGF.getContext().hasSameUnqualifiedType(E->getType(), DestTy)); 2165 llvm::Type *MiddleTy = CGF.CGM.getDataLayout().getIntPtrType(DestLLVMTy); 2172 if (CGF.CGM.getCodeGenOpts().StrictVTablePointers) { 2184 if (CGF.CGM.getCodeGenOpts().StrictVTablePointers) { 2196 CGF.EmitIgnoredExpr(E); 2237 Opts = ScalarConversionOpts(CGF.SanOpts); 2262 return CGF.CGM.getCXXABI().EmitMemberPointerIsNotNull(CGF, MemPtr, MPT); 2262 return CGF.CGM.getCXXABI().EmitMemberPointerIsNotNull(CGF, MemPtr, MPT); 2267 return CGF.EmitComplexExpr(E, false, true).first; 2271 CodeGenFunction::ComplexPairTy V = CGF.EmitComplexExpr(E); 2286 return CGF.CGM.createOpenCLIntToSamplerConversion(E, CGF); 2286 return CGF.CGM.createOpenCLIntToSamplerConversion(E, CGF); 2294 CodeGenFunction::StmtExprEvaluation eval(CGF); 2295 Address RetAlloca = CGF.EmitCompoundStmt(*E->getSubStmt(), 2299 return CGF.EmitLoadOfScalar(CGF.MakeAddrLValue(RetAlloca, E->getType()), 2299 return CGF.EmitLoadOfScalar(CGF.MakeAddrLValue(RetAlloca, E->getType()), 2304 CGF.enterFullExpression(E); 2305 CodeGenFunction::RunCleanupsScope Scope(CGF); 2334 switch (CGF.getLangOpts().getSignedOverflowBehavior()) { 2338 if (!CGF.SanOpts.has(SanitizerKind::SignedIntegerOverflow)) 2364 llvm::Value *True = CGF.EmitToMemory(Builder.getTrue(), type); 2381 CGF.SanOpts.has(SanitizerKind::UnsignedIntegerOverflow)) && 2382 CGF.getLangOpts().getSignedOverflowBehavior() != 2388 llvm::Value *amt = CGF.EmitToMemory( 2398 llvm::BasicBlock *opBB = CGF.createBasicBlock("atomic_op", CGF.CurFn); 2398 llvm::BasicBlock *opBB = CGF.createBasicBlock("atomic_op", CGF.CurFn); 2399 value = CGF.EmitToMemory(value, type); 2427 CGF.SanOpts.has(SanitizerKind::UnsignedIntegerOverflow)) { 2441 = CGF.getContext().getAsVariableArrayType(type)) { 2442 llvm::Value *numElts = CGF.getVLASize(vla).NumElts; 2444 if (CGF.getLangOpts().isSignedOverflowDefined()) 2447 value = CGF.EmitCheckedInBoundsGEP( 2455 value = CGF.EmitCastToVoidPtr(value); 2456 if (CGF.getLangOpts().isSignedOverflowDefined()) 2459 value = CGF.EmitCheckedInBoundsGEP(value, amt, /*SignedIndices=*/false, 2467 if (CGF.getLangOpts().isSignedOverflowDefined()) 2470 value = CGF.EmitCheckedInBoundsGEP(value, amt, /*SignedIndices=*/false, 2493 if (type->isHalfType() && !CGF.getContext().getLangOpts().NativeHalfType) { 2495 if (CGF.getContext().getTargetInfo().useFP16ConversionIntrinsics()) { 2497 CGF.CGM.getIntrinsic(llvm::Intrinsic::convert_from_fp16, 2498 CGF.CGM.FloatTy), 2501 value = Builder.CreateFPExt(input, CGF.CGM.FloatTy, "incdec.conv"); 2519 FS = &CGF.getTarget().getFloat128Format(); 2521 FS = &CGF.getTarget().getHalfFormat(); 2523 FS = &CGF.getTarget().getLongDoubleFormat(); 2529 if (type->isHalfType() && !CGF.getContext().getLangOpts().NativeHalfType) { 2530 if (CGF.getContext().getTargetInfo().useFP16ConversionIntrinsics()) { 2532 CGF.CGM.getIntrinsic(llvm::Intrinsic::convert_to_fp16, 2533 CGF.CGM.FloatTy), 2543 value = CGF.EmitCastToVoidPtr(value); 2545 CharUnits size = CGF.getContext().getTypeSizeInChars(OPT->getObjectType()); 2548 llvm::ConstantInt::get(CGF.SizeTy, size.getQuantity()); 2550 if (CGF.getLangOpts().isSignedOverflowDefined()) 2553 value = CGF.EmitCheckedInBoundsGEP(value, sizeValue, 2561 llvm::BasicBlock *contBB = CGF.createBasicBlock("atomic_cont", CGF.CurFn); 2561 llvm::BasicBlock *contBB = CGF.createBasicBlock("atomic_cont", CGF.CurFn); 2562 auto Pair = CGF.EmitAtomicCompareExchange( 2564 llvm::Value *old = CGF.EmitToMemory(Pair.first.getScalarVal(), type); 2574 CGF.EmitStoreThroughBitfieldLValue(RValue::get(value), LV, &value); 2576 CGF.EmitStoreThroughLValue(RValue::get(value), LV); 2624 Value *BoolVal = CGF.EvaluateExprAsBool(E->getSubExpr()); 2638 if (E->EvaluateAsInt(EVResult, CGF.getContext())) { 2655 llvm::Value* Idx = CGF.EmitScalarExpr(IdxExpr); 2661 CGF.getContext().getAsArrayType(CurrentType)->getElementType(); 2665 CGF.getContext().getTypeSizeInChars(CurrentType).getQuantity()); 2675 const ASTRecordLayout &RL = CGF.getContext().getASTRecordLayout(RD); 2690 CGF.getContext().getCharWidth(); 2703 CGF.ErrorUnsupported(E, "virtual base in offsetof"); 2708 const ASTRecordLayout &RL = CGF.getContext().getASTRecordLayout(RD); 2734 CGF.getContext().getAsVariableArrayType(TypeToSize)) { 2737 CGF.EmitVariablyModifiedType(TypeToSize); 2741 CGF.EmitIgnoredExpr(E->getArgumentExpr()); 2744 auto VlaSize = CGF.getVLASize(VAT); 2748 CharUnits eltSize = CGF.getContext().getTypeSizeInChars(VlaSize.Type); 2750 size = CGF.Builder.CreateNUWMul(CGF.CGM.getSize(eltSize), size); 2750 size = CGF.Builder.CreateNUWMul(CGF.CGM.getSize(eltSize), size); 2756 CGF.getContext() 2757 .toCharUnitsFromBits(CGF.getContext().getOpenMPDefaultSimdAlign( 2760 return llvm::ConstantInt::get(CGF.SizeTy, Alignment); 2765 return Builder.getInt(E->EvaluateKnownConstInt(CGF.getContext())); 2775 return CGF.EmitLoadOfLValue(CGF.EmitLValue(E), 2775 return CGF.EmitLoadOfLValue(CGF.EmitLValue(E), 2779 return CGF.EmitComplexExpr(Op, false, true).first; 2792 return CGF.EmitLoadOfLValue(CGF.EmitLValue(E), 2792 return CGF.EmitLoadOfLValue(CGF.EmitLValue(E), 2796 return CGF.EmitComplexExpr(Op, true, false).second; 2802 CGF.EmitLValue(Op); 2804 CGF.EmitScalarExpr(Op, true); 2832 return CGF.EmitScalarCompoundAssignWithComplex(E, Result); 2849 CGF.SanOpts.has(SanitizerKind::UnsignedIntegerOverflow)) && 2850 CGF.getLangOpts().getSignedOverflowBehavior() != 2879 llvm::Value *amt = CGF.EmitToMemory( 2891 llvm::BasicBlock *opBB = CGF.createBasicBlock("atomic_op", CGF.CurFn); 2891 llvm::BasicBlock *opBB = CGF.createBasicBlock("atomic_op", CGF.CurFn); 2893 OpInfo.LHS = CGF.EmitToMemory(OpInfo.LHS, type); 2913 Loc, ScalarConversionOpts(CGF.SanOpts)); 2917 llvm::BasicBlock *contBB = CGF.createBasicBlock("atomic_cont", CGF.CurFn); 2917 llvm::BasicBlock *contBB = CGF.createBasicBlock("atomic_cont", CGF.CurFn); 2918 auto Pair = CGF.EmitAtomicCompareExchange( 2920 llvm::Value *old = CGF.EmitToMemory(Pair.first.getScalarVal(), LHSTy); 2933 CGF.EmitStoreThroughBitfieldLValue(RValue::get(Result), LHSLV, &Result); 2935 CGF.EmitStoreThroughLValue(RValue::get(Result), LHSLV); 2951 if (!CGF.getLangOpts().CPlusPlus) 2966 if (CGF.SanOpts.has(SanitizerKind::IntegerDivideByZero)) { 2972 if (CGF.SanOpts.has(SanitizerKind::SignedIntegerOverflow) && 2974 !IsWidenedIntegerOp(CGF.getContext(), BO->getLHS()) && 2995 CodeGenFunction::SanitizerScope SanScope(&CGF); 2996 if ((CGF.SanOpts.has(SanitizerKind::IntegerDivideByZero) || 2997 CGF.SanOpts.has(SanitizerKind::SignedIntegerOverflow)) && 3002 } else if (CGF.SanOpts.has(SanitizerKind::FloatDivideByZero) && 3014 if (CGF.getLangOpts().OpenCL && 3015 !CGF.CGM.getCodeGenOpts().CorrectlyRoundedDivSqrt) { 3025 CGF.SetFPAccuracy(Val, 2.5); 3037 if ((CGF.SanOpts.has(SanitizerKind::IntegerDivideByZero) || 3038 CGF.SanOpts.has(SanitizerKind::SignedIntegerOverflow)) && 3041 CodeGenFunction::SanitizerScope SanScope(&CGF); 3083 CodeGenFunction::SanitizerScope SanScope(&CGF); 3084 llvm::Type *opTy = CGF.CGM.getTypes().ConvertType(Ops.Ty); 3086 llvm::Function *intrinsic = CGF.CGM.getIntrinsic(IID, opTy); 3094 &CGF.getLangOpts().OverflowHandler; 3098 if (!isSigned || CGF.SanOpts.has(SanitizerKind::SignedIntegerOverflow)) { 3104 CGF.EmitTrapCheck(Builder.CreateNot(overflow)); 3111 CGF.createBasicBlock("nooverflow", CGF.CurFn, initialBB->getNextNode()); 3111 CGF.createBasicBlock("nooverflow", CGF.CurFn, initialBB->getNextNode()); 3112 llvm::BasicBlock *overflowBB = CGF.createBasicBlock("overflow", CGF.CurFn); 3112 llvm::BasicBlock *overflowBB = CGF.createBasicBlock("overflow", CGF.CurFn); 3121 llvm::Type *Int8Ty = CGF.Int8Ty; 3122 llvm::Type *argTypes[] = { CGF.Int64Ty, CGF.Int64Ty, Int8Ty, Int8Ty }; 3122 llvm::Type *argTypes[] = { CGF.Int64Ty, CGF.Int64Ty, Int8Ty, Int8Ty }; 3124 llvm::FunctionType::get(CGF.Int64Ty, argTypes, true); 3126 CGF.CGM.CreateRuntimeFunction(handlerTy, *handlerName); 3130 llvm::Value *lhs = Builder.CreateSExt(Ops.LHS, CGF.Int64Ty); 3131 llvm::Value *rhs = Builder.CreateSExt(Ops.RHS, CGF.Int64Ty); 3142 CGF.EmitNounwindRuntimeCall(handler, handlerArgs); 3343 return emitPointerArithmetic(CGF, op, CodeGenFunction::NotSubtraction); 3346 switch (CGF.getLangOpts().getSignedOverflowBehavior()) { 3350 if (!CGF.SanOpts.has(SanitizerKind::SignedIntegerOverflow)) 3354 if (CanElideOverflowCheck(CGF.getContext(), op)) 3361 CGF.SanOpts.has(SanitizerKind::UnsignedIntegerOverflow) && 3362 !CanElideOverflowCheck(CGF.getContext(), op)) 3367 if (Value *FMulAdd = tryEmitFMulAdd(op, CGF, Builder)) 3394 ASTContext &Ctx = CGF.getContext(); 3491 switch (CGF.getLangOpts().getSignedOverflowBehavior()) { 3495 if (!CGF.SanOpts.has(SanitizerKind::SignedIntegerOverflow)) 3499 if (CanElideOverflowCheck(CGF.getContext(), op)) 3506 CGF.SanOpts.has(SanitizerKind::UnsignedIntegerOverflow) && 3507 !CanElideOverflowCheck(CGF.getContext(), op)) 3512 if (Value *FMulAdd = tryEmitFMulAdd(op, CGF, Builder, true)) 3527 return emitPointerArithmetic(CGF, op, CodeGenFunction::IsSubtraction); 3533 = Builder.CreatePtrToInt(op.LHS, CGF.PtrDiffTy, "sub.ptr.lhs.cast"); 3535 = Builder.CreatePtrToInt(op.RHS, CGF.PtrDiffTy, "sub.ptr.rhs.cast"); 3546 = CGF.getContext().getAsVariableArrayType(elementType)) { 3547 auto VlaSize = CGF.getVLASize(vla); 3552 CharUnits eltSize = CGF.getContext().getTypeSizeInChars(elementType); 3554 divisor = CGF.Builder.CreateNUWMul(CGF.CGM.getSize(eltSize), divisor); 3554 divisor = CGF.Builder.CreateNUWMul(CGF.CGM.getSize(eltSize), divisor); 3566 elementSize = CGF.getContext().getTypeSizeInChars(elementType); 3572 divisor = CGF.CGM.getSize(elementSize); 3597 bool SanitizeBase = CGF.SanOpts.has(SanitizerKind::ShiftBase) && 3599 !CGF.getLangOpts().isSignedOverflowDefined() && 3600 !CGF.getLangOpts().CPlusPlus2a; 3601 bool SanitizeExponent = CGF.SanOpts.has(SanitizerKind::ShiftExponent); 3603 if (CGF.getLangOpts().OpenCL) 3608 CodeGenFunction::SanitizerScope SanScope(&CGF); 3623 llvm::BasicBlock *Cont = CGF.createBasicBlock("cont"); 3624 llvm::BasicBlock *CheckShiftBase = CGF.createBasicBlock("check"); 3629 CGF.EmitBlock(CheckShiftBase); 3634 if (CGF.getLangOpts().CPlusPlus) { 3644 CGF.EmitBlock(Cont); 3666 if (CGF.getLangOpts().OpenCL) 3669 else if (CGF.SanOpts.has(SanitizerKind::ShiftExponent) && 3671 CodeGenFunction::SanitizerScope SanScope(&CGF); 3736 Value *LHS = CGF.EmitScalarExpr(E->getLHS()); 3737 Value *RHS = CGF.EmitScalarExpr(E->getRHS()); 3738 Result = CGF.CGM.getCXXABI().EmitMemberPointerComparison( 3739 CGF, LHS, RHS, MPT, E->getOpcode() == BO_NE); 3805 llvm::Function *F = CGF.CGM.getIntrinsic(ID); 3815 E->getType() == CGF.getContext().BoolTy) 3817 return EmitScalarConversion(Result, CGF.getContext().BoolTy, E->getType(), 3830 if (CGF.CGM.getCodeGenOpts().StrictVTablePointers && 3859 LHS = CGF.EmitComplexExpr(E->getLHS()); 3867 RHS = CGF.EmitComplexExpr(E->getRHS()); 3868 assert(CGF.getContext().hasSameUnqualifiedType(CETy, 3875 assert(CGF.getContext().hasSameUnqualifiedType(CETy, RHSTy) && 3899 return EmitScalarConversion(Result, CGF.getContext().BoolTy, E->getType(), 3911 std::tie(LHS, RHS) = CGF.EmitARCStoreStrong(E, Ignore); 3915 std::tie(LHS, RHS) = CGF.EmitARCStoreAutoreleasing(E); 3919 std::tie(LHS, RHS) = CGF.EmitARCStoreUnsafeUnretained(E, Ignore); 3925 RHS = CGF.EmitARCStoreWeak(LHS.getAddress(), RHS, Ignore); 3939 CGF.EmitStoreThroughBitfieldLValue(RValue::get(RHS), LHS, &RHS); 3941 CGF.EmitNullabilityCheck(LHS, RHS, E->getExprLoc()); 3942 CGF.EmitStoreThroughLValue(RValue::get(RHS), LHS); 3951 if (!CGF.getLangOpts().CPlusPlus) 3965 CGF.incrementProfileCounter(E); 3986 if (CGF.ConstantFoldsToSimpleInteger(E->getLHS(), LHSCondVal)) { 3988 CGF.incrementProfileCounter(E); 3990 Value *RHSCond = CGF.EvaluateExprAsBool(E->getRHS()); 3996 if (!CGF.ContainsLabel(E->getRHS())) 4000 llvm::BasicBlock *ContBlock = CGF.createBasicBlock("land.end"); 4001 llvm::BasicBlock *RHSBlock = CGF.createBasicBlock("land.rhs"); 4003 CodeGenFunction::ConditionalEvaluation eval(CGF); 4006 CGF.EmitBranchOnBoolExpr(E->getLHS(), RHSBlock, ContBlock, 4007 CGF.getProfileCount(E->getRHS())); 4018 eval.begin(CGF); 4019 CGF.EmitBlock(RHSBlock); 4020 CGF.incrementProfileCounter(E); 4021 Value *RHSCond = CGF.EvaluateExprAsBool(E->getRHS()); 4022 eval.end(CGF); 4030 auto NL = ApplyDebugLocation::CreateEmpty(CGF); 4031 CGF.EmitBlock(ContBlock); 4038 auto NL = ApplyDebugLocation::CreateArtificial(CGF); 4049 CGF.incrementProfileCounter(E); 4070 if (CGF.ConstantFoldsToSimpleInteger(E->getLHS(), LHSCondVal)) { 4072 CGF.incrementProfileCounter(E); 4074 Value *RHSCond = CGF.EvaluateExprAsBool(E->getRHS()); 4080 if (!CGF.ContainsLabel(E->getRHS())) 4084 llvm::BasicBlock *ContBlock = CGF.createBasicBlock("lor.end"); 4085 llvm::BasicBlock *RHSBlock = CGF.createBasicBlock("lor.rhs"); 4087 CodeGenFunction::ConditionalEvaluation eval(CGF); 4090 CGF.EmitBranchOnBoolExpr(E->getLHS(), ContBlock, RHSBlock, 4091 CGF.getCurrentProfileCount() - 4092 CGF.getProfileCount(E->getRHS())); 4103 eval.begin(CGF); 4106 CGF.EmitBlock(RHSBlock); 4107 CGF.incrementProfileCounter(E); 4108 Value *RHSCond = CGF.EvaluateExprAsBool(E->getRHS()); 4110 eval.end(CGF); 4117 CGF.EmitBlock(ContBlock); 4125 CGF.EmitIgnoredExpr(E->getLHS()); 4126 CGF.EnsureInsertPoint(); 4157 CodeGenFunction::OpaqueValueMapping binding(CGF, E); 4166 if (CGF.ConstantFoldsToSimpleInteger(condExpr, CondExprBool)) { 4171 if (!CGF.ContainsLabel(dead)) { 4173 CGF.incrementProfileCounter(E); 4180 Result = llvm::UndefValue::get(CGF.ConvertType(E->getType())); 4188 if (CGF.getLangOpts().OpenCL 4190 CGF.incrementProfileCounter(E); 4192 llvm::Value *CondV = CGF.EmitScalarExpr(condExpr); 4233 if (isCheapEnoughToEvaluateUnconditionally(lhsExpr, CGF) && 4234 isCheapEnoughToEvaluateUnconditionally(rhsExpr, CGF)) { 4235 llvm::Value *CondV = CGF.EvaluateExprAsBool(condExpr); 4236 llvm::Value *StepV = Builder.CreateZExtOrBitCast(CondV, CGF.Int64Ty); 4238 CGF.incrementProfileCounter(E, StepV); 4250 llvm::BasicBlock *LHSBlock = CGF.createBasicBlock("cond.true"); 4251 llvm::BasicBlock *RHSBlock = CGF.createBasicBlock("cond.false"); 4252 llvm::BasicBlock *ContBlock = CGF.createBasicBlock("cond.end"); 4254 CodeGenFunction::ConditionalEvaluation eval(CGF); 4255 CGF.EmitBranchOnBoolExpr(condExpr, LHSBlock, RHSBlock, 4256 CGF.getProfileCount(lhsExpr)); 4258 CGF.EmitBlock(LHSBlock); 4259 CGF.incrementProfileCounter(E); 4260 eval.begin(CGF); 4262 eval.end(CGF); 4267 CGF.EmitBlock(RHSBlock); 4268 eval.begin(CGF); 4270 eval.end(CGF); 4273 CGF.EmitBlock(ContBlock); 4296 CGF.EmitVariablyModifiedType(Ty); 4299 Address ArgPtr = CGF.EmitVAArg(VE, ArgValue); 4305 CGF.ErrorUnsupported(VE, "va_arg expression"); 4324 return CGF.EmitBlockLiteral(block); 4388 Value *Src = CGF.EmitScalarExpr(E->getSrcExpr()); 4400 Src = ConvertVec3AndVec4(Builder, CGF, Src, 4); 4402 if (!CGF.CGM.getCodeGenOpts().PreserveVec3Type) { 4403 Src = createCastsForTypeOfSameSize(Builder, CGF.CGM.getDataLayout(), Src, 4415 if (!CGF.CGM.getCodeGenOpts().PreserveVec3Type) { 4417 Src = createCastsForTypeOfSameSize(Builder, CGF.CGM.getDataLayout(), Src, 4421 Src = ConvertVec3AndVec4(Builder, CGF, Src, 3); 4426 return createCastsForTypeOfSameSize(Builder, CGF.CGM.getDataLayout(), 4431 return CGF.EmitAtomicExpr(E).getScalarVal();