HomePhabricator

[ObjC] Fix encoding of ObjC pointer types that are pointers to typedefs

Description

[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<Class1 *> MyArray;

void foo1(void) {
  const char *s0 = @encode(MyArray *); // "^{NSArray=#}"
  const char *s1 = @encode(NSArray<Class1 *> *); // "@"
}

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

Details

Committed
ahatanakMay 29 2019, 2:23 PM
Differential Revision
D61974: [ObjC] Fix encoding of ObjC pointer types that are pointers to typedefs
Branches
Unknown
Tags
Unknown