Skip to content

Commit 7f8fdee

Browse files
author
git apple-llvm automerger
committed
Merge commit '9ae63e85284b' from swift/release/5.3 into swift/master
2 parents 94f1132 + 9ae63e8 commit 7f8fdee

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

clang/lib/Serialization/ASTWriterDecl.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,8 +1095,6 @@ void ASTDeclWriter::VisitParmVarDecl(ParmVarDecl *D) {
10951095
Record.AddStmt(D->getUninstantiatedDefaultArg());
10961096
Code = serialization::DECL_PARM_VAR;
10971097

1098-
assert(!D->isARCPseudoStrong()); // can be true of ImplicitParamDecl
1099-
11001098
// If the assumptions about the DECL_PARM_VAR abbrev are true, use it. Here
11011099
// we dynamically check for the properties that we optimize for, but don't
11021100
// know are true of all PARM_VAR_DECLs.
@@ -2096,7 +2094,7 @@ void ASTWriter::WriteDeclAbbrevs() {
20962094
Abv->Add(BitCodeAbbrevOp(0)); // SClass
20972095
Abv->Add(BitCodeAbbrevOp(0)); // TSCSpec
20982096
Abv->Add(BitCodeAbbrevOp(0)); // InitStyle
2099-
Abv->Add(BitCodeAbbrevOp(0)); // ARCPseudoStrong
2097+
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isARCPseudoStrong
21002098
Abv->Add(BitCodeAbbrevOp(0)); // Linkage
21012099
Abv->Add(BitCodeAbbrevOp(0)); // HasInit
21022100
Abv->Add(BitCodeAbbrevOp(0)); // HasMemberSpecializationInfo

clang/test/PCH/externally-retained.m

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Test for assertion failure due to objc_externally_retained on a function.
2+
3+
// Without PCH
4+
// RUN: %clang_cc1 -fsyntax-only -verify -fobjc-arc -include %s %s
5+
6+
// With PCH
7+
// RUN: %clang_cc1 %s -emit-pch -fobjc-arc -o %t
8+
// RUN: %clang_cc1 -emit-llvm-only -verify %s -fobjc-arc -include-pch %t -debug-info-kind=limited
9+
10+
// expected-no-diagnostics
11+
12+
#ifndef HEADER
13+
#define HEADER
14+
//===----------------------------------------------------------------------===//
15+
// Header
16+
17+
__attribute__((objc_externally_retained)) void doSomething(id someObject);
18+
19+
id sharedObject = 0;
20+
21+
//===----------------------------------------------------------------------===//
22+
#else
23+
//===----------------------------------------------------------------------===//
24+
25+
void callDoSomething() {
26+
doSomething(sharedObject);
27+
}
28+
29+
//===----------------------------------------------------------------------===//
30+
#endif

0 commit comments

Comments
 (0)