Skip to content

Commit f2ba792

Browse files
author
git apple-llvm automerger
committed
Merge commit 'dd4ac9b2ace1' from apple/stable/20210107 into swift/main
2 parents 2da59ea + 77afe36 commit f2ba792

File tree

80 files changed

+675
-401
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+675
-401
lines changed

clang/lib/AST/ASTImporter.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5057,6 +5057,11 @@ ExpectedDecl ASTNodeImporter::VisitObjCPropertyDecl(ObjCPropertyDecl *D) {
50575057
auto FoundDecls = Importer.findDeclsInToCtx(DC, Name);
50585058
for (auto *FoundDecl : FoundDecls) {
50595059
if (auto *FoundProp = dyn_cast<ObjCPropertyDecl>(FoundDecl)) {
5060+
// Instance and class properties can share the same name but are different
5061+
// declarations.
5062+
if (FoundProp->isInstanceProperty() != D->isInstanceProperty())
5063+
continue;
5064+
50605065
// Check property types.
50615066
if (!Importer.IsStructurallyEquivalent(D->getType(),
50625067
FoundProp->getType())) {

clang/lib/AST/MicrosoftMangle.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2703,7 +2703,7 @@ void MicrosoftCXXNameMangler::mangleCallingConvention(CallingConv CC) {
27032703
case CC_X86FastCall: Out << 'I'; break;
27042704
case CC_X86VectorCall: Out << 'Q'; break;
27052705
case CC_Swift: Out << 'S'; break;
2706-
case CC_SwiftAsync: Out << 'T'; break;
2706+
case CC_SwiftAsync: Out << 'W'; break;
27072707
case CC_PreserveMost: Out << 'U'; break;
27082708
case CC_X86RegCall: Out << 'w'; break;
27092709
}

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -945,20 +945,14 @@ static bool shouldAssumeDSOLocal(const CodeGenModule &CGM,
945945
if (TT.isOSBinFormatCOFF() || (TT.isOSWindows() && TT.isOSBinFormatMachO()))
946946
return true;
947947

948-
const auto &CGOpts = CGM.getCodeGenOpts();
949-
llvm::Reloc::Model RM = CGOpts.RelocationModel;
950-
const auto &LOpts = CGM.getLangOpts();
951-
952-
if (TT.isOSBinFormatMachO()) {
953-
if (RM == llvm::Reloc::Static)
954-
return true;
955-
return GV->isStrongDefinitionForLinker();
956-
}
957-
958948
// Only handle COFF and ELF for now.
959949
if (!TT.isOSBinFormatELF())
960950
return false;
961951

952+
// If this is not an executable, don't assume anything is local.
953+
const auto &CGOpts = CGM.getCodeGenOpts();
954+
llvm::Reloc::Model RM = CGOpts.RelocationModel;
955+
const auto &LOpts = CGM.getLangOpts();
962956
if (RM != llvm::Reloc::Static && !LOpts.PIE) {
963957
// On ELF, if -fno-semantic-interposition is specified and the target
964958
// supports local aliases, there will be neither CC1

clang/test/CodeGen/ptrauth-blocks.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ void (^blockptr)(void);
66
// CHECK: [[GLOBAL_BLOCK_1]] = internal constant { i8**, i32, i32, i8*, %struct.__block_descriptor* } { i8** @_NSConcreteGlobalBlock, i32 1342177280, i32 0, i8* bitcast ({ i8*, i32, i64, i64 }* [[INVOCATION_1]] to i8*),
77
void (^globalblock)(void) = ^{};
88

9-
// CHECK-LABEL: define {{.*}} void @test_block_call()
9+
// CHECK-LABEL: define void @test_block_call()
1010
void test_block_call() {
1111
// CHECK: [[T0:%.*]] = load void ()*, void ()** @blockptr,
1212
// CHECK-NEXT: [[BLOCK:%.*]] = bitcast void ()* [[T0]] to [[BLOCK_T:%.*]]*{{$}}
@@ -21,7 +21,7 @@ void test_block_call() {
2121

2222
void use_block(int (^)(void));
2323

24-
// CHECK-LABEL: define {{.*}} void @test_block_literal(
24+
// CHECK-LABEL: define void @test_block_literal(
2525
void test_block_literal(int i) {
2626
// CHECK: [[I:%.*]] = alloca i32,
2727
// CHECK-NEXT: [[BLOCK:%.*]] = alloca [[BLOCK_T:.*]], align

clang/test/CodeGen/ptrauth-function-attributes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// RUN: %clang_cc1 -triple arm64e-apple-ios -fptrauth-auth-traps -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,TRAPS
1717
// RUN: %clang_cc1 -triple arm64e-apple-ios -emit-llvm %s -o - | FileCheck %s --check-prefixes=ALL,OFF
1818

19-
// ALL-LABEL: define {{.*}} void @test() #0
19+
// ALL-LABEL: define void @test() #0
2020
void test() {
2121
}
2222

clang/test/CodeGen/ptrauth-function-init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ void (*const fp)(void) = (void (*)(void))((int *)&f + 2); // Error in C mode.
1919

2020
#endif
2121

22-
// CHECK-LABEL: define {{.*}} void @t1()
22+
// CHECK-LABEL: define void @t1()
2323
void t1() {
2424
// CHECK: [[PF:%.*]] = alloca void ()*
2525
// CHECK: store void ()* bitcast (i32* getelementptr inbounds (i32, i32* bitcast ({ i8*, i32, i64, i64 }* @f.ptrauth to i32*), i64 2) to void ()*), void ()** [[PF]]

clang/test/CodeGen/ptrauth-in-c-struct.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ typedef struct {
2727
SA getSA(void);
2828
void calleeSA(SA);
2929

30-
// CHECK: define {{.*}} void @test_copy_constructor_SA(%[[STRUCT_SA]]* %{{.*}})
30+
// CHECK: define void @test_copy_constructor_SA(%[[STRUCT_SA]]* %{{.*}})
3131
// CHECK: call void @__copy_constructor_8_8_t0w4_pa1_50_8(
3232

3333
// CHECK: define linkonce_odr hidden void @__copy_constructor_8_8_t0w4_pa1_50_8(i8** %[[DST:.*]], i8** %[[SRC:.*]])
@@ -55,7 +55,7 @@ void test_copy_constructor_SA(SA *s) {
5555
SA t = *s;
5656
}
5757

58-
// CHECK: define {{.*}} void @test_copy_constructor_SA2(%[[STRUCT_SA2]]* %{{.*}})
58+
// CHECK: define void @test_copy_constructor_SA2(%[[STRUCT_SA2]]* %{{.*}})
5959
// CHECK: call void @__copy_constructor_8_8_t0w4_pa2_30_8(
6060

6161
// CHECK: define linkonce_odr hidden void @__copy_constructor_8_8_t0w4_pa2_30_8(i8** %[[DST:.*]], i8** %[[SRC:.*]])
@@ -83,7 +83,7 @@ void test_copy_constructor_SA2(SA2 *s) {
8383
SA2 t = *s;
8484
}
8585

86-
// CHECK: define {{.*}} void @test_copy_assignment_SA(
86+
// CHECK: define void @test_copy_assignment_SA(
8787
// CHECK: call void @__copy_assignment_8_8_t0w4_pa1_50_8(
8888

8989
// CHECK: define linkonce_odr hidden void @__copy_assignment_8_8_t0w4_pa1_50_8(
@@ -92,7 +92,7 @@ void test_copy_assignment_SA(SA *d, SA *s) {
9292
*d = *s;
9393
}
9494

95-
// CHECK: define {{.*}} void @test_move_constructor_SA(
95+
// CHECK: define void @test_move_constructor_SA(
9696
// CHECK: define internal void @__Block_byref_object_copy_(
9797
// CHECK: define linkonce_odr hidden void @__move_constructor_8_8_t0w4_pa1_50_8(
9898

@@ -101,22 +101,22 @@ void test_move_constructor_SA(void) {
101101
BlockTy b = ^{ (void)t; };
102102
}
103103

104-
// CHECK: define {{.*}} void @test_move_assignment_SA(
104+
// CHECK: define void @test_move_assignment_SA(
105105
// CHECK: call void @__move_assignment_8_8_t0w4_pa1_50_8(
106106
// CHECK: define linkonce_odr hidden void @__move_assignment_8_8_t0w4_pa1_50_8(
107107

108108
void test_move_assignment_SA(SA *p) {
109109
*p = getSA();
110110
}
111111

112-
// CHECK: define {{.*}} void @test_parameter_SA(%[[STRUCT_SA]]* %{{.*}})
112+
// CHECK: define void @test_parameter_SA(%[[STRUCT_SA]]* %{{.*}})
113113
// CHECK-NOT: call
114114
// CHECK: ret void
115115

116116
void test_parameter_SA(SA a) {
117117
}
118118

119-
// CHECK: define {{.*}} void @test_argument_SA(%[[STRUCT_SA]]* %[[A:.*]])
119+
// CHECK: define void @test_argument_SA(%[[STRUCT_SA]]* %[[A:.*]])
120120
// CHECK: %[[A_ADDR:.*]] = alloca %[[STRUCT_SA]]*, align 8
121121
// CHECK: %[[AGG_TMP:.*]] = alloca %[[STRUCT_SA]], align 8
122122
// CHECK: store %[[STRUCT_SA]]* %[[A]], %[[STRUCT_SA]]** %[[A_ADDR]], align 8
@@ -132,7 +132,7 @@ void test_argument_SA(SA *a) {
132132
calleeSA(*a);
133133
}
134134

135-
// CHECK: define {{.*}} void @test_return_SA(%[[STRUCT_SA]]* noalias sret(%struct.SA) align 8 %[[AGG_RESULT:.*]], %[[STRUCT_SA]]* %[[A:.*]])
135+
// CHECK: define void @test_return_SA(%[[STRUCT_SA]]* noalias sret(%struct.SA) align 8 %[[AGG_RESULT:.*]], %[[STRUCT_SA]]* %[[A:.*]])
136136
// CHECK: %[[A_ADDR:.*]] = alloca %[[STRUCT_SA]]*, align 8
137137
// CHECK: store %[[STRUCT_SA]]* %[[A]], %[[STRUCT_SA]]** %[[A_ADDR]], align 8
138138
// CHECK: %[[V0:.*]] = load %[[STRUCT_SA]]*, %[[STRUCT_SA]]** %[[A_ADDR]], align 8
@@ -146,7 +146,7 @@ SA test_return_SA(SA *a) {
146146
return *a;
147147
}
148148

149-
// CHECK: define {{.*}} void @test_copy_constructor_SI(
149+
// CHECK: define void @test_copy_constructor_SI(
150150
// CHECK-NOT: call
151151
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(
152152
// CHECK-NOT: call
@@ -156,7 +156,7 @@ void test_copy_constructor_SI(SI *s) {
156156
SI t = *s;
157157
}
158158

159-
// CHECK: define {{.*}} void @test_parameter_SI(i64 %{{.*}})
159+
// CHECK: define void @test_parameter_SI(i64 %{{.*}})
160160
// CHECK-NOT: call
161161
// CHECK: ret void
162162

clang/test/CodeGen/ptrauth-intrinsics.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ long int_discriminator;
55
void *ptr_discriminator;
66
long signature;
77

8-
// CHECK-LABEL: define {{.*}} void @test_auth()
8+
// CHECK-LABEL: define void @test_auth()
99
void test_auth() {
1010
// CHECK: [[PTR:%.*]] = load void ()*, void ()** @fnptr,
1111
// CHECK-NEXT: [[DISC0:%.*]] = load i8*, i8** @ptr_discriminator,
@@ -17,7 +17,7 @@ void test_auth() {
1717
fnptr = __builtin_ptrauth_auth(fnptr, 0, ptr_discriminator);
1818
}
1919

20-
// CHECK-LABEL: define {{.*}} void @test_auth_peephole()
20+
// CHECK-LABEL: define void @test_auth_peephole()
2121
void test_auth_peephole() {
2222
// CHECK: [[PTR:%.*]] = load void ()*, void ()** @fnptr,
2323
// CHECK-NEXT: [[DISC0:%.*]] = load i8*, i8** @ptr_discriminator,
@@ -27,7 +27,7 @@ void test_auth_peephole() {
2727
__builtin_ptrauth_auth(fnptr, 0, ptr_discriminator)();
2828
}
2929

30-
// CHECK-LABEL: define {{.*}} void @test_strip()
30+
// CHECK-LABEL: define void @test_strip()
3131
void test_strip() {
3232
// CHECK: [[PTR:%.*]] = load void ()*, void ()** @fnptr,
3333
// CHECK-NEXT: [[T0:%.*]] = ptrtoint void ()* [[PTR]] to i64
@@ -37,7 +37,7 @@ void test_strip() {
3737
fnptr = __builtin_ptrauth_strip(fnptr, 0);
3838
}
3939

40-
// CHECK-LABEL: define {{.*}} void @test_sign_unauthenticated()
40+
// CHECK-LABEL: define void @test_sign_unauthenticated()
4141
void test_sign_unauthenticated() {
4242
// CHECK: [[PTR:%.*]] = load void ()*, void ()** @fnptr,
4343
// CHECK-NEXT: [[DISC0:%.*]] = load i8*, i8** @ptr_discriminator,
@@ -49,7 +49,7 @@ void test_sign_unauthenticated() {
4949
fnptr = __builtin_ptrauth_sign_unauthenticated(fnptr, 0, ptr_discriminator);
5050
}
5151

52-
// CHECK-LABEL: define {{.*}} void @test_auth_and_resign()
52+
// CHECK-LABEL: define void @test_auth_and_resign()
5353
void test_auth_and_resign() {
5454
// CHECK: [[PTR:%.*]] = load void ()*, void ()** @fnptr,
5555
// CHECK-NEXT: [[DISC0:%.*]] = load i8*, i8** @ptr_discriminator,
@@ -61,7 +61,7 @@ void test_auth_and_resign() {
6161
fnptr = __builtin_ptrauth_auth_and_resign(fnptr, 0, ptr_discriminator, 3, 15);
6262
}
6363

64-
// CHECK-LABEL: define {{.*}} void @test_blend_discriminator()
64+
// CHECK-LABEL: define void @test_blend_discriminator()
6565
void test_blend_discriminator() {
6666
// CHECK: [[PTR:%.*]] = load void ()*, void ()** @fnptr,
6767
// CHECK-NEXT: [[DISC:%.*]] = load i64, i64* @int_discriminator,
@@ -71,7 +71,7 @@ void test_blend_discriminator() {
7171
int_discriminator = __builtin_ptrauth_blend_discriminator(fnptr, int_discriminator);
7272
}
7373

74-
// CHECK-LABEL: define {{.*}} void @test_sign_generic_data()
74+
// CHECK-LABEL: define void @test_sign_generic_data()
7575
void test_sign_generic_data() {
7676
// CHECK: [[PTR:%.*]] = load void ()*, void ()** @fnptr,
7777
// CHECK-NEXT: [[DISC0:%.*]] = load i8*, i8** @ptr_discriminator,
@@ -82,7 +82,7 @@ void test_sign_generic_data() {
8282
signature = __builtin_ptrauth_sign_generic_data(fnptr, ptr_discriminator);
8383
}
8484

85-
// CHECK-LABEL: define {{.*}} void @test_string_discriminator()
85+
// CHECK-LABEL: define void @test_string_discriminator()
8686
void test_string_discriminator() {
8787
// CHECK: [[X:%.*]] = alloca i32
8888

0 commit comments

Comments
 (0)