Lines Matching +defs:variable +defs:value

43 /// Given the address of a variable of pointer type, find the correct
94 // and cast value to correct type
176 llvm::Value *value = EmitScalarExpr(Rhs);
177 EmitStoreThroughLValue(RValue::get(value), LV, true);
179 NeededObjects.push_back(value);
189 // Emit the value and store it to the appropriate array slot.
295 // receiver is loaded from a variable with precise lifetime.
349 /// immediately loaded from an ARC __weak l-value.
375 /// generate a call and return the resulting value. Otherwise it will return
584 // a __weak variable, peephole the entire operation to objc_loadWeakRetained.
598 // safe because the receiver value is always loaded from 'self',
668 // value. We have to do this after emitting the other call
704 // the call back into self. This takes ownership of the value.
817 /// into the return value slot.
1070 // reference, in which case the result will be a gl-value. We should
1117 // this returns an undefined/poison value; this matches behavior prior to `_cmd`
1125 // value. This will be passed to objc_getProperty/objc_setProperty, which
1197 // Store that value into the return address. Doing this with a
1280 // The return value slot is guaranteed to not be aliased, but
1288 llvm::Value *value;
1290 value = LV.getAddress().emitRawPointer(*this);
1295 value = emitARCRetainLoadOfScalar(*this, LV, ivarType);
1297 value = EmitARCLoadWeak(LV.getAddress());
1303 value = EmitLoadOfLValue(LV, SourceLocation()).getScalarVal();
1307 value = Builder.CreateBitCast(
1308 value, ConvertType(GetterMethodDecl->getReturnType()));
1311 EmitReturnOfRValue(RValue::get(value), propType);
1322 /// emitStructSetterCall - Call the runtime function to store the value
1337 // The second argument is the address of the parameter variable.
1365 /// the value from the first formal parameter into the given ivar, using
1381 // The second argument is the address of the parameter variable.
1776 // The local variable comes into scope immediately.
1777 AutoVarEmission variable = AutoVarEmission::invalid();
1779 variable = EmitAutoVarAlloca(*cast<VarDecl>(SD->getSingleDecl()));
1863 // Save the initial mutations value. This is the value at an
1891 // Check whether the mutations value has changed from where it was
1921 // Initialize the element variable.
1927 // Initialize the variable, in case it's a __block variable or something.
1928 EmitAutoVarInit(variable);
1954 // Fetch the value at the current index from the buffer.
1994 // Cast that value to the right type.
1998 // Make sure we have an l-value. Yes, this gets evaluated every
2008 // If we do have an element variable, this assignment is the end of
2011 EmitAutoVarCleanups(variable);
2021 // Destroy the element variable now.
2116 llvm::Value *value) {
2117 return EmitARCRetainAutorelease(type, value);
2169 CodeGenFunction &CGF, llvm::Value *value, llvm::Type *returnType,
2172 if (isa<llvm::ConstantPointerNull>(value))
2173 return value;
2179 llvm::Type *origType = returnType ? returnType : value->getType();
2180 value = CGF.Builder.CreateBitCast(value, CGF.Int8PtrTy);
2183 llvm::CallInst *call = CGF.EmitNounwindRuntimeCall(fn, value);
2204 llvm::Value *value,
2208 assert(addr.getElementType() == value->getType());
2213 llvm::Type *origType = value->getType();
2217 CGF.Builder.CreateBitCast(value, CGF.Int8PtrTy)};
2245 llvm::Value *value,
2249 if (isa<llvm::ConstantPointerNull>(value))
2250 return value;
2264 llvm::Type *origType = returnType ? returnType : value->getType();
2265 value = CGF.Builder.CreateBitCast(value, CGF.Int8PtrTy);
2268 llvm::CallBase *Inst = CGF.EmitCallOrInvoke(fn, value);
2281 /// call i8* \@objc_retain(i8* %value)
2282 /// call i8* \@objc_retainBlock(i8* %value)
2283 llvm::Value *CodeGenFunction::EmitARCRetain(QualType type, llvm::Value *value) {
2285 return EmitARCRetainBlock(value, /*mandatory*/ false);
2287 return EmitARCRetainNonBlock(value);
2291 /// call i8* \@objc_retain(i8* %value)
2292 llvm::Value *CodeGenFunction::EmitARCRetainNonBlock(llvm::Value *value) {
2293 return emitARCValueOperation(*this, value, nullptr,
2299 /// call i8* \@objc_retainBlock(i8* %value)
2304 llvm::Value *CodeGenFunction::EmitARCRetainBlock(llvm::Value *value,
2307 = emitARCValueOperation(*this, value, nullptr,
2330 // do something with the autoreleased return value.
2368 static llvm::Value *emitOptimizedARCReturnCall(llvm::Value *value,
2394 auto *oldCall = cast<llvm::CallBase>(value);
2408 return emitARCValueOperation(CGF, value, nullptr, EP, IID, tailKind);
2412 /// call i8* \@objc_retainAutoreleasedReturnValue(i8* %value)
2417 CodeGenFunction::EmitARCRetainAutoreleasedReturnValue(llvm::Value *value) {
2418 return emitOptimizedARCReturnCall(value, true, *this);
2421 /// Claim a possibly-autoreleased return value at +0. This is only
2424 /// the value is ignored, or when it is being assigned to an
2425 /// __unsafe_unretained variable.
2427 /// call i8* \@objc_unsafeClaimAutoreleasedReturnValue(i8* %value)
2429 CodeGenFunction::EmitARCUnsafeClaimAutoreleasedReturnValue(llvm::Value *value) {
2430 return emitOptimizedARCReturnCall(value, false, *this);
2434 /// call void \@objc_release(i8* %value)
2435 void CodeGenFunction::EmitARCRelease(llvm::Value *value,
2437 if (isa<llvm::ConstantPointerNull>(value)) return;
2444 value = Builder.CreateBitCast(value, Int8PtrTy);
2447 llvm::CallInst *call = EmitNounwindRuntimeCall(fn, value);
2455 /// Destroy a __strong variable.
2472 llvm::Value *value = Builder.CreateLoad(addr);
2473 EmitARCRelease(value, precise);
2477 /// call void \@objc_storeStrong(i8** %addr, i8* %value)
2479 llvm::Value *value,
2481 assert(addr.getElementType() == value->getType());
2489 Builder.CreateBitCast(value, Int8PtrTy)};
2493 return value;
2497 /// call void \@objc_storeStrong(i8** %addr, i8* %value)
2516 // Retain the new value.
2519 // Read the old value.
2523 // see the old value.
2526 // Finally, release the old value.
2533 /// call i8* \@objc_autorelease(i8* %value)
2534 llvm::Value *CodeGenFunction::EmitARCAutorelease(llvm::Value *value) {
2535 return emitARCValueOperation(*this, value, nullptr,
2541 /// call i8* \@objc_autoreleaseReturnValue(i8* %value)
2543 CodeGenFunction::EmitARCAutoreleaseReturnValue(llvm::Value *value) {
2544 return emitARCValueOperation(*this, value, nullptr,
2551 /// call i8* \@objc_retainAutoreleaseReturnValue(i8* %value)
2553 CodeGenFunction::EmitARCRetainAutoreleaseReturnValue(llvm::Value *value) {
2554 return emitARCValueOperation(*this, value, nullptr,
2561 /// call i8* \@objc_retainAutorelease(i8* %value)
2563 /// %retain = call i8* \@objc_retainBlock(i8* %value)
2566 llvm::Value *value) {
2568 return EmitARCRetainAutoreleaseNonBlock(value);
2570 if (isa<llvm::ConstantPointerNull>(value)) return value;
2572 llvm::Type *origType = value->getType();
2573 value = Builder.CreateBitCast(value, Int8PtrTy);
2574 value = EmitARCRetainBlock(value, /*mandatory*/ true);
2575 value = EmitARCAutorelease(value);
2576 return Builder.CreateBitCast(value, origType);
2580 /// call i8* \@objc_retainAutorelease(i8* %value)
2582 CodeGenFunction::EmitARCRetainAutoreleaseNonBlock(llvm::Value *value) {
2583 return emitARCValueOperation(*this, value, nullptr,
2603 /// i8* \@objc_storeWeak(i8** %addr, i8* %value)
2604 /// Returns %value.
2606 llvm::Value *value,
2608 return emitARCStoreOperation(*this, addr, value,
2613 /// i8* \@objc_initWeak(i8** %addr, i8* %value)
2614 /// Returns %value. %addr is known to not have a current weak entry.
2616 /// *addr = nil; objc_storeWeak(addr, value);
2617 void CodeGenFunction::EmitARCInitWeak(Address addr, llvm::Value *value) {
2622 if (isa<llvm::ConstantPointerNull>(value) &&
2624 Builder.CreateStore(value, addr);
2628 emitARCStoreOperation(*this, addr, value,
2644 /// Disregards the current value in %dest. Leaves %src pointing to nothing.
2653 /// Disregards the current value in %dest. Essentially
2688 void CodeGenFunction::EmitObjCAutoreleasePoolPop(llvm::Value *value) {
2689 assert(value->getType() == Int8PtrTy);
2703 EmitRuntimeCallOrInvoke(fn, value);
2709 EmitRuntimeCall(fn, value);
2742 /// call i8* \@objc_alloc(i8* %value)
2743 llvm::Value *CodeGenFunction::EmitObjCAlloc(llvm::Value *value,
2745 return emitObjCValueOperation(*this, value, resultType,
2751 /// call i8* \@objc_allocWithZone(i8* %value)
2752 llvm::Value *CodeGenFunction::EmitObjCAllocWithZone(llvm::Value *value,
2754 return emitObjCValueOperation(*this, value, resultType,
2759 llvm::Value *CodeGenFunction::EmitObjCAllocInit(llvm::Value *value,
2761 return emitObjCValueOperation(*this, value, resultType,
2796 llvm::Value *value = CGF.Builder.CreateLoad(addr);
2797 CGF.EmitARCIntrinsicUse(value);
2801 /// call i8* \@objc_autorelease(i8* %value)
2802 llvm::Value *CodeGenFunction::EmitObjCAutorelease(llvm::Value *value,
2805 *this, value, returnType,
2811 /// call i8* \@objc_retain(i8* %value)
2812 llvm::Value *CodeGenFunction::EmitObjCRetainNonBlock(llvm::Value *value,
2815 *this, value, returnType,
2820 /// call void \@objc_release(i8* %value)
2821 void CodeGenFunction::EmitObjCRelease(llvm::Value *value,
2823 if (isa<llvm::ConstantPointerNull>(value)) return;
2838 value = Builder.CreateBitCast(value, Int8PtrTy);
2841 llvm::CallBase *call = EmitCallOrInvoke(fn, value);
2930 // As a very special optimization, in ARC++, if the l-value is the
2941 // loading it because we are not guaranteed to have an l-value. One of such
2942 // cases is DeclRefExpr referencing non-odr-used constant-evaluated variable.
2954 llvm::Value *value)>
2962 llvm::Value *value,
2966 auto *callBase = dyn_cast<llvm::CallBase>(value);
2970 value = doFallback(CGF, value);
2971 } else if (llvm::CallInst *call = dyn_cast<llvm::CallInst>(value)) {
2975 value = doAfterCall(CGF, value);
2976 } else if (llvm::InvokeInst *invoke = dyn_cast<llvm::InvokeInst>(value)) {
2980 value = doAfterCall(CGF, value);
2984 } else if (llvm::BitCastInst *bitcast = dyn_cast<llvm::BitCastInst>(value)) {
2991 value = bitcast;
2993 auto *phi = dyn_cast<llvm::PHINode>(value);
3002 value = phi;
3007 value = doFallback(CGF, value);
3012 return value;
3019 llvm::Value *value = CGF.EmitScalarExpr(e);
3020 return emitARCOperationAfterCall(CGF, value,
3021 [](CodeGenFunction &CGF, llvm::Value *value) {
3022 return CGF.EmitARCRetainAutoreleasedReturnValue(value);
3024 [](CodeGenFunction &CGF, llvm::Value *value) {
3025 return CGF.EmitARCRetainNonBlock(value);
3033 llvm::Value *value = CGF.EmitScalarExpr(e);
3034 return emitARCOperationAfterCall(CGF, value,
3035 [](CodeGenFunction &CGF, llvm::Value *value) {
3036 return CGF.EmitARCUnsafeClaimAutoreleasedReturnValue(value);
3038 [](CodeGenFunction &CGF, llvm::Value *value) {
3039 return value;
3049 llvm::Value *value = emitARCRetainCallResult(*this, E);
3050 return EmitObjCConsumeObject(E->getType(), value);
3142 // If this semantic expression is an opaque value, bind it
3260 /// stores into the unsafe variable, and propagates the result outward.
3348 llvm::Value *value = result.getPointer();
3349 value = CGF.Builder.CreateBitCast(value, resultType);
3350 result.setPointer(value);
3377 /// value is copied as a block, so there's a little filter here.
3379 llvm::Value *result; // will be a +0 value
3382 // block-copied value, emit the sub-expression at +0.
3390 // If that produced a retained value, just use that.
3437 llvm::Value *value = result.getPointer();
3439 value = CGF.EmitARCRetain(type, value);
3440 return value;
3455 llvm::Value *value = result.getPointer();
3457 value = EmitARCRetain(e->getType(), value);
3458 return value;
3470 llvm::Value *value = result.getPointer();
3472 value = EmitARCAutorelease(value);
3474 value = EmitARCRetainAutorelease(e->getType(), value);
3475 return value;
3520 llvm::Value *getValueOfResult(llvm::Value *value) {
3521 return value;
3524 llvm::Value *emitBitCast(llvm::Value *value, llvm::Type *resultType) {
3525 return CGF.Builder.CreateBitCast(value, resultType);
3535 llvm::Value *value = CGF.EmitScalarExpr(e);
3536 return CGF.EmitObjCConsumeObject(e->getType(), value);
3587 llvm::Value *value;
3589 value = EmitARCUnsafeUnretainedScalarExpr(e->getRHS());
3591 value = EmitScalarExpr(e->getRHS());
3596 EmitStoreOfScalar(value, lvalue);
3598 return std::pair<LValue,llvm::Value*>(std::move(lvalue), value);
3606 llvm::Value *value = result.getPointer();
3610 // If we didn't emit a retained object, and the l-value is of block
3612 // it invalidates the l-value.
3614 value = EmitARCRetainBlock(value, /*mandatory*/ false);
3623 EmitStoreOfScalar(value, lvalue);
3626 value = EmitARCStoreStrong(lvalue, value, ignored);
3629 return std::pair<LValue,llvm::Value*>(lvalue, value);
3634 llvm::Value *value = EmitARCRetainAutoreleaseScalarExpr(e->getRHS());
3637 EmitStoreOfScalar(value, lvalue);
3639 return std::pair<LValue,llvm::Value*>(lvalue, value);