Lines Matching refs:CGF
86 LValue CGObjCRuntime::EmitValueForIvarAtOffset(CodeGen::CodeGenFunction &CGF, in EmitValueForIvarAtOffset() argument
94 llvm::Type *LTy = CGF.CGM.getTypes().ConvertTypeForMem(IvarTy); in EmitValueForIvarAtOffset()
95 llvm::Value *V = CGF.Builder.CreateBitCast(BaseValue, CGF.Int8PtrTy); in EmitValueForIvarAtOffset()
96 V = CGF.Builder.CreateInBoundsGEP(V, Offset, "add.ptr"); in EmitValueForIvarAtOffset()
99 V = CGF.Builder.CreateBitCast(V, llvm::PointerType::getUnqual(LTy)); in EmitValueForIvarAtOffset()
100 LValue LV = CGF.MakeNaturalAlignAddrLValue(V, IvarTy); in EmitValueForIvarAtOffset()
119 uint64_t FieldBitOffset = LookupFieldBitOffset(CGF.CGM, OID, nullptr, Ivar); in EmitValueForIvarAtOffset()
120 uint64_t BitOffset = FieldBitOffset % CGF.CGM.getContext().getCharWidth(); in EmitValueForIvarAtOffset()
121 uint64_t AlignmentBits = CGF.CGM.getTarget().getCharAlign(); in EmitValueForIvarAtOffset()
122 uint64_t BitFieldSize = Ivar->getBitWidthValue(CGF.getContext()); in EmitValueForIvarAtOffset()
123 CharUnits StorageSize = CGF.CGM.getContext().toCharUnitsFromBits( in EmitValueForIvarAtOffset()
125 CharUnits Alignment = CGF.CGM.getContext().toCharUnitsFromBits(AlignmentBits); in EmitValueForIvarAtOffset()
133 CGBitFieldInfo *Info = new (CGF.CGM.getContext()) CGBitFieldInfo( in EmitValueForIvarAtOffset()
134 CGBitFieldInfo::MakeInfo(CGF.CGM.getTypes(), Ivar, BitOffset, BitFieldSize, in EmitValueForIvarAtOffset()
135 CGF.CGM.getContext().toBits(StorageSize), in EmitValueForIvarAtOffset()
139 Addr = CGF.Builder.CreateElementBitCast(Addr, in EmitValueForIvarAtOffset()
140 llvm::Type::getIntNTy(CGF.getLLVMContext(), in EmitValueForIvarAtOffset()
161 void Emit(CodeGenFunction &CGF, Flags flags) override { in Emit()
163 CGF.Builder.CreateCall(Fn)->setDoesNotThrow(); in Emit()
167 CGF.EmitRuntimeCallOrInvoke(Fn); in Emit()
173 void CGObjCRuntime::EmitTryCatchStmt(CodeGenFunction &CGF, in EmitTryCatchStmt() argument
181 Cont = CGF.getJumpDestInCurrentScope("eh.cont"); in EmitTryCatchStmt()
185 FinallyInfo.enter(CGF, Finally->getFinallyBody(), in EmitTryCatchStmt()
200 Handler.Block = CGF.createBasicBlock("catch"); in EmitTryCatchStmt()
212 EHCatchScope *Catch = CGF.EHStack.pushCatch(Handlers.size()); in EmitTryCatchStmt()
218 CGF.EmitStmt(S.getTryBody()); in EmitTryCatchStmt()
222 CGF.popCatchScope(); in EmitTryCatchStmt()
225 CGBuilderTy::InsertPoint SavedIP = CGF.Builder.saveAndClearIP(); in EmitTryCatchStmt()
231 CGF.EmitBlock(Handler.Block); in EmitTryCatchStmt()
232 llvm::Value *RawExn = CGF.getExceptionFromSlot(); in EmitTryCatchStmt()
237 Exn = CGF.Builder.CreateCall(beginCatchFn, RawExn, "exn.adjusted"); in EmitTryCatchStmt()
241 CodeGenFunction::LexicalScope cleanups(CGF, Handler.Body->getSourceRange()); in EmitTryCatchStmt()
247 CGF.EHStack.pushCleanup<CallObjCEndCatch>(NormalAndEHCleanup, in EmitTryCatchStmt()
254 llvm::Type *CatchType = CGF.ConvertType(CatchParam->getType()); in EmitTryCatchStmt()
255 llvm::Value *CastExn = CGF.Builder.CreateBitCast(Exn, CatchType); in EmitTryCatchStmt()
257 CGF.EmitAutoVarDecl(*CatchParam); in EmitTryCatchStmt()
258 EmitInitOfCatchParam(CGF, CastExn, CatchParam); in EmitTryCatchStmt()
261 CGF.ObjCEHValueStack.push_back(Exn); in EmitTryCatchStmt()
262 CGF.EmitStmt(Handler.Body); in EmitTryCatchStmt()
263 CGF.ObjCEHValueStack.pop_back(); in EmitTryCatchStmt()
268 CGF.EmitBranchThroughCleanup(Cont); in EmitTryCatchStmt()
272 CGF.Builder.restoreIP(SavedIP); in EmitTryCatchStmt()
276 FinallyInfo.exit(CGF); in EmitTryCatchStmt()
279 CGF.EmitBlock(Cont.getBlock()); in EmitTryCatchStmt()
282 void CGObjCRuntime::EmitInitOfCatchParam(CodeGenFunction &CGF, in EmitInitOfCatchParam() argument
286 Address paramAddr = CGF.GetAddrOfLocalVar(paramDecl); in EmitInitOfCatchParam()
290 exn = CGF.EmitARCRetainNonBlock(exn); in EmitInitOfCatchParam()
296 CGF.Builder.CreateStore(exn, paramAddr); in EmitInitOfCatchParam()
300 CGF.EmitARCInitWeak(paramAddr, exn); in EmitInitOfCatchParam()
313 void Emit(CodeGenFunction &CGF, Flags flags) override { in Emit()
314 CGF.Builder.CreateCall(SyncExitFn, SyncArg)->setDoesNotThrow(); in Emit()
319 void CGObjCRuntime::EmitAtSynchronizedStmt(CodeGenFunction &CGF, in EmitAtSynchronizedStmt() argument
323 CodeGenFunction::RunCleanupsScope cleanups(CGF); in EmitAtSynchronizedStmt()
329 if (CGF.getLangOpts().ObjCAutoRefCount) { in EmitAtSynchronizedStmt()
330 lock = CGF.EmitARCRetainScalarExpr(lockExpr); in EmitAtSynchronizedStmt()
331 lock = CGF.EmitObjCConsumeObject(lockExpr->getType(), lock); in EmitAtSynchronizedStmt()
333 lock = CGF.EmitScalarExpr(lockExpr); in EmitAtSynchronizedStmt()
335 lock = CGF.Builder.CreateBitCast(lock, CGF.VoidPtrTy); in EmitAtSynchronizedStmt()
338 CGF.Builder.CreateCall(syncEnterFn, lock)->setDoesNotThrow(); in EmitAtSynchronizedStmt()
341 CGF.EHStack.pushCleanup<CallSyncExit>(NormalAndEHCleanup, syncExitFn, lock); in EmitAtSynchronizedStmt()
344 CGF.EmitStmt(S.getSynchBody()); in EmitAtSynchronizedStmt()