diff options
author | Raphael Isemann <teemperor@gmail.com> | 2020-02-05 11:44:28 +0100 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2020-02-05 11:44:40 +0100 |
commit | 5ff4f881a7774b8ec8d4db40d2a6c95ddd8a5f21 (patch) | |
tree | f11a25ed00864ec682223fb883c06aaf67025fe2 /llvm/lib/Transforms/Utils/LoopUtils.cpp | |
parent | 163e33b290ff4b3bc3eec569a153ced9267254ec (diff) | |
download | llvm-5ff4f881a7774b8ec8d4db40d2a6c95ddd8a5f21.zip llvm-5ff4f881a7774b8ec8d4db40d2a6c95ddd8a5f21.tar.gz llvm-5ff4f881a7774b8ec8d4db40d2a6c95ddd8a5f21.tar.bz2 |
[lldb] Ignore type sugar in TypeSystemClang::GetPointerType
Summary:
Currently having a typedef for ObjC types is breaking member access in LLDB:
```
typedef NSString Str;
NSString *s; s.length; // OK
Str *s; s.length; // Causes: member reference base type 'Str *' (aka 'NSString *') is not a structure or union
```
This works for NSString as there the type building from `NSString` -> `NSString *` will correctly
build a ObjCObjectPointerType (which is necessary to make member access with a dot possible),
but for the typedef the `Str` -> `Str *` conversion will produce an incorrect PointerType. The reason
for this is that our check in TypeSystemClang::GetPointerType is not desugaring the base type,
which causes that `Str` is not recognised as a type to a `ObjCInterface` as the check only sees the
typedef sugar that was put around it. This causes that we fall back to constructing a PointerType
instead which does not allow member access with the dot operator.
This patch just changes the check to look at the desugared type instead.
Fixes rdar://17525603
Reviewers: shafik, mib
Reviewed By: mib
Subscribers: mib, JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D73952
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
0 files changed, 0 insertions, 0 deletions