Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 2c09040

Browse files
committed
Merge remote-tracking branch 'origin/swift-5.1-branch' into stable
2 parents 6c55728 + 8bae514 commit 2c09040

24 files changed

+241
-104
lines changed

lib/CodeGen/CGExpr.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,8 +1288,6 @@ LValue CodeGenFunction::EmitLValue(const Expr *E) {
12881288
return EmitCXXBindTemporaryLValue(cast<CXXBindTemporaryExpr>(E));
12891289
case Expr::CXXUuidofExprClass:
12901290
return EmitCXXUuidofLValue(cast<CXXUuidofExpr>(E));
1291-
case Expr::LambdaExprClass:
1292-
return EmitLambdaLValue(cast<LambdaExpr>(E));
12931291

12941292
case Expr::ExprWithCleanupsClass: {
12951293
const auto *cleanups = cast<ExprWithCleanups>(E);
@@ -4549,13 +4547,6 @@ CodeGenFunction::EmitCXXBindTemporaryLValue(const CXXBindTemporaryExpr *E) {
45494547
return MakeAddrLValue(Slot.getAddress(), E->getType(), AlignmentSource::Decl);
45504548
}
45514549

4552-
LValue
4553-
CodeGenFunction::EmitLambdaLValue(const LambdaExpr *E) {
4554-
AggValueSlot Slot = CreateAggTemp(E->getType(), "temp.lvalue");
4555-
EmitLambdaExpr(E, Slot);
4556-
return MakeAddrLValue(Slot.getAddress(), E->getType(), AlignmentSource::Decl);
4557-
}
4558-
45594550
LValue CodeGenFunction::EmitObjCMessageExprLValue(const ObjCMessageExpr *E) {
45604551
RValue RV = EmitObjCMessageExpr(E);
45614552

lib/CodeGen/CGExprAgg.cpp

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,52 @@ void AggExprEmitter::VisitCXXInheritedCtorInitExpr(
12641264
void
12651265
AggExprEmitter::VisitLambdaExpr(LambdaExpr *E) {
12661266
AggValueSlot Slot = EnsureSlot(E->getType());
1267-
CGF.EmitLambdaExpr(E, Slot);
1267+
LValue SlotLV = CGF.MakeAddrLValue(Slot.getAddress(), E->getType());
1268+
1269+
// We'll need to enter cleanup scopes in case any of the element
1270+
// initializers throws an exception.
1271+
SmallVector<EHScopeStack::stable_iterator, 16> Cleanups;
1272+
llvm::Instruction *CleanupDominator = nullptr;
1273+
1274+
CXXRecordDecl::field_iterator CurField = E->getLambdaClass()->field_begin();
1275+
for (LambdaExpr::const_capture_init_iterator i = E->capture_init_begin(),
1276+
e = E->capture_init_end();
1277+
i != e; ++i, ++CurField) {
1278+
// Emit initialization
1279+
LValue LV = CGF.EmitLValueForFieldInitialization(SlotLV, *CurField);
1280+
if (CurField->hasCapturedVLAType()) {
1281+
CGF.EmitLambdaVLACapture(CurField->getCapturedVLAType(), LV);
1282+
continue;
1283+
}
1284+
1285+
EmitInitializationToLValue(*i, LV);
1286+
1287+
// Push a destructor if necessary.
1288+
if (QualType::DestructionKind DtorKind =
1289+
CurField->getType().isDestructedType()) {
1290+
assert(LV.isSimple());
1291+
if (CGF.needsEHCleanup(DtorKind)) {
1292+
if (!CleanupDominator)
1293+
CleanupDominator = CGF.Builder.CreateAlignedLoad(
1294+
CGF.Int8Ty,
1295+
llvm::Constant::getNullValue(CGF.Int8PtrTy),
1296+
CharUnits::One()); // placeholder
1297+
1298+
CGF.pushDestroy(EHCleanup, LV.getAddress(), CurField->getType(),
1299+
CGF.getDestroyer(DtorKind), false);
1300+
Cleanups.push_back(CGF.EHStack.stable_begin());
1301+
}
1302+
}
1303+
}
1304+
1305+
// Deactivate all the partial cleanups in reverse order, which
1306+
// generally means popping them.
1307+
for (unsigned i = Cleanups.size(); i != 0; --i)
1308+
CGF.DeactivateCleanupBlock(Cleanups[i-1], CleanupDominator);
1309+
1310+
// Destroy the placeholder if we made one.
1311+
if (CleanupDominator)
1312+
CleanupDominator->eraseFromParent();
12681313
}
12691314

12701315
void AggExprEmitter::VisitExprWithCleanups(ExprWithCleanups *E) {

lib/CodeGen/CGExprCXX.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2252,21 +2252,3 @@ llvm::Value *CodeGenFunction::EmitDynamicCast(Address ThisAddr,
22522252

22532253
return Value;
22542254
}
2255-
2256-
void CodeGenFunction::EmitLambdaExpr(const LambdaExpr *E, AggValueSlot Slot) {
2257-
LValue SlotLV = MakeAddrLValue(Slot.getAddress(), E->getType());
2258-
2259-
CXXRecordDecl::field_iterator CurField = E->getLambdaClass()->field_begin();
2260-
for (LambdaExpr::const_capture_init_iterator i = E->capture_init_begin(),
2261-
e = E->capture_init_end();
2262-
i != e; ++i, ++CurField) {
2263-
// Emit initialization
2264-
LValue LV = EmitLValueForFieldInitialization(SlotLV, *CurField);
2265-
if (CurField->hasCapturedVLAType()) {
2266-
auto VAT = CurField->getCapturedVLAType();
2267-
EmitStoreThroughLValue(RValue::get(VLASizeMap[VAT->getSizeExpr()]), LV);
2268-
} else {
2269-
EmitInitializerForField(*CurField, LV, *i);
2270-
}
2271-
}
2272-
}

lib/CodeGen/CGObjC.cpp

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,12 +1959,10 @@ static void setARCRuntimeFunctionLinkage(CodeGenModule &CGM,
19591959
/// Perform an operation having the signature
19601960
/// i8* (i8*)
19611961
/// where a null input causes a no-op and returns null.
1962-
static llvm::Value *emitARCValueOperation(CodeGenFunction &CGF,
1963-
llvm::Value *value,
1964-
llvm::Type *returnType,
1965-
llvm::Constant *&fn,
1966-
llvm::Intrinsic::ID IntID,
1967-
bool isTailCall = false) {
1962+
static llvm::Value *emitARCValueOperation(
1963+
CodeGenFunction &CGF, llvm::Value *value, llvm::Type *returnType,
1964+
llvm::Constant *&fn, llvm::Intrinsic::ID IntID,
1965+
llvm::CallInst::TailCallKind tailKind = llvm::CallInst::TCK_None) {
19681966
if (isa<llvm::ConstantPointerNull>(value))
19691967
return value;
19701968

@@ -1979,8 +1977,7 @@ static llvm::Value *emitARCValueOperation(CodeGenFunction &CGF,
19791977

19801978
// Call the function.
19811979
llvm::CallInst *call = CGF.EmitNounwindRuntimeCall(fn, value);
1982-
if (isTailCall)
1983-
call->setTailCall();
1980+
call->setTailCallKind(tailKind);
19841981

19851982
// Cast the result back to the original type.
19861983
return CGF.Builder.CreateBitCast(call, origType);
@@ -2195,9 +2192,15 @@ static void emitAutoreleasedReturnValueMarker(CodeGenFunction &CGF) {
21952192
llvm::Value *
21962193
CodeGenFunction::EmitARCRetainAutoreleasedReturnValue(llvm::Value *value) {
21972194
emitAutoreleasedReturnValueMarker(*this);
2198-
return emitARCValueOperation(*this, value, nullptr,
2199-
CGM.getObjCEntrypoints().objc_retainAutoreleasedReturnValue,
2200-
llvm::Intrinsic::objc_retainAutoreleasedReturnValue);
2195+
llvm::CallInst::TailCallKind tailKind =
2196+
CGM.getTargetCodeGenInfo()
2197+
.shouldSuppressTailCallsOfRetainAutoreleasedReturnValue()
2198+
? llvm::CallInst::TCK_NoTail
2199+
: llvm::CallInst::TCK_None;
2200+
return emitARCValueOperation(
2201+
*this, value, nullptr,
2202+
CGM.getObjCEntrypoints().objc_retainAutoreleasedReturnValue,
2203+
llvm::Intrinsic::objc_retainAutoreleasedReturnValue, tailKind);
22012204
}
22022205

22032206
/// Claim a possibly-autoreleased return value at +0. This is only
@@ -2334,7 +2337,7 @@ CodeGenFunction::EmitARCAutoreleaseReturnValue(llvm::Value *value) {
23342337
return emitARCValueOperation(*this, value, nullptr,
23352338
CGM.getObjCEntrypoints().objc_autoreleaseReturnValue,
23362339
llvm::Intrinsic::objc_autoreleaseReturnValue,
2337-
/*isTailCall*/ true);
2340+
llvm::CallInst::TCK_Tail);
23382341
}
23392342

23402343
/// Do a fused retain/autorelease of the given object.
@@ -2344,7 +2347,7 @@ CodeGenFunction::EmitARCRetainAutoreleaseReturnValue(llvm::Value *value) {
23442347
return emitARCValueOperation(*this, value, nullptr,
23452348
CGM.getObjCEntrypoints().objc_retainAutoreleaseReturnValue,
23462349
llvm::Intrinsic::objc_retainAutoreleaseReturnValue,
2347-
/*isTailCall*/ true);
2350+
llvm::CallInst::TCK_Tail);
23482351
}
23492352

23502353
/// Do a fused retain/autorelease of the given object.

lib/CodeGen/CodeGenFunction.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,6 +1835,9 @@ class CodeGenFunction : public CodeGenTypeCache {
18351835
void EmitLambdaBlockInvokeBody();
18361836
void EmitLambdaDelegatingInvokeBody(const CXXMethodDecl *MD);
18371837
void EmitLambdaStaticInvokeBody(const CXXMethodDecl *MD);
1838+
void EmitLambdaVLACapture(const VariableArrayType *VAT, LValue LV) {
1839+
EmitStoreThroughLValue(RValue::get(VLASizeMap[VAT->getSizeExpr()]), LV);
1840+
}
18381841
void EmitAsanPrologueOrEpilogue(bool Prologue);
18391842

18401843
/// Emit the unified return block, trying to avoid its emission when
@@ -3549,7 +3552,6 @@ class CodeGenFunction : public CodeGenTypeCache {
35493552

35503553
LValue EmitCXXConstructLValue(const CXXConstructExpr *E);
35513554
LValue EmitCXXBindTemporaryLValue(const CXXBindTemporaryExpr *E);
3552-
LValue EmitLambdaLValue(const LambdaExpr *E);
35533555
LValue EmitCXXTypeidLValue(const CXXTypeidExpr *E);
35543556
LValue EmitCXXUuidofLValue(const CXXUuidofExpr *E);
35553557

@@ -3973,8 +3975,6 @@ class CodeGenFunction : public CodeGenTypeCache {
39733975

39743976
void EmitCXXThrowExpr(const CXXThrowExpr *E, bool KeepInsertionPoint = true);
39753977

3976-
void EmitLambdaExpr(const LambdaExpr *E, AggValueSlot Dest);
3977-
39783978
RValue EmitAtomicExpr(AtomicExpr *E);
39793979

39803980
//===--------------------------------------------------------------------===//

lib/CodeGen/TargetInfo.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2254,6 +2254,12 @@ class X86_64TargetCodeGenInfo : public TargetCodeGenInfo {
22542254
return static_cast<const X86_64ABIInfo&>(TargetCodeGenInfo::getABIInfo());
22552255
}
22562256

2257+
/// Disable tail call on x86-64. The epilogue code before the tail jump blocks
2258+
/// the autoreleaseRV/retainRV optimization.
2259+
bool shouldSuppressTailCallsOfRetainAutoreleasedReturnValue() const override {
2260+
return true;
2261+
}
2262+
22572263
int getDwarfEHStackPointer(CodeGen::CodeGenModule &CGM) const override {
22582264
return 7;
22592265
}

lib/CodeGen/TargetInfo.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,12 @@ class TargetCodeGenInfo {
157157
return "";
158158
}
159159

160+
/// Determine whether a call to objc_retainAutoreleasedReturnValue should be
161+
/// marked as 'notail'.
162+
virtual bool shouldSuppressTailCallsOfRetainAutoreleasedReturnValue() const {
163+
return false;
164+
}
165+
160166
/// Return a constant used by UBSan as a signature to identify functions
161167
/// possessing type information, or 0 if the platform is unsupported.
162168
virtual llvm::Constant *
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
// RUN: %clang_cc1 -std=c++1y -triple x86_64-linux-gnu -fexceptions -fcxx-exceptions -emit-llvm %s -o - | FileCheck %s
2+
3+
struct S {
4+
S();
5+
~S();
6+
};
7+
8+
struct T {
9+
T() noexcept;
10+
~T();
11+
int n;
12+
};
13+
14+
// CHECK-LABEL: define void @_Z1fv(
15+
void f() {
16+
// CHECK: call void @_ZN1SC1Ev(
17+
// CHECK: invoke void @__cxa_throw
18+
//
19+
// Ensure we call the lambda destructor here, and do not call the destructor
20+
// for the capture.
21+
// CHECK: landingpad
22+
// CHECK-NOT: _ZN1SD
23+
// CHECK: call void @"_ZZ1fvEN3$_0D1Ev"(
24+
// CHECK-NOT: _ZN1SD
25+
// CHECK: resume
26+
[s = S()] {}, throw 0;
27+
28+
// CHECK: }
29+
}
30+
31+
// CHECK-LABEL: define void @_Z1gv(
32+
void g() {
33+
// CHECK: call void @_ZN1SC1Ev(
34+
// CHECK: invoke void @__cxa_throw
35+
//
36+
// Ensure we call the lambda destructor here, and do not call the destructor
37+
// for the capture.
38+
// CHECK: landingpad
39+
// CHECK-NOT: @"_ZZ1gvEN3$_0D1Ev"(
40+
// CHECK: call void @_ZN1SD1Ev(
41+
// CHECK-NOT: @"_ZZ1gvEN3$_0D1Ev"(
42+
// CHECK: resume
43+
[s = S(), t = (throw 0, 1)] {};
44+
45+
// CHECK: }
46+
}
47+
48+
void x() noexcept;
49+
void y() noexcept;
50+
51+
// CHECK-LABEL: define void @_Z1hbb(
52+
void h(bool b1, bool b2) {
53+
// CHECK: {{.*}} = alloca i1,
54+
// CHECK: %[[S_ISACTIVE:.*]] = alloca i1,
55+
// CHECK: {{.*}} = alloca i1,
56+
57+
// lambda init: s and t, branch on b1
58+
// CHECK: call void @_ZN1SC1Ev(
59+
// CHECK: store i1 true, i1* %[[S_ISACTIVE]], align 1
60+
// CHECK: call void @_ZN1TC1Ev(
61+
// CHECK: br i1
62+
63+
// throw 1
64+
// CHECK: invoke void @__cxa_throw
65+
66+
// completion of lambda init, branch on b2
67+
// CHECK: store i32 42,
68+
// CHECK: store i1 false, i1* %[[S_ISACTIVE]], align 1
69+
// CHECK: br i1
70+
71+
// throw 2
72+
// CHECK: invoke void @__cxa_throw
73+
74+
// end of full-expression
75+
// CHECK: call void @_Z1xv(
76+
// CHECK: call void @"_ZZ1hbbEN3$_2D1Ev"(
77+
// CHECK: call void @_ZN1TD1Ev(
78+
// CHECK: call void @_Z1yv(
79+
// CHECK: ret void
80+
81+
// cleanups for throw 1
82+
// CHECK: landingpad
83+
// CHECK-NOT: @"_ZZ1hbbEN3$_2D1Ev"(
84+
// CHECK: br
85+
86+
// cleanups for throw 2
87+
// CHECK: landingpad
88+
// CHECK: call void @"_ZZ1hbbEN3$_2D1Ev"(
89+
// CHECK: br
90+
91+
// common cleanup code
92+
// CHECK: call void @_ZN1TD1Ev(
93+
// CHECK: load i1, i1* %[[S_ISACTIVE]],
94+
// CHECK: br i1
95+
96+
// CHECK: call void @_ZN1SD1Ev(
97+
// CHECK: br
98+
99+
// CHECK: resume
100+
[s = S(), t = T().n, u = (b1 ? throw 1 : 42)] {}, (b2 ? throw 2 : 0), x();
101+
y();
102+
103+
// CHECK: }
104+
}

test/CodeGenObjC/arc-blocks.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void test4(void) {
127127
// CHECK-NEXT: store i32 838860800, i32* [[T0]]
128128
// CHECK: [[SLOT:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[VAR]], i32 0, i32 6
129129
// CHECK-NEXT: [[T0:%.*]] = call i8* @test4_source()
130-
// CHECK-NEXT: [[T1:%.*]] = call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T0]])
130+
// CHECK-NEXT: [[T1:%.*]] = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T0]])
131131
// CHECK-NEXT: store i8* [[T1]], i8** [[SLOT]]
132132
// CHECK-NEXT: [[SLOT:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[VAR]], i32 0, i32 6
133133
// 0x42800000 - has signature, copy/dispose helpers, as well as BLOCK_HAS_EXTENDED_LAYOUT
@@ -181,7 +181,7 @@ void test5(void) {
181181
// CHECK-NEXT: [[VARPTR1:%.*]] = bitcast i8** [[VAR]] to i8*
182182
// CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 8, i8* [[VARPTR1]])
183183
// CHECK: [[T0:%.*]] = call i8* @test5_source()
184-
// CHECK-NEXT: [[T1:%.*]] = call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T0]])
184+
// CHECK-NEXT: [[T1:%.*]] = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T0]])
185185
// CHECK-NEXT: store i8* [[T1]], i8** [[VAR]],
186186
// CHECK-NEXT: call void @llvm.objc.release(i8* [[T1]])
187187
// 0x40800000 - has signature but no copy/dispose, as well as BLOCK_HAS_EXTENDED_LAYOUT
@@ -212,7 +212,7 @@ void test6(void) {
212212
// CHECK-NEXT: store i32 1107296256, i32* [[T0]]
213213
// CHECK: [[SLOT:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[VAR]], i32 0, i32 6
214214
// CHECK-NEXT: [[T0:%.*]] = call i8* @test6_source()
215-
// CHECK-NEXT: [[T1:%.*]] = call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T0]])
215+
// CHECK-NEXT: [[T1:%.*]] = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T0]])
216216
// CHECK-NEXT: call i8* @llvm.objc.initWeak(i8** [[SLOT]], i8* [[T1]])
217217
// CHECK-NEXT: call void @llvm.objc.release(i8* [[T1]])
218218
// CHECK-NEXT: [[SLOT:%.*]] = getelementptr inbounds [[BYREF_T]], [[BYREF_T]]* [[VAR]], i32 0, i32 6
@@ -258,7 +258,7 @@ void test7(void) {
258258
// CHECK: [[VAR:%.*]] = alloca i8*,
259259
// CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:<{.*}>]],
260260
// CHECK: [[T0:%.*]] = call i8* @test7_source()
261-
// CHECK-NEXT: [[T1:%.*]] = call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T0]])
261+
// CHECK-NEXT: [[T1:%.*]] = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T0]])
262262
// CHECK-NEXT: call i8* @llvm.objc.initWeak(i8** [[VAR]], i8* [[T1]])
263263
// CHECK-NEXT: call void @llvm.objc.release(i8* [[T1]])
264264
// 0x42800000 - has signature, copy/dispose helpers, as well as BLOCK_HAS_EXTENDED_LAYOUT

test/CodeGenObjC/arc-foreach.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void test2(Test2 *a) {
139139
// CHECK-LP64-LABEL: define void @test2(
140140
// CHECK-LP64: [[T0:%.*]] = call [[ARRAY_T]]* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to [[ARRAY_T]]* (i8*, i8*)*)(
141141
// CHECK-LP64-NEXT: [[T1:%.*]] = bitcast [[ARRAY_T]]* [[T0]] to i8*
142-
// CHECK-LP64-NEXT: [[T2:%.*]] = call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T1]])
142+
// CHECK-LP64-NEXT: [[T2:%.*]] = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T1]])
143143
// CHECK-LP64-NEXT: [[COLL:%.*]] = bitcast i8* [[T2]] to [[ARRAY_T]]*
144144

145145
// Make sure it's not immediately released before starting the iteration.

test/CodeGenObjC/arc-literals.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void test_array(id a, id b) {
5959
// CHECK-NEXT: [[T1:%.*]] = bitcast [[CLASS_T]]* [[T0]] to i8*
6060
// CHECK-NEXT: [[T2:%.*]] = bitcast [2 x i8*]* [[OBJECTS]] to i8**
6161
// CHECK-NEXT: [[T3:%.*]] = call i8* bitcast ({{.*@objc_msgSend.*}})(i8* [[T1]], i8* [[SEL]], i8** [[T2]], i64 2)
62-
// CHECK-NEXT: [[T4:%.*]] = call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T3]])
62+
// CHECK-NEXT: [[T4:%.*]] = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T3]])
6363
// CHECK: call void (...) @llvm.objc.clang.arc.use(i8* [[V0]], i8* [[V1]])
6464
id arr = @[a, b];
6565

@@ -103,7 +103,7 @@ void test_dictionary(id k1, id o1, id k2, id o2) {
103103
// CHECK-NEXT: [[T2:%.*]] = bitcast [2 x i8*]* [[OBJECTS]] to i8**
104104
// CHECK-NEXT: [[T3:%.*]] = bitcast [2 x i8*]* [[KEYS]] to i8**
105105
// CHECK-NEXT: [[T4:%.*]] = call i8* bitcast ({{.*@objc_msgSend.*}})(i8* [[T1]], i8* [[SEL]], i8** [[T2]], i8** [[T3]], i64 2)
106-
// CHECK-NEXT: [[T5:%.*]] = call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T4]])
106+
// CHECK-NEXT: [[T5:%.*]] = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T4]])
107107
// CHECK-NEXT: call void (...) @llvm.objc.clang.arc.use(i8* [[V0]], i8* [[V1]], i8* [[V2]], i8* [[V3]])
108108

109109
id dict = @{ k1 : o1, k2 : o2 };
@@ -135,7 +135,7 @@ void test_property(B *b) {
135135
// CHECK-NEXT: [[T1:%.*]] = bitcast
136136
// CHECK-NEXT: [[T2:%.*]] = call [[B:%.*]]* bitcast ({{.*}} @objc_msgSend to {{.*}})(i8* [[T1]], i8* [[SEL]])
137137
// CHECK-NEXT: [[T3:%.*]] = bitcast [[B]]* [[T2]] to i8*
138-
// CHECK-NEXT: [[T4:%.*]] = call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T3]])
138+
// CHECK-NEXT: [[T4:%.*]] = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[T3]])
139139
// CHECK-NEXT: [[V0:%.*]] = bitcast i8* [[T4]] to [[B]]*
140140
// CHECK-NEXT: [[V1:%.*]] = bitcast [[B]]* [[V0]] to i8*
141141

0 commit comments

Comments
 (0)