From d64e6eeea912442cc75aa09d187bbdb9340d7fb7 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Wed, 29 May 2019 21:23:30 +0000 Subject: [ObjC] Fix encoding of ObjC pointer types that are pointers to typedefs clang was encoding pointers to typedefs as if they were pointers to structs because that is apparently what gcc is doing. For example: ``` @class Class1; typedef NSArray MyArray; void foo1(void) { const char *s0 = @encode(MyArray *); // "^{NSArray=#}" const char *s1 = @encode(NSArray *); // "@" } ``` This commit removes the code that was there to make clang compatible with gcc and make clang emit the correct encoding for ObjC pointers, which is "@". rdar://problem/50563529 Differential Revision: https://reviews.llvm.org/D61974 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362034 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGenObjCXX/encode.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/CodeGenObjCXX') diff --git a/test/CodeGenObjCXX/encode.mm b/test/CodeGenObjCXX/encode.mm index e4c7618f50..7bc64dafb4 100644 --- a/test/CodeGenObjCXX/encode.mm +++ b/test/CodeGenObjCXX/encode.mm @@ -242,6 +242,6 @@ struct S { @end const char *expand_struct() { - // CHECK: @{{.*}} = private unnamed_addr constant [16 x i8] c"{N={S=^{N}}}\00" + // CHECK: @{{.*}} = private unnamed_addr constant [13 x i8] c"{N={S=@}}\00" return @encode(N); } -- cgit v1.2.1