Home | History | Annotate | Download | only in CodeGen

Lines Matching full: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());
123 CharUnits StorageSize = CGF.CGM.getContext().toCharUnitsFromBits(
125 CharUnits Alignment = CGF.CGM.getContext().toCharUnitsFromBits(AlignmentBits);
133 CGBitFieldInfo *Info = new (CGF.CGM.getContext()) CGBitFieldInfo(
134 CGBitFieldInfo::MakeInfo(CGF.CGM.getTypes(), Ivar, BitOffset, BitFieldSize,
135 CGF.CGM.getContext().toBits(StorageSize),
139 Addr = CGF.Builder.CreateElementBitCast(Addr,
140 llvm::Type::getIntNTy(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);
258 EmitInitOfCatchParam(CGF, CastExn, CatchParam);
261 CGF.ObjCEHValueStack.push_back(Exn);
262 CGF.EmitStmt(Handler.Body);
263 CGF.ObjCEHValueStack.pop_back();
268 CGF.EmitBranchThroughCleanup(Cont);
272 CGF.Builder.restoreIP(SavedIP);
276 FinallyInfo.exit(CGF);
279 CGF.EmitBlock(Cont.getBlock());
282 void CGObjCRuntime::EmitInitOfCatchParam(CodeGenFunction &CGF,
286 Address paramAddr = CGF.GetAddrOfLocalVar(paramDecl);
290 exn = CGF.EmitARCRetainNonBlock(exn);
296 CGF.Builder.CreateStore(exn, paramAddr);
300 CGF.EmitARCInitWeak(paramAddr, exn);
313 void Emit(CodeGenFunction &CGF, Flags flags) override {
314 CGF.Builder.CreateCall(SyncExitFn, SyncArg)->setDoesNotThrow();
319 void CGObjCRuntime::EmitAtSynchronizedStmt(CodeGenFunction &CGF,
323 CodeGenFunction::RunCleanupsScope cleanups(CGF);
329 if (CGF.getLangOpts().ObjCAutoRefCount) {
330 lock = CGF.EmitARCRetainScalarExpr(lockExpr);
331 lock = CGF.EmitObjCConsumeObject(lockExpr->getType(), lock);
333 lock = CGF.EmitScalarExpr(lockExpr);
335 lock = CGF.Builder.CreateBitCast(lock, CGF.VoidPtrTy);
338 CGF.Builder.CreateCall(syncEnterFn, lock)->setDoesNotThrow();
341 CGF.EHStack.pushCleanup<CallSyncExit>(NormalAndEHCleanup, syncExitFn, lock);
344 CGF.EmitStmt(S.getSynchBody());