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()
397 if (llvm::Constant *constant = tryCaptureAsConstant(CGM, CGF, variable)) { in computeBlockInfo()
558 static void enterBlockScope(CodeGenFunction &CGF, BlockDecl *block) { in enterBlockScope() argument
559 assert(CGF.HaveInsertPoint()); in enterBlockScope()
563 *new CGBlockInfo(block, CGF.CurFn->getName()); in enterBlockScope()
564 blockInfo.NextBlockInfo = CGF.FirstBlockInfo; in enterBlockScope()
565 CGF.FirstBlockInfo = &blockInfo; in enterBlockScope()
569 computeBlockInfo(CGF.CGM, &CGF, blockInfo); in enterBlockScope()
576 CGF.CreateTempAlloca(blockInfo.StructureType, "block"); in enterBlockScope()
607 destroyer = CGF.getDestroyer(dtorKind); in enterBlockScope()
611 llvm::Value *addr = CGF.Builder.CreateStructGEP(blockInfo.Address, in enterBlockScope()
619 bool useArrayEHCleanup = CGF.needsEHCleanup(dtorKind); in enterBlockScope()
623 CGF.pushDestroy(cleanupKind, addr, variable->getType(), in enterBlockScope()
627 capture.setCleanup(CGF.EHStack.stable_begin()); in enterBlockScope()
1589 void emitCopy(CodeGenFunction &CGF, llvm::Value *destField, in emitCopy() argument
1591 destField = CGF.Builder.CreateBitCast(destField, CGF.VoidPtrTy); in emitCopy()
1593 srcField = CGF.Builder.CreateBitCast(srcField, CGF.VoidPtrPtrTy); in emitCopy()
1594 llvm::Value *srcValue = CGF.Builder.CreateLoad(srcField); in emitCopy()
1598 llvm::Value *flagsVal = llvm::ConstantInt::get(CGF.Int32Ty, flags); in emitCopy()
1599 llvm::Value *fn = CGF.CGM.getBlockObjectAssign(); in emitCopy()
1602 CGF.EmitNounwindRuntimeCall(fn, args); in emitCopy()
1605 void emitDispose(CodeGenFunction &CGF, llvm::Value *field) { in emitDispose() argument
1606 field = CGF.Builder.CreateBitCast(field, CGF.Int8PtrTy->getPointerTo(0)); in emitDispose()
1607 llvm::Value *value = CGF.Builder.CreateLoad(field); in emitDispose()
1609 CGF.BuildBlockRelease(value, Flags | BLOCK_BYREF_CALLER); in emitDispose()
1622 void emitCopy(CodeGenFunction &CGF, llvm::Value *destField, in emitCopy() argument
1624 CGF.EmitARCMoveWeak(destField, srcField); in emitCopy()
1627 void emitDispose(CodeGenFunction &CGF, llvm::Value *field) { in emitDispose() argument
1628 CGF.EmitARCDestroyWeak(field); in emitDispose()
1643 void emitCopy(CodeGenFunction &CGF, llvm::Value *destField, in emitCopy() argument
1648 llvm::LoadInst *value = CGF.Builder.CreateLoad(srcField); in emitCopy()
1654 if (CGF.CGM.getCodeGenOpts().OptimizationLevel == 0) { in emitCopy()
1655 llvm::StoreInst *store = CGF.Builder.CreateStore(null, destField); in emitCopy()
1657 CGF.EmitARCStoreStrongCall(destField, value, /*ignored*/ true); in emitCopy()
1658 CGF.EmitARCStoreStrongCall(srcField, null, /*ignored*/ true); in emitCopy()
1661 llvm::StoreInst *store = CGF.Builder.CreateStore(value, destField); in emitCopy()
1664 store = CGF.Builder.CreateStore(null, srcField); in emitCopy()
1668 void emitDispose(CodeGenFunction &CGF, llvm::Value *field) { in emitDispose() argument
1669 CGF.EmitARCDestroyStrong(field, ARCImpreciseLifetime); in emitDispose()
1684 void emitCopy(CodeGenFunction &CGF, llvm::Value *destField, in emitCopy() argument
1689 llvm::LoadInst *oldValue = CGF.Builder.CreateLoad(srcField); in emitCopy()
1692 llvm::Value *copy = CGF.EmitARCRetainBlock(oldValue, /*mandatory*/ true); in emitCopy()
1694 llvm::StoreInst *store = CGF.Builder.CreateStore(copy, destField); in emitCopy()
1698 void emitDispose(CodeGenFunction &CGF, llvm::Value *field) { in emitDispose() argument
1699 CGF.EmitARCDestroyStrong(field, ARCImpreciseLifetime); in emitDispose()
1720 void emitCopy(CodeGenFunction &CGF, llvm::Value *destField, in emitCopy() argument
1723 CGF.EmitSynthesizedCXXCopyCtor(destField, srcField, CopyExpr); in emitCopy()
1726 void emitDispose(CodeGenFunction &CGF, llvm::Value *field) { in emitDispose() argument
1727 EHScopeStack::stable_iterator cleanupDepth = CGF.EHStack.stable_begin(); in emitDispose()
1728 CGF.PushDestructorCleanup(VarType, field); in emitDispose()
1729 CGF.PopCleanupBlocks(cleanupDepth); in emitDispose()
1739 generateByrefCopyHelper(CodeGenFunction &CGF, in generateByrefCopyHelper() argument
1743 ASTContext &Context = CGF.getContext(); in generateByrefCopyHelper()
1755 CGF.CGM.getTypes().arrangeFunctionDeclaration(R, args, in generateByrefCopyHelper()
1759 CodeGenTypes &Types = CGF.CGM.getTypes(); in generateByrefCopyHelper()
1766 "__Block_byref_object_copy_", &CGF.CGM.getModule()); in generateByrefCopyHelper()
1778 CGF.StartFunction(FD, R, Fn, FI, args, SourceLocation()); in generateByrefCopyHelper()
1784 llvm::Value *destField = CGF.GetAddrOfLocalVar(&dst); in generateByrefCopyHelper()
1785 destField = CGF.Builder.CreateLoad(destField); in generateByrefCopyHelper()
1786 destField = CGF.Builder.CreateBitCast(destField, byrefPtrType); in generateByrefCopyHelper()
1787 destField = CGF.Builder.CreateStructGEP(destField, valueFieldIndex, "x"); in generateByrefCopyHelper()
1790 llvm::Value *srcField = CGF.GetAddrOfLocalVar(&src); in generateByrefCopyHelper()
1791 srcField = CGF.Builder.CreateLoad(srcField); in generateByrefCopyHelper()
1792 srcField = CGF.Builder.CreateBitCast(srcField, byrefPtrType); in generateByrefCopyHelper()
1793 srcField = CGF.Builder.CreateStructGEP(srcField, valueFieldIndex, "x"); in generateByrefCopyHelper()
1795 byrefInfo.emitCopy(CGF, destField, srcField); in generateByrefCopyHelper()
1798 CGF.FinishFunction(); in generateByrefCopyHelper()
1800 return llvm::ConstantExpr::getBitCast(Fn, CGF.Int8PtrTy); in generateByrefCopyHelper()
1808 CodeGenFunction CGF(CGM); in buildByrefCopyHelper() local
1809 return generateByrefCopyHelper(CGF, byrefType, byrefValueIndex, info); in buildByrefCopyHelper()
1814 generateByrefDisposeHelper(CodeGenFunction &CGF, in generateByrefDisposeHelper() argument
1818 ASTContext &Context = CGF.getContext(); in generateByrefDisposeHelper()
1826 CGF.CGM.getTypes().arrangeFunctionDeclaration(R, args, in generateByrefDisposeHelper()
1830 CodeGenTypes &Types = CGF.CGM.getTypes(); in generateByrefDisposeHelper()
1838 &CGF.CGM.getModule()); in generateByrefDisposeHelper()
1849 CGF.StartFunction(FD, R, Fn, FI, args, SourceLocation()); in generateByrefDisposeHelper()
1852 llvm::Value *V = CGF.GetAddrOfLocalVar(&src); in generateByrefDisposeHelper()
1853 V = CGF.Builder.CreateLoad(V); in generateByrefDisposeHelper()
1854 V = CGF.Builder.CreateBitCast(V, byrefType.getPointerTo(0)); in generateByrefDisposeHelper()
1855 V = CGF.Builder.CreateStructGEP(V, byrefValueIndex, "x"); in generateByrefDisposeHelper()
1857 byrefInfo.emitDispose(CGF, V); in generateByrefDisposeHelper()
1860 CGF.FinishFunction(); in generateByrefDisposeHelper()
1862 return llvm::ConstantExpr::getBitCast(Fn, CGF.Int8PtrTy); in generateByrefDisposeHelper()
1870 CodeGenFunction CGF(CGM); in buildByrefDisposeHelper() local
1871 return generateByrefDisposeHelper(CGF, byrefType, byrefValueIndex, info); in buildByrefDisposeHelper()
2221 void Emit(CodeGenFunction &CGF, Flags flags) { in Emit()
2223 CGF.BuildBlockRelease(Addr, BLOCK_FIELD_IS_BYREF); in Emit()