Lines Matching full:capture
81 static std::string getBlockCaptureStr(const CGBlockInfo::Capture &Cap,
105 // If CopyKind and DisposeKind are the same, merge the capture in getBlockDescriptorName()
308 /// A chunk of data that we actually have to capture in the block.
312 const BlockDecl::Capture *Capture; // null for 'this' member
319 const BlockDecl::Capture *capture, llvm::Type *type, in BlockLayoutChunk()
324 : Alignment(align), Size(size), Capture(capture), Type(type), in BlockLayoutChunk()
330 if (!Capture) { in setIndex()
334 info.SortedCaptures.push_back(CGBlockInfo::Capture::makeIndex( in setIndex()
336 DisposeFlags, Capture)); in setIndex()
382 computeCopyInfoForBlockCapture(const BlockDecl::Capture &CI, QualType T,
386 computeDestroyInfoForBlockCapture(const BlockDecl::Capture &CI, QualType T,
390 const BlockDecl::Capture *capture, llvm::Type *type, in addBlockLayout() argument
394 if (!capture) { in addBlockLayout()
395 // 'this' capture. in addBlockLayout()
397 align, size, capture, type, fieldType, BlockCaptureEntityKind::None, in addBlockLayout()
407 computeCopyInfoForBlockCapture(*capture, fieldType, LangOpts); in addBlockLayout()
409 computeDestroyInfoForBlockCapture(*capture, fieldType, LangOpts); in addBlockLayout()
410 Layout.push_back(BlockLayoutChunk(align, size, capture, type, fieldType, in addBlockLayout()
421 /// Determines if the given type is safe for constant capture in C++.
468 // invalid?), it's not clear what we should do. Maybe capture as in tryCaptureAsConstant()
536 const BlockDecl::Capture &CI) { in getCaptureFieldType()
540 // use the type of the capture field. in getCaptureFieldType()
589 "Can't capture 'this' outside a method"); in computeBlockInfo()
612 // the capture field type should always match. in computeBlockInfo()
614 "capture type differs from the variable type"); in computeBlockInfo()
624 CGBlockInfo::Capture::makeConstant(constant, &CI)); in computeBlockInfo()
800 // If there is nothing to capture, we can emit this as a global block. in EmitBlockLiteral()
887 // Finally, capture all the values into the block. in EmitBlockLiteral()
900 const CGBlockInfo::Capture &capture = blockInfo.getCapture(variable); in EmitBlockLiteral() local
903 if (capture.isConstant()) continue; in EmitBlockLiteral()
905 QualType type = capture.fieldType(); in EmitBlockLiteral()
909 Address blockField = projectField(capture.getIndex(), "block.captured"); in EmitBlockLiteral()
916 // The lambda capture in a lambda's conversion-to-block-pointer is in EmitBlockLiteral()
921 // We need to use the capture from the enclosing block. in EmitBlockLiteral()
922 const CGBlockInfo::Capture &enclosingCapture = in EmitBlockLiteral()
928 "block.capture.addr"); in EmitBlockLiteral()
950 byrefPointer = Builder.CreateLoad(src, "byref.capture"); in EmitBlockLiteral()
954 // Write that void* into the capture field. in EmitBlockLiteral()
1023 // Push a cleanup for the capture if necessary. in EmitBlockLiteral()
1062 // Extend the lifetime of the capture to the end of the scope enclosing the in EmitBlockLiteral()
1228 const CGBlockInfo::Capture &capture = BlockInfo->getCapture(variable); in GetAddrOfBlockDecl() local
1231 if (capture.isConstant()) return LocalDeclMap.find(variable)->second; in GetAddrOfBlockDecl()
1233 Address addr = Builder.CreateStructGEP(LoadBlockStruct(), capture.getIndex(), in GetAddrOfBlockDecl()
1234 "block.capture.addr"); in GetAddrOfBlockDecl()
1249 capture.fieldType()->isReferenceType()) && in GetAddrOfBlockDecl()
1250 "the capture field of a non-escaping variable should have a " in GetAddrOfBlockDecl()
1252 if (capture.fieldType()->isReferenceType()) in GetAddrOfBlockDecl()
1253 addr = EmitLoadOfReference(MakeAddrLValue(addr, capture.fieldType())); in GetAddrOfBlockDecl()
1526 const CGBlockInfo::Capture &capture = blockInfo.getCapture(variable); in GenerateBlockFunction() local
1527 if (!capture.isConstant()) continue; in GenerateBlockFunction()
1533 Builder.CreateStore(capture.getConstant(), alloca); in GenerateBlockFunction()
1569 const CGBlockInfo::Capture &capture = blockInfo.getCapture(variable); in GenerateBlockFunction() local
1570 if (capture.isConstant()) { in GenerateBlockFunction()
1599 computeCopyInfoForBlockCapture(const BlockDecl::Capture &CI, QualType T, in computeCopyInfoForBlockCapture()
1693 // Return a string that has the information about a capture.
1694 static std::string getBlockCaptureStr(const CGBlockInfo::Capture &Cap, in getBlockCaptureStr()
1700 const BlockDecl::Capture &CI = *Cap.Cap; in getBlockCaptureStr()
1791 const SmallVectorImpl<CGBlockInfo::Capture> &Captures, in getCopyDestroyHelperFuncName()
1927 for (auto &capture : blockInfo.SortedCaptures) { in GenerateCopyHelperFunction() local
1928 if (capture.isConstantOrTrivial()) in GenerateCopyHelperFunction()
1931 const BlockDecl::Capture &CI = *capture.Cap; in GenerateCopyHelperFunction()
1933 BlockFieldFlags flags = capture.CopyFlags; in GenerateCopyHelperFunction()
1935 unsigned index = capture.getIndex(); in GenerateCopyHelperFunction()
1939 switch (capture.CopyKind) { in GenerateCopyHelperFunction()
2002 pushCaptureCleanup(capture.CopyKind, dstField, captureType, flags, in GenerateCopyHelperFunction()
2012 getBlockFieldFlagsForObjCObjectPointer(const BlockDecl::Capture &CI, in getBlockFieldFlagsForObjCObjectPointer()
2021 computeDestroyInfoForBlockCapture(const BlockDecl::Capture &CI, QualType T, in computeDestroyInfoForBlockCapture()
2113 for (auto &capture : blockInfo.SortedCaptures) { in GenerateDestroyHelperFunction() local
2114 if (capture.isConstantOrTrivial()) in GenerateDestroyHelperFunction()
2117 const BlockDecl::Capture &CI = *capture.Cap; in GenerateDestroyHelperFunction()
2118 BlockFieldFlags flags = capture.DisposeFlags; in GenerateDestroyHelperFunction()
2120 Address srcField = Builder.CreateStructGEP(src, capture.getIndex()); in GenerateDestroyHelperFunction()
2122 pushCaptureCleanup(capture.DisposeKind, srcField, in GenerateDestroyHelperFunction()