Lines Matching defs:capture

104         // If CopyKind and DisposeKind are the same, merge the capture
307 /// A chunk of data that we actually have to capture in the block.
318 const BlockDecl::Capture *capture, llvm::Type *type,
323 : Alignment(align), Size(size), Capture(capture), Type(type),
389 const BlockDecl::Capture *capture, llvm::Type *type,
393 if (!capture) {
394 // 'this' capture.
396 align, size, capture, type, fieldType, BlockCaptureEntityKind::None,
406 computeCopyInfoForBlockCapture(*capture, fieldType, LangOpts);
408 computeDestroyInfoForBlockCapture(*capture, fieldType, LangOpts);
409 Layout.push_back(BlockLayoutChunk(align, size, capture, type, fieldType,
420 /// Determines if the given type is safe for constant capture in C++.
467 // invalid?), it's not clear what we should do. Maybe capture as
539 // use the type of the capture field.
588 "Can't capture 'this' outside a method");
611 // the capture field type should always match.
613 "capture type differs from the variable type");
799 // If there is nothing to capture, we can emit this as a global block.
886 // Finally, capture all the values into the block.
899 const CGBlockInfo::Capture &capture = blockInfo.getCapture(variable);
902 if (capture.isConstant()) continue;
904 QualType type = capture.fieldType();
908 Address blockField = projectField(capture.getIndex(), "block.captured");
915 // The lambda capture in a lambda's conversion-to-block-pointer is
920 // We need to use the capture from the enclosing block.
927 "block.capture.addr");
949 byrefPointer = Builder.CreateLoad(src, "byref.capture");
953 // Write that void* into the capture field.
1022 // Push a cleanup for the capture if necessary.
1061 // Extend the lifetime of the capture to the end of the scope enclosing the
1228 const CGBlockInfo::Capture &capture = BlockInfo->getCapture(variable);
1231 if (capture.isConstant()) return LocalDeclMap.find(variable)->second;
1233 Address addr = Builder.CreateStructGEP(LoadBlockStruct(), capture.getIndex(),
1234 "block.capture.addr");
1249 capture.fieldType()->isReferenceType()) &&
1250 "the capture field of a non-escaping variable should have a "
1252 if (capture.fieldType()->isReferenceType())
1253 addr = EmitLoadOfReference(MakeAddrLValue(addr, capture.fieldType()));
1527 const CGBlockInfo::Capture &capture = blockInfo.getCapture(variable);
1528 if (!capture.isConstant()) continue;
1534 Builder.CreateStore(capture.getConstant(), alloca);
1570 const CGBlockInfo::Capture &capture = blockInfo.getCapture(variable);
1571 if (capture.isConstant()) {
1694 // Return a string that has the information about a capture.
1928 for (auto &capture : blockInfo.SortedCaptures) {
1929 if (capture.isConstantOrTrivial())
1932 const BlockDecl::Capture &CI = *capture.Cap;
1934 BlockFieldFlags flags = capture.CopyFlags;
1936 unsigned index = capture.getIndex();
1940 switch (capture.CopyKind) {
2003 pushCaptureCleanup(capture.CopyKind, dstField, captureType, flags,
2114 for (auto &capture : blockInfo.SortedCaptures) {
2115 if (capture.isConstantOrTrivial())
2118 const BlockDecl::Capture &CI = *capture.Cap;
2119 BlockFieldFlags flags = capture.DisposeFlags;
2121 Address srcField = Builder.CreateStructGEP(src, capture.getIndex());
2123 pushCaptureCleanup(capture.DisposeKind, srcField,