Lines Matching defs:capture
85 const BlockDecl::Capture *CI;
86 const CGBlockInfo::Capture *Capture;
92 const BlockDecl::Capture &CI,
93 const CGBlockInfo::Capture &Capture)
95 DisposeFlags(DisposeFlags), CI(&CI), Capture(&Capture) {}
98 return Capture->getOffset() < Other.Capture->getOffset();
139 Name += llvm::to_string(E.Capture->getOffset().getQuantity());
142 // If CopyKind and DisposeKind are the same, merge the capture
339 /// A chunk of data that we actually have to capture in the block.
344 const BlockDecl::Capture *Capture; // null for 'this'
350 const BlockDecl::Capture *capture,
353 Capture(capture), Type(type), FieldType(fieldType) {}
357 if (!Capture) {
361 auto C = CGBlockInfo::Capture::makeIndex(index, offset, FieldType);
362 info.Captures.insert({Capture->getVariable(), C});
374 if (chunk.Capture && chunk.Capture->isByRef())
387 /// Determines if the given type is safe for constant capture in C++.
434 // invalid?), it's not clear what we should do. Maybe capture as
504 const BlockDecl::Capture &CI) {
508 // use the type of the capture field.
554 "Can't capture 'this' outside a method");
581 // the capture field type should always match.
583 "capture type differs from the variable type");
593 info.Captures[variable] = CGBlockInfo::Capture::makeConstant(constant);
599 // If we have a lifetime qualifier, honor it for capture purposes.
813 // If there is nothing to capture, we can emit this as a global block.
899 // Finally, capture all the values into the block.
912 const CGBlockInfo::Capture &capture = blockInfo.getCapture(variable);
915 if (capture.isConstant()) continue;
917 QualType type = capture.fieldType();
921 Address blockField = projectField(capture.getIndex(), "block.captured");
928 // The lambda capture in a lambda's conversion-to-block-pointer is
933 // We need to use the capture from the enclosing block.
934 const CGBlockInfo::Capture &enclosingCapture =
940 "block.capture.addr");
962 byrefPointer = Builder.CreateLoad(src, "byref.capture");
966 // Write that void* into the capture field.
1035 // Push a cleanup for the capture if necessary.
1074 // Extend the lifetime of the capture to the end of the scope enclosing the
1247 const CGBlockInfo::Capture &capture = BlockInfo->getCapture(variable);
1250 if (capture.isConstant()) return LocalDeclMap.find(variable)->second;
1252 Address addr = Builder.CreateStructGEP(LoadBlockStruct(), capture.getIndex(),
1253 "block.capture.addr");
1270 capture.fieldType()->isReferenceType()) &&
1271 "the capture field of a non-escaping variable should have a "
1273 if (capture.fieldType()->isReferenceType())
1274 addr = EmitLoadOfReference(MakeAddrLValue(addr, capture.fieldType()));
1546 const CGBlockInfo::Capture &capture = blockInfo.getCapture(variable);
1547 if (!capture.isConstant()) continue;
1553 Builder.CreateStore(capture.getConstant(), alloca);
1586 const CGBlockInfo::Capture &capture = blockInfo.getCapture(variable);
1587 if (capture.isConstant()) {
1616 computeCopyInfoForBlockCapture(const BlockDecl::Capture &CI, QualType T,
1673 computeDestroyInfoForBlockCapture(const BlockDecl::Capture &CI, QualType T,
1682 const CGBlockInfo::Capture &Capture = BlockInfo.getCapture(Variable);
1683 if (Capture.isConstant())
1686 QualType VT = Capture.fieldType();
1693 Capture);
1734 // Return a string that has the information about a capture.
1741 const BlockDecl::Capture &CI = *E.CI;
1807 BlockAlignment.alignmentAtOffset(E.Capture->getOffset());
1847 Name += llvm::to_string(E.Capture->getOffset().getQuantity());
1979 const BlockDecl::Capture &CI = *CopiedCapture.CI;
1980 const CGBlockInfo::Capture &capture = *CopiedCapture.Capture;
1984 unsigned index = capture.getIndex();
2061 getBlockFieldFlagsForObjCObjectPointer(const BlockDecl::Capture &CI,
2070 computeDestroyInfoForBlockCapture(const BlockDecl::Capture &CI, QualType T,
2174 const BlockDecl::Capture &CI = *DestroyedCapture.CI;
2175 const CGBlockInfo::Capture &capture = *DestroyedCapture.Capture;
2178 Address srcField = Builder.CreateStructGEP(src, capture.getIndex());