Lines Matching +defs:variable +defs:value
167 // If an equivalent block descriptor global variable exists, return it.
175 // If there isn't an equivalent block descriptor global variable, create a new
456 // We can only do this if the variable is const.
467 // If the variable doesn't have any initializer (shouldn't this be
509 unsigned Align = CGM.getDataLayout().getABITypeAlign(I).value();
539 // If the variable is captured by an enclosing block or lambda expression,
545 // If the captured variable is a non-escaping __block variable, the field
546 // type is the reference type. If the variable is a __block variable that
547 // already has a reference type, the field type is the variable's type.
604 const VarDecl *variable = CI.getVariable();
611 // Since a __block variable cannot be captured by lambdas, its type and
613 assert(CGF && getCaptureFieldType(*CGF, CI) == variable->getType() &&
614 "capture type differs from the variable type");
616 variable->getType(), layout, info, CGM);
622 if (llvm::Constant *constant = tryCaptureAsConstant(CGM, CGF, variable)) {
639 CharUnits align = C.getDeclAlign(variable);
746 // an over-aligned variable. We will be adding a padding field to
771 // The block literal is emitted as a global variable, and the block invoke
842 auto storeField = [&](llvm::Value *value, unsigned index, const Twine &name) {
843 Builder.CreateStore(value, projectField(index, name));
851 auto addHeaderField = [&](llvm::Value *value, CharUnits size,
853 storeField(value, index, name);
899 const VarDecl *variable = CI.getVariable();
900 const CGBlockInfo::Capture &capture = blockInfo.getCapture(variable);
923 BlockInfo->getCapture(variable);
930 auto I = LocalDeclMap.find(variable);
935 DeclRefExpr declRef(getContext(), const_cast<VarDecl *>(variable),
973 // If it's a reference variable, copy the reference into the block field.
977 // If type is const-qualified, copy the value into the block field.
981 llvm::Value *value = Builder.CreateLoad(src, "captured");
982 Builder.CreateStore(value, blockField);
984 // If this is an ARC __strong block-pointer variable, don't do a
989 // variable, because the local variable's lifetime should be strictly
994 llvm::Value *value = Builder.CreateLoad(src, "block.captured_block");
995 value = EmitARCRetainNonBlock(value);
998 Builder.CreateStore(value, blockField);
1002 // Fake up a new variable so that EmitScalarInit doesn't think
1003 // we're referring to the variable in its own initializer.
1009 DeclRefExpr declRef(getContext(), const_cast<VarDecl *>(variable),
1226 Address CodeGenFunction::GetAddrOfBlockDecl(const VarDecl *variable) {
1228 const CGBlockInfo::Capture &capture = BlockInfo->getCapture(variable);
1231 if (capture.isConstant()) return LocalDeclMap.find(variable)->second;
1236 if (variable->isEscapingByref()) {
1240 auto &byrefInfo = getBlockByrefInfo(variable);
1245 variable->getName());
1248 assert((!variable->isNonEscapingByref() ||
1250 "the capture field of a non-escaping variable should have a "
1390 // Allocate a stack slot like for any local variable to guarantee optimal
1406 // Instead of messing around with LocalDeclMap, just set the value
1453 // For OpenCL passed block pointer can be private AS local variable or
1454 // global AS program scope variable (for the case with and without captures).
1525 const VarDecl *variable = CI.getVariable();
1526 const CGBlockInfo::Capture &capture = blockInfo.getCapture(variable);
1529 CharUnits align = getContext().getDeclAlign(variable);
1531 CreateMemTemp(variable->getType(), align, "block.captured-const");
1535 setAddrOfLocalVar(variable, alloca);
1565 const VarDecl *variable = CI.getVariable();
1566 DI->EmitLocation(Builder, variable->getLocation());
1569 const CGBlockInfo::Capture &capture = blockInfo.getCapture(variable);
1571 auto addr = LocalDeclMap.find(variable)->second;
1573 variable, addr.emitRawPointer(*this), Builder);
1578 variable, BlockPointerDbgLoc, Builder, blockInfo,
1627 // We need to retain the copied value for __strong direct captures.
1661 /// Release a __block variable.
1756 assert((F & BLOCK_FIELD_IS_OBJECT) && "unexpected flag value");
1877 /// the contents of an individual __block variable to the heap.
1942 assert(CI.getCopyExpr() && "copy expression for variable is missing");
2066 /// variable.
2162 llvm::Value *value = CGF.Builder.CreateLoad(field);
2164 CGF.BuildBlockRelease(value, Flags | BLOCK_BYREF_CALLER, false);
2172 /// Emits the copy/dispose helpers for an ARC __block __weak variable.
2192 /// Emits the copy/dispose helpers for an ARC __block __strong variable
2200 // Do a "move" by copying the value and then zeroing out the old
2201 // variable.
2203 llvm::Value *value = CGF.Builder.CreateLoad(srcField);
2206 llvm::ConstantPointerNull::get(cast<llvm::PointerType>(value->getType()));
2210 CGF.EmitARCStoreStrongCall(destField, value, /*ignored*/ true);
2214 CGF.Builder.CreateStore(value, destField);
2229 /// variable that's of block-pointer type.
2255 /// Emits the copy/dispose helpers for a __block variable with a
2284 /// Emits the copy/dispose helpers for a __block variable that is a non-trivial
2373 /// Build the copy helper for a __block variable.
2381 /// Generate code for a __block variable's dispose helper.
2429 /// Build the dispose helper for a __block variable.
2437 /// Lazily build the copy and dispose helpers for a __block variable
2458 /// Build the copy and dispose helpers for the given __block variable
2473 // helpers is the alignment of the actual byref value field.
2571 /// BuildByrefInfo - This routine changes a __block variable declared as T x
2672 /// Initialize the structural components of a __block variable, i.e.
2683 auto storeHeaderField = [&](llvm::Value *value, CharUnits fieldSize,
2686 Builder.CreateStore(value, fieldAddr);
2712 // Store the address of the variable into its own forwarding pointer.
2741 printf("\n Inline flag for BYREF variable layout (%d):", flags.getBitMask());