Lines Matching refs:CGM
54 CGM.getObjCRuntime().GenerateConstantString(E->getString()).getPointer(); in EmitObjCStringLiteral()
71 ConstantEmitter ConstEmitter(CGM); in EmitObjCBoxedExpr()
81 CGObjCRuntime &Runtime = CGM.getObjCRuntime(); in EmitObjCBoxedExpr()
104 llvm::Constant *GV = CGM.GetAddrOfConstantCString(Str).getPointer(); in EmitObjCBoxedExpr()
125 ASTContext &Context = CGM.getContext(); in EmitObjCCollectionLiteral()
134 if (NumElements == 0 && CGM.getLangOpts().ObjCRuntime.hasEmptyCollections()) { in EmitObjCCollectionLiteral()
136 QualType IdTy(CGM.getContext().getObjCIdType()); in EmitObjCCollectionLiteral()
138 CGM.CreateRuntimeVariable(ConvertType(IdTy), ConstantName); in EmitObjCCollectionLiteral()
166 CGM.getCodeGenOpts().OptimizationLevel != 0); in EmitObjCCollectionLiteral()
216 llvm::ConstantInt::get(CGM.getTypes().ConvertType(ArgQT), NumElements); in EmitObjCCollectionLiteral()
227 CGObjCRuntime &Runtime = CGM.getObjCRuntime(); in EmitObjCCollectionLiteral()
262 return CGM.getObjCRuntime().GetSelector(*this, E->getSelector()); in EmitObjCSelectorExpr()
267 return CGM.getObjCRuntime().GenerateProtocolRef(*this, E->getProtocol()); in EmitObjCProtocolExpr()
381 auto &CGM = CGF.CGM; in tryGenerateSpecializedMessageSend() local
382 if (!CGM.getCodeGenOpts().ObjCConvertMessagesToRuntimeCalls) in tryGenerateSpecializedMessageSend()
385 auto &Runtime = CGM.getLangOpts().ObjCRuntime; in tryGenerateSpecializedMessageSend()
411 CGM.getLangOpts().getGC() == LangOptions::NonGC && in tryGenerateSpecializedMessageSend()
418 CGM.getLangOpts().getGC() == LangOptions::NonGC && in tryGenerateSpecializedMessageSend()
425 CGM.getLangOpts().getGC() == LangOptions::NonGC && in tryGenerateSpecializedMessageSend()
562 Receiver = CGF.CGM.getObjCRuntime().GetClass(CGF, ID); in tryEmitSpecializedAllocInit()
603 CGM.getLangOpts().ObjCAutoRefCount && in EmitObjCMessageExpr()
607 CGObjCRuntime &Runtime = CGM.getObjCRuntime(); in EmitObjCMessageExpr()
736 CGF.CGM.getObjCRuntime().GenerateMessageSendSuper(CGF, ReturnValueSlot(), in Emit()
760 llvm::Function *Fn = CGM.getObjCRuntime().GenerateMethod(OMD, CD); in StartObjCMethod()
762 const CGFunctionInfo &FI = CGM.getTypes().arrangeObjCMethodDeclaration(OMD); in StartObjCMethod()
765 CGM.SetLLVMFunctionAttributes(OMD, FI, Fn, /*IsThunk=*/false); in StartObjCMethod()
766 CGM.SetLLVMFunctionAttributesForDefinition(OMD, Fn); in StartObjCMethod()
768 CGM.SetInternalFunctionAttributes(OMD, Fn, FI); in StartObjCMethod()
788 CGM.getObjCRuntime().GenerateDirectMethodPrologue(*this, Fn, OMD, CD); in StartObjCMethod()
792 if (CGM.getLangOpts().ObjCAutoRefCount && in StartObjCMethod()
835 args.add(RValue::get(CGF.CGM.getSize(size)), Context.getSizeType()); in emitStructGetterCall()
839 llvm::FunctionCallee fn = CGF.CGM.getObjCRuntime().GetGetStructFunction(); in emitStructGetterCall()
856 static CharUnits getMaxAtomicAccessSize(CodeGenModule &CGM, in getMaxAtomicAccessSize() argument
863 return CharUnits::fromQuantity(CGM.PointerSizeInBytes); in getMaxAtomicAccessSize()
898 PropertyImplStrategy(CodeGenModule &CGM,
917 PropertyImplStrategy::PropertyImplStrategy(CodeGenModule &CGM, in PropertyImplStrategy() argument
929 auto TInfo = CGM.getContext().getTypeInfoInChars(ivarType); in PropertyImplStrategy()
944 if (CGM.getLangOpts().getGC() == LangOptions::GCOnly) { in PropertyImplStrategy()
950 } else if (CGM.getLangOpts().ObjCAutoRefCount && !IsAtomic) { in PropertyImplStrategy()
994 (CGM.getLangOpts().getGC() && in PropertyImplStrategy()
995 CGM.getContext().getObjCGCAttrKind(ivarType))) { in PropertyImplStrategy()
1001 if (CGM.getLangOpts().getGC()) in PropertyImplStrategy()
1024 CGM.getTarget().getTriple().getArch(); in PropertyImplStrategy()
1036 if (IvarSize > getMaxAtomicAccessSize(CGM, arch)) { in PropertyImplStrategy()
1052 CodeGenFunction(CGM).GenerateObjCAtomicGetterCopyHelperFunction(PID); in GenerateObjCGetter()
1108 CGF.CGM.getObjCRuntime().GetCppAtomicObjectGetFunction(); in emitCPPObjectAtomicGetterCall()
1177 PropertyImplStrategy strategy(CGM, propImpl); in generateObjCGetterBody()
1201 uint64_t retTySize = CGM.getDataLayout().getTypeSizeInBits(retTy); in generateObjCGetterBody()
1216 CGM.getObjCRuntime().GetPropertyGetFunction(); in generateObjCGetterBody()
1218 CGM.ErrorUnsupported(propImpl, "Obj-C getter requiring atomic copy"); in generateObjCGetterBody()
1347 CGF.CGM.getSize(CGF.getContext().getTypeSizeInChars(ivar->getType())); in emitStructSetterCall()
1357 llvm::FunctionCallee fn = CGF.CGM.getObjCRuntime().GetSetStructFunction(); in emitStructSetterCall()
1393 CGF.CGM.getObjCRuntime().GetCppAtomicObjectSetFunction(); in emitCPPObjectAtomicSetterCall()
1425 static bool UseOptimizedSetter(CodeGenModule &CGM) { in UseOptimizedSetter() argument
1426 if (CGM.getLangOpts().getGC() != LangOptions::NonGC) in UseOptimizedSetter()
1428 return CGM.getLangOpts().ObjCRuntime.hasOptimizedSetter(); in UseOptimizedSetter()
1469 PropertyImplStrategy strategy(CGM, propImpl); in generateObjCSetterBody()
1504 if (UseOptimizedSetter(CGM)) { in generateObjCSetterBody()
1507 CGM.getObjCRuntime().GetOptimizedPropertySetFunction( in generateObjCSetterBody()
1510 CGM.ErrorUnsupported(propImpl, "Obj-C optimized setter - NYI"); in generateObjCSetterBody()
1515 setPropertyFn = CGM.getObjCRuntime().GetPropertySetFunction(); in generateObjCSetterBody()
1517 CGM.ErrorUnsupported(propImpl, "Obj-C setter requiring atomic copy"); in generateObjCSetterBody()
1631 CodeGenFunction(CGM).GenerateObjCAtomicSetterCopyHelperFunction(PID); in GenerateObjCSetter()
1711 MD->createImplicitParams(CGM.getContext(), IMP->getClassInterface()); in GenerateObjCCtorDtorMethod()
1731 CodeGenTypes &Types = CGM.getTypes(); in GenerateObjCCtorDtorMethod()
1732 QualType IdTy(CGM.getContext().getObjCIdType()); in GenerateObjCCtorDtorMethod()
1762 CGM.getObjCRuntime().EnumerationMutationFunction(); in EmitObjCForCollectionStmt()
1764 CGM.ErrorUnsupported(&S, "Obj-C fast enumeration for this runtime"); in EmitObjCForCollectionStmt()
1784 QualType StateTy = CGM.getObjCFastEnumerationStateType(); in EmitObjCForCollectionStmt()
1793 &CGM.getContext().Idents.get("countByEnumeratingWithState"), in EmitObjCForCollectionStmt()
1794 &CGM.getContext().Idents.get("objects"), in EmitObjCForCollectionStmt()
1795 &CGM.getContext().Idents.get("count")}; in EmitObjCForCollectionStmt()
1797 CGM.getContext().Selectors.getSelector(std::size(II), &II[0]); in EmitObjCForCollectionStmt()
1839 CGM.getObjCRuntime().GenerateMessageSend(*this, ReturnValueSlot(), in EmitObjCForCollectionStmt()
1915 CGM.getTypes().arrangeBuiltinFunctionCall(getContext().VoidTy, Args2), in EmitObjCForCollectionStmt()
1972 auto &C = CGM.getContext(); in EmitObjCForCollectionStmt()
1977 CGM.getObjCRuntime().GetClass(*this, InterfaceTy->getDecl()); in EmitObjCForCollectionStmt()
1980 CGM.getObjCRuntime() in EmitObjCForCollectionStmt()
2048 CGM.getObjCRuntime().GenerateMessageSend(*this, ReturnValueSlot(), in EmitObjCForCollectionStmt()
2081 CGM.getObjCRuntime().EmitTryStmt(*this, S); in EmitObjCAtTryStmt()
2085 CGM.getObjCRuntime().EmitThrowStmt(*this, S); in EmitObjCAtThrowStmt()
2090 CGM.getObjCRuntime().EmitSynchronizedStmt(*this, S); in EmitObjCAtSynchronizedStmt()
2123 llvm::Function *&fn = CGM.getObjCEntrypoints().clang_arc_use; in EmitARCIntrinsicUse()
2125 fn = CGM.getIntrinsic(llvm::Intrinsic::objc_clang_arc_use); in EmitARCIntrinsicUse()
2135 llvm::Function *&fn = CGM.getObjCEntrypoints().clang_arc_noop_use; in EmitARCNoopIntrinsicUse()
2137 fn = CGM.getIntrinsic(llvm::Intrinsic::objc_clang_arc_noop_use); in EmitARCNoopIntrinsicUse()
2141 static void setARCRuntimeFunctionLinkage(CodeGenModule &CGM, llvm::Value *RTF) { in setARCRuntimeFunctionLinkage() argument
2146 if (!CGM.getLangOpts().ObjCRuntime.hasNativeARC() && in setARCRuntimeFunctionLinkage()
2147 !CGM.getTriple().isOSBinFormatCOFF()) { in setARCRuntimeFunctionLinkage()
2153 static void setARCRuntimeFunctionLinkage(CodeGenModule &CGM, in setARCRuntimeFunctionLinkage() argument
2155 setARCRuntimeFunctionLinkage(CGM, RTF.getCallee()); in setARCRuntimeFunctionLinkage()
2159 CodeGenModule &CGM) { in getARCIntrinsic() argument
2160 llvm::Function *fn = CGM.getIntrinsic(IntID); in getARCIntrinsic()
2161 setARCRuntimeFunctionLinkage(CGM, fn); in getARCIntrinsic()
2176 fn = getARCIntrinsic(IntID, CGF.CGM); in emitARCValueOperation()
2196 fn = getARCIntrinsic(IntID, CGF.CGM); in emitARCLoadOperation()
2211 fn = getARCIntrinsic(IntID, CGF.CGM); in emitARCStoreOperation()
2233 fn = getARCIntrinsic(IntID, CGF.CGM); in emitARCCopyOperation()
2255 fn = CGF.CGM.CreateRuntimeFunction(fnType, fnName); in emitObjCValueOperation()
2294 CGM.getObjCEntrypoints().objc_retain, in EmitARCRetainNonBlock()
2308 CGM.getObjCEntrypoints().objc_retainBlock, in EmitARCRetainBlock()
2319 CGM.getObjCEntrypoints().objc_retainBlock); in EmitARCRetainBlock()
2332 = CGF.CGM.getObjCEntrypoints().retainAutoreleasedReturnValueMarker; in emitAutoreleasedReturnValueMarker()
2335 = CGF.CGM.getTargetCodeGenInfo() in emitAutoreleasedReturnValueMarker()
2343 } else if (CGF.CGM.getCodeGenOpts().OptimizationLevel == 0) { in emitAutoreleasedReturnValueMarker()
2354 if (!CGF.CGM.getModule().getModuleFlag(retainRVMarkerKey)) { in emitAutoreleasedReturnValueMarker()
2356 CGF.CGM.getModule().addModuleFlag(llvm::Module::Error, in emitAutoreleasedReturnValueMarker()
2377 ObjCEntrypoints &EPs = CGF.CGM.getObjCEntrypoints(); in emitOptimizedARCReturnCall()
2384 EP = getARCIntrinsic(IID, CGF.CGM); in emitOptimizedARCReturnCall()
2386 llvm::Triple::ArchType Arch = CGF.CGM.getTriple().getArch(); in emitOptimizedARCReturnCall()
2390 if (CGF.CGM.getCodeGenOpts().OptimizationLevel > 0 && in emitOptimizedARCReturnCall()
2405 CGF.CGM.getTargetCodeGenInfo().markARCOptimizedReturnCallsAsNoTail(); in emitOptimizedARCReturnCall()
2439 llvm::Function *&fn = CGM.getObjCEntrypoints().objc_release; in EmitARCRelease()
2441 fn = getARCIntrinsic(llvm::Intrinsic::objc_release, CGM); in EmitARCRelease()
2466 if (CGM.getCodeGenOpts().OptimizationLevel == 0) { in EmitARCDestroyStrong()
2483 llvm::Function *&fn = CGM.getObjCEntrypoints().objc_storeStrong; in EmitARCStoreStrongCall()
2485 fn = getARCIntrinsic(llvm::Intrinsic::objc_storeStrong, CGM); in EmitARCStoreStrongCall()
2536 CGM.getObjCEntrypoints().objc_autorelease, in EmitARCAutorelease()
2545 CGM.getObjCEntrypoints().objc_autoreleaseReturnValue, in EmitARCAutoreleaseReturnValue()
2555 CGM.getObjCEntrypoints().objc_retainAutoreleaseReturnValue, in EmitARCRetainAutoreleaseReturnValue()
2584 CGM.getObjCEntrypoints().objc_retainAutorelease, in EmitARCRetainAutoreleaseNonBlock()
2592 CGM.getObjCEntrypoints().objc_loadWeak, in EmitARCLoadWeak()
2599 CGM.getObjCEntrypoints().objc_loadWeakRetained, in EmitARCLoadWeakRetained()
2609 CGM.getObjCEntrypoints().objc_storeWeak, in EmitARCStoreWeak()
2623 CGM.getCodeGenOpts().OptimizationLevel == 0) { in EmitARCInitWeak()
2629 CGM.getObjCEntrypoints().objc_initWeak, in EmitARCInitWeak()
2636 llvm::Function *&fn = CGM.getObjCEntrypoints().objc_destroyWeak; in EmitARCDestroyWeak()
2638 fn = getARCIntrinsic(llvm::Intrinsic::objc_destroyWeak, CGM); in EmitARCDestroyWeak()
2648 CGM.getObjCEntrypoints().objc_moveWeak, in EmitARCMoveWeak()
2657 CGM.getObjCEntrypoints().objc_copyWeak, in EmitARCCopyWeak()
2679 llvm::Function *&fn = CGM.getObjCEntrypoints().objc_autoreleasePoolPush; in EmitObjCAutoreleasePoolPush()
2681 fn = getARCIntrinsic(llvm::Intrinsic::objc_autoreleasePoolPush, CGM); in EmitObjCAutoreleasePoolPush()
2694 CGM.getObjCEntrypoints().objc_autoreleasePoolPopInvoke; in EmitObjCAutoreleasePoolPop()
2698 fn = CGM.CreateRuntimeFunction(fnType, "objc_autoreleasePoolPop"); in EmitObjCAutoreleasePoolPop()
2699 setARCRuntimeFunctionLinkage(CGM, fn); in EmitObjCAutoreleasePoolPop()
2705 llvm::FunctionCallee &fn = CGM.getObjCEntrypoints().objc_autoreleasePoolPop; in EmitObjCAutoreleasePoolPop()
2707 fn = getARCIntrinsic(llvm::Intrinsic::objc_autoreleasePoolPop, CGM); in EmitObjCAutoreleasePoolPop()
2719 CGObjCRuntime &Runtime = CGM.getObjCRuntime(); in EmitObjCMRRAutoreleasePoolPush()
2722 const IdentifierInfo *II = &CGM.getContext().Idents.get("alloc"); in EmitObjCMRRAutoreleasePoolPush()
2732 II = &CGM.getContext().Idents.get("init"); in EmitObjCMRRAutoreleasePoolPush()
2746 CGM.getObjCEntrypoints().objc_alloc, in EmitObjCAlloc()
2755 CGM.getObjCEntrypoints().objc_allocWithZone, in EmitObjCAllocWithZone()
2762 CGM.getObjCEntrypoints().objc_alloc_init, in EmitObjCAllocInit()
2769 const IdentifierInfo *II = &CGM.getContext().Idents.get("drain"); in EmitObjCMRRAutoreleasePoolPop()
2772 CGM.getObjCRuntime().GenerateMessageSend(*this, ReturnValueSlot(), in EmitObjCMRRAutoreleasePoolPop()
2806 CGM.getObjCEntrypoints().objc_autoreleaseRuntimeFunction, in EmitObjCAutorelease()
2816 CGM.getObjCEntrypoints().objc_retainRuntimeFunction, "objc_retain"); in EmitObjCRetainNonBlock()
2826 CGM.getObjCEntrypoints().objc_releaseRuntimeFunction; in EmitObjCRelease()
2830 fn = CGM.CreateRuntimeFunction(fnType, "objc_release"); in EmitObjCRelease()
2831 setARCRuntimeFunctionLinkage(CGM, fn); in EmitObjCRelease()
2871 if (CGM.getLangOpts().ObjCAutoRefCount) in EmitObjCAutoreleasePoolCleanup()
3046 CGM.getLangOpts().ObjCRuntime.hasARCUnsafeClaimAutoreleasedReturnValue()) { in EmitARCReclaimReturnedObject()
3369 if (CGF.CGM.getCodeGenOpts().ObjCAvoidHeapifyLocalBlocks && in visitBlockExpr()
3653 if (CGM.getLangOpts().ObjCRuntime.hasNativeARC()) { in EmitObjCAutoreleasePoolStmt()
3701 CGM, Alignment, Alignment, Ty.isVolatileQualified(), Ty); in GenerateObjCAtomicSetterCopyHelperFunction()
3714 if ((HelperFn = CGM.getAtomicSetterHelperFnMap(Ty))) in GenerateObjCAtomicSetterCopyHelperFunction()
3718 &CGM.getContext().Idents.get("__assign_helper_atomic_property_"); in GenerateObjCAtomicSetterCopyHelperFunction()
3750 CGM.getTypes().arrangeBuiltinFunctionDeclaration(ReturnTy, args); in GenerateObjCAtomicSetterCopyHelperFunction()
3752 llvm::FunctionType *LTy = CGM.getTypes().GetFunctionType(FI); in GenerateObjCAtomicSetterCopyHelperFunction()
3757 &CGM.getModule()); in GenerateObjCAtomicSetterCopyHelperFunction()
3759 CGM.SetInternalFunctionAttributes(GlobalDecl(), Fn, FI); in GenerateObjCAtomicSetterCopyHelperFunction()
3783 CGM.setAtomicSetterHelperFnMap(Ty, HelperFn); in GenerateObjCAtomicSetterCopyHelperFunction()
3799 CGM, Alignment, Alignment, Ty.isVolatileQualified(), Ty); in GenerateObjCAtomicGetterCopyHelperFunction()
3812 if ((HelperFn = CGM.getAtomicGetterHelperFnMap(Ty))) in GenerateObjCAtomicGetterCopyHelperFunction()
3816 &CGM.getContext().Idents.get("__copy_helper_atomic_property_"); in GenerateObjCAtomicGetterCopyHelperFunction()
3848 CGM.getTypes().arrangeBuiltinFunctionDeclaration(ReturnTy, args); in GenerateObjCAtomicGetterCopyHelperFunction()
3850 llvm::FunctionType *LTy = CGM.getTypes().GetFunctionType(FI); in GenerateObjCAtomicGetterCopyHelperFunction()
3854 &CGM.getModule()); in GenerateObjCAtomicGetterCopyHelperFunction()
3856 CGM.SetInternalFunctionAttributes(GlobalDecl(), Fn, FI); in GenerateObjCAtomicGetterCopyHelperFunction()
3902 CGM.setAtomicGetterHelperFnMap(Ty, HelperFn); in GenerateObjCAtomicGetterCopyHelperFunction()
3917 CGObjCRuntime &Runtime = CGM.getObjCRuntime(); in EmitBlockCopyAndAutorelease()
3953 CodeGenModule &CGM = CGF.CGM; in emitIsPlatformVersionAtLeast() local
3963 llvm::ConstantInt::get(CGM.Int32Ty, getBaseMachOPlatformID(TT))); in emitIsPlatformVersionAtLeast()
3964 Args.push_back(llvm::ConstantInt::get(CGM.Int32Ty, Version.getMajor())); in emitIsPlatformVersionAtLeast()
3965 Args.push_back(llvm::ConstantInt::get(CGM.Int32Ty, Min.value_or(0))); in emitIsPlatformVersionAtLeast()
3966 Args.push_back(llvm::ConstantInt::get(CGM.Int32Ty, SMin.value_or(0))); in emitIsPlatformVersionAtLeast()
3970 EmitArgs(Version, CGM.getTarget().getTriple()); in emitIsPlatformVersionAtLeast()
3972 if (!CGM.IsPlatformVersionAtLeastFn) { in emitIsPlatformVersionAtLeast()
3974 CGM.Int32Ty, {CGM.Int32Ty, CGM.Int32Ty, CGM.Int32Ty, CGM.Int32Ty}, in emitIsPlatformVersionAtLeast()
3976 CGM.IsPlatformVersionAtLeastFn = in emitIsPlatformVersionAtLeast()
3977 CGM.CreateRuntimeFunction(FTy, "__isPlatformVersionAtLeast"); in emitIsPlatformVersionAtLeast()
3981 CGF.EmitNounwindRuntimeCall(CGM.IsPlatformVersionAtLeastFn, Args); in emitIsPlatformVersionAtLeast()
3983 llvm::Constant::getNullValue(CGM.Int32Ty)); in emitIsPlatformVersionAtLeast()
3989 if (CGM.getTarget().getTriple().isOSDarwin()) in EmitBuiltinAvailable()
3992 if (!CGM.IsOSVersionAtLeastFn) { in EmitBuiltinAvailable()
3995 CGM.IsOSVersionAtLeastFn = in EmitBuiltinAvailable()
3996 CGM.CreateRuntimeFunction(FTy, "__isOSVersionAtLeast"); in EmitBuiltinAvailable()
4002 llvm::ConstantInt::get(CGM.Int32Ty, Version.getMajor()), in EmitBuiltinAvailable()
4003 llvm::ConstantInt::get(CGM.Int32Ty, Min.value_or(0)), in EmitBuiltinAvailable()
4004 llvm::ConstantInt::get(CGM.Int32Ty, SMin.value_or(0))}; in EmitBuiltinAvailable()
4007 EmitNounwindRuntimeCall(CGM.IsOSVersionAtLeastFn, Args); in EmitBuiltinAvailable()