Lines Matching refs:CGF
86 LValue CGObjCRuntime::EmitValueForIvarAtOffset(CodeGen::CodeGenFunction &CGF,
94 llvm::Type *LTy = CGF.CGM.getTypes().ConvertTypeForMem(IvarTy);
95 llvm::Value *V = CGF.Builder.CreateBitCast(BaseValue, CGF.Int8PtrTy);
96 V = CGF.Builder.CreateInBoundsGEP(V, Offset, "add.ptr");
99 V = CGF.Builder.CreateBitCast(V, llvm::PointerType::getUnqual(LTy));
100 LValue LV = CGF.MakeNaturalAlignAddrLValue(V, IvarTy);
119 uint64_t FieldBitOffset = LookupFieldBitOffset(CGF.CGM, OID, nullptr, Ivar);
120 uint64_t BitOffset = FieldBitOffset % CGF.CGM.getContext().getCharWidth();
121 uint64_t AlignmentBits = CGF.CGM.getTarget().getCharAlign();
122 uint64_t BitFieldSize = Ivar->getBitWidthValue(CGF.getContext());
124 CGF.CGM.getContext().toCharUnitsFromBits(
126 CharUnits Alignment = CGF.CGM.getContext().toCharUnitsFromBits(AlignmentBits);
134 CGBitFieldInfo *Info = new (CGF.CGM.getContext()) CGBitFieldInfo(
135 CGBitFieldInfo::MakeInfo(CGF.CGM.getTypes(), Ivar, BitOffset, BitFieldSize,
136 CGF.CGM.getContext().toBits(StorageSize),
139 V = CGF.Builder.CreateBitCast(V,
140 llvm::Type::getIntNPtrTy(CGF.getLLVMContext(),
161 void Emit(CodeGenFunction &CGF, Flags flags) override {
163 CGF.Builder.CreateCall(Fn)->setDoesNotThrow();
167 CGF.EmitRuntimeCallOrInvoke(Fn);
173 void CGObjCRuntime::EmitTryCatchStmt(CodeGenFunction &CGF,
181 Cont = CGF.getJumpDestInCurrentScope("eh.cont");
185 FinallyInfo.enter(CGF, Finally->getFinallyBody(),
200 Handler.Block = CGF.createBasicBlock("catch");
212 EHCatchScope *Catch = CGF.EHStack.pushCatch(Handlers.size());
218 CGF.EmitStmt(S.getTryBody());
222 CGF.popCatchScope();
225 CGBuilderTy::InsertPoint SavedIP = CGF.Builder.saveAndClearIP();
231 CGF.EmitBlock(Handler.Block);
232 llvm::Value *RawExn = CGF.getExceptionFromSlot();
237 Exn = CGF.Builder.CreateCall(beginCatchFn, RawExn, "exn.adjusted");
241 CodeGenFunction::LexicalScope cleanups(CGF, Handler.Body->getSourceRange());
247 CGF.EHStack.pushCleanup<CallObjCEndCatch>(NormalAndEHCleanup,
254 llvm::Type *CatchType = CGF.ConvertType(CatchParam->getType());
255 llvm::Value *CastExn = CGF.Builder.CreateBitCast(Exn, CatchType);
257 CGF.EmitAutoVarDecl(*CatchParam);
259 llvm::Value *CatchParamAddr = CGF.GetAddrOfLocalVar(CatchParam);
263 CastExn = CGF.EmitARCRetainNonBlock(CastExn);
269 CGF.Builder.CreateStore(CastExn, CatchParamAddr);
273 CGF.EmitARCInitWeak(CatchParamAddr, CastExn);
278 CGF.ObjCEHValueStack.push_back(Exn);
279 CGF.EmitStmt(Handler.Body);
280 CGF.ObjCEHValueStack.pop_back();
285 CGF.EmitBranchThroughCleanup(Cont);
289 CGF.Builder.restoreIP(SavedIP);
293 FinallyInfo.exit(CGF);
296 CGF.EmitBlock(Cont.getBlock());
306 void Emit(CodeGenFunction &CGF, Flags flags) override {
307 CGF.Builder.CreateCall(SyncExitFn, SyncArg)->setDoesNotThrow();
312 void CGObjCRuntime::EmitAtSynchronizedStmt(CodeGenFunction &CGF,
316 CodeGenFunction::RunCleanupsScope cleanups(CGF);
322 if (CGF.getLangOpts().ObjCAutoRefCount) {
323 lock = CGF.EmitARCRetainScalarExpr(lockExpr);
324 lock = CGF.EmitObjCConsumeObject(lockExpr->getType(), lock);
326 lock = CGF.EmitScalarExpr(lockExpr);
328 lock = CGF.Builder.CreateBitCast(lock, CGF.VoidPtrTy);
331 CGF.Builder.CreateCall(syncEnterFn, lock)->setDoesNotThrow();
334 CGF.EHStack.pushCleanup<CallSyncExit>(NormalAndEHCleanup, syncExitFn, lock);
337 CGF.EmitStmt(S.getSynchBody());