Lines Matching refs:CGF
267 CodeGenFunction *CGF, in tryCaptureAsConstant() argument
288 return CGM.EmitConstantInit(*var, CGF); in tryCaptureAsConstant()
331 static void computeBlockInfo(CodeGenModule &CGM, CodeGenFunction *CGF, in computeBlockInfo() argument
358 assert(CGF && CGF->CurFuncDecl && isa<CXXMethodDecl>(CGF->CurFuncDecl) && in computeBlockInfo()
360 QualType thisType = cast<CXXMethodDecl>(CGF->CurFuncDecl)->getThisType(C); in computeBlockInfo()
395 if (llvm::Constant *constant = tryCaptureAsConstant(CGM, CGF, variable)) { in computeBlockInfo()
556 static void enterBlockScope(CodeGenFunction &CGF, BlockDecl *block) { in enterBlockScope() argument
557 assert(CGF.HaveInsertPoint()); in enterBlockScope()
561 *new CGBlockInfo(block, CGF.CurFn->getName()); in enterBlockScope()
562 blockInfo.NextBlockInfo = CGF.FirstBlockInfo; in enterBlockScope()
563 CGF.FirstBlockInfo = &blockInfo; in enterBlockScope()
567 computeBlockInfo(CGF.CGM, &CGF, blockInfo); in enterBlockScope()
574 CGF.CreateTempAlloca(blockInfo.StructureType, "block"); in enterBlockScope()
604 destroyer = CGF.getDestroyer(dtorKind); in enterBlockScope()
608 llvm::Value *addr = CGF.Builder.CreateStructGEP(blockInfo.Address, in enterBlockScope()
616 bool useArrayEHCleanup = CGF.needsEHCleanup(dtorKind); in enterBlockScope()
620 CGF.pushDestroy(cleanupKind, addr, variable->getType(), in enterBlockScope()
624 capture.setCleanup(CGF.EHStack.stable_begin()); in enterBlockScope()
1584 void emitCopy(CodeGenFunction &CGF, llvm::Value *destField, in emitCopy() argument
1586 destField = CGF.Builder.CreateBitCast(destField, CGF.VoidPtrTy); in emitCopy()
1588 srcField = CGF.Builder.CreateBitCast(srcField, CGF.VoidPtrPtrTy); in emitCopy()
1589 llvm::Value *srcValue = CGF.Builder.CreateLoad(srcField); in emitCopy()
1593 llvm::Value *flagsVal = llvm::ConstantInt::get(CGF.Int32Ty, flags); in emitCopy()
1594 llvm::Value *fn = CGF.CGM.getBlockObjectAssign(); in emitCopy()
1597 CGF.EmitNounwindRuntimeCall(fn, args); in emitCopy()
1600 void emitDispose(CodeGenFunction &CGF, llvm::Value *field) override { in emitDispose() argument
1601 field = CGF.Builder.CreateBitCast(field, CGF.Int8PtrTy->getPointerTo(0)); in emitDispose()
1602 llvm::Value *value = CGF.Builder.CreateLoad(field); in emitDispose()
1604 CGF.BuildBlockRelease(value, Flags | BLOCK_BYREF_CALLER); in emitDispose()
1617 void emitCopy(CodeGenFunction &CGF, llvm::Value *destField, in emitCopy() argument
1619 CGF.EmitARCMoveWeak(destField, srcField); in emitCopy()
1622 void emitDispose(CodeGenFunction &CGF, llvm::Value *field) override { in emitDispose() argument
1623 CGF.EmitARCDestroyWeak(field); in emitDispose()
1638 void emitCopy(CodeGenFunction &CGF, llvm::Value *destField, in emitCopy() argument
1643 llvm::LoadInst *value = CGF.Builder.CreateLoad(srcField); in emitCopy()
1649 if (CGF.CGM.getCodeGenOpts().OptimizationLevel == 0) { in emitCopy()
1650 llvm::StoreInst *store = CGF.Builder.CreateStore(null, destField); in emitCopy()
1652 CGF.EmitARCStoreStrongCall(destField, value, /*ignored*/ true); in emitCopy()
1653 CGF.EmitARCStoreStrongCall(srcField, null, /*ignored*/ true); in emitCopy()
1656 llvm::StoreInst *store = CGF.Builder.CreateStore(value, destField); in emitCopy()
1659 store = CGF.Builder.CreateStore(null, srcField); in emitCopy()
1663 void emitDispose(CodeGenFunction &CGF, llvm::Value *field) override { in emitDispose() argument
1664 CGF.EmitARCDestroyStrong(field, ARCImpreciseLifetime); in emitDispose()
1679 void emitCopy(CodeGenFunction &CGF, llvm::Value *destField, in emitCopy() argument
1684 llvm::LoadInst *oldValue = CGF.Builder.CreateLoad(srcField); in emitCopy()
1687 llvm::Value *copy = CGF.EmitARCRetainBlock(oldValue, /*mandatory*/ true); in emitCopy()
1689 llvm::StoreInst *store = CGF.Builder.CreateStore(copy, destField); in emitCopy()
1693 void emitDispose(CodeGenFunction &CGF, llvm::Value *field) override { in emitDispose() argument
1694 CGF.EmitARCDestroyStrong(field, ARCImpreciseLifetime); in emitDispose()
1715 void emitCopy(CodeGenFunction &CGF, llvm::Value *destField, in emitCopy() argument
1718 CGF.EmitSynthesizedCXXCopyCtor(destField, srcField, CopyExpr); in emitCopy()
1721 void emitDispose(CodeGenFunction &CGF, llvm::Value *field) override { in emitDispose() argument
1722 EHScopeStack::stable_iterator cleanupDepth = CGF.EHStack.stable_begin(); in emitDispose()
1723 CGF.PushDestructorCleanup(VarType, field); in emitDispose()
1724 CGF.PopCleanupBlocks(cleanupDepth); in emitDispose()
1734 generateByrefCopyHelper(CodeGenFunction &CGF, in generateByrefCopyHelper() argument
1738 ASTContext &Context = CGF.getContext(); in generateByrefCopyHelper()
1743 ImplicitParamDecl dst(CGF.getContext(), nullptr, SourceLocation(), nullptr, in generateByrefCopyHelper()
1747 ImplicitParamDecl src(CGF.getContext(), nullptr, SourceLocation(), nullptr, in generateByrefCopyHelper()
1751 const CGFunctionInfo &FI = CGF.CGM.getTypes().arrangeFreeFunctionDeclaration( in generateByrefCopyHelper()
1754 CodeGenTypes &Types = CGF.CGM.getTypes(); in generateByrefCopyHelper()
1761 "__Block_byref_object_copy_", &CGF.CGM.getModule()); in generateByrefCopyHelper()
1773 CGF.StartFunction(FD, R, Fn, FI, args); in generateByrefCopyHelper()
1779 llvm::Value *destField = CGF.GetAddrOfLocalVar(&dst); in generateByrefCopyHelper()
1780 destField = CGF.Builder.CreateLoad(destField); in generateByrefCopyHelper()
1781 destField = CGF.Builder.CreateBitCast(destField, byrefPtrType); in generateByrefCopyHelper()
1782 destField = CGF.Builder.CreateStructGEP(destField, valueFieldIndex, "x"); in generateByrefCopyHelper()
1785 llvm::Value *srcField = CGF.GetAddrOfLocalVar(&src); in generateByrefCopyHelper()
1786 srcField = CGF.Builder.CreateLoad(srcField); in generateByrefCopyHelper()
1787 srcField = CGF.Builder.CreateBitCast(srcField, byrefPtrType); in generateByrefCopyHelper()
1788 srcField = CGF.Builder.CreateStructGEP(srcField, valueFieldIndex, "x"); in generateByrefCopyHelper()
1790 byrefInfo.emitCopy(CGF, destField, srcField); in generateByrefCopyHelper()
1793 CGF.FinishFunction(); in generateByrefCopyHelper()
1795 return llvm::ConstantExpr::getBitCast(Fn, CGF.Int8PtrTy); in generateByrefCopyHelper()
1803 CodeGenFunction CGF(CGM); in buildByrefCopyHelper() local
1804 return generateByrefCopyHelper(CGF, byrefType, byrefValueIndex, info); in buildByrefCopyHelper()
1809 generateByrefDisposeHelper(CodeGenFunction &CGF, in generateByrefDisposeHelper() argument
1813 ASTContext &Context = CGF.getContext(); in generateByrefDisposeHelper()
1817 ImplicitParamDecl src(CGF.getContext(), nullptr, SourceLocation(), nullptr, in generateByrefDisposeHelper()
1821 const CGFunctionInfo &FI = CGF.CGM.getTypes().arrangeFreeFunctionDeclaration( in generateByrefDisposeHelper()
1824 CodeGenTypes &Types = CGF.CGM.getTypes(); in generateByrefDisposeHelper()
1832 &CGF.CGM.getModule()); in generateByrefDisposeHelper()
1843 CGF.StartFunction(FD, R, Fn, FI, args); in generateByrefDisposeHelper()
1846 llvm::Value *V = CGF.GetAddrOfLocalVar(&src); in generateByrefDisposeHelper()
1847 V = CGF.Builder.CreateLoad(V); in generateByrefDisposeHelper()
1848 V = CGF.Builder.CreateBitCast(V, byrefType.getPointerTo(0)); in generateByrefDisposeHelper()
1849 V = CGF.Builder.CreateStructGEP(V, byrefValueIndex, "x"); in generateByrefDisposeHelper()
1851 byrefInfo.emitDispose(CGF, V); in generateByrefDisposeHelper()
1854 CGF.FinishFunction(); in generateByrefDisposeHelper()
1856 return llvm::ConstantExpr::getBitCast(Fn, CGF.Int8PtrTy); in generateByrefDisposeHelper()
1864 CodeGenFunction CGF(CGM); in buildByrefDisposeHelper() local
1865 return generateByrefDisposeHelper(CGF, byrefType, byrefValueIndex, info); in buildByrefDisposeHelper()
2215 void Emit(CodeGenFunction &CGF, Flags flags) override { in Emit()
2217 CGF.BuildBlockRelease(Addr, BLOCK_FIELD_IS_BYREF); in Emit()