diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2017-04-15 06:42:00 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2017-04-15 06:42:00 +0000 |
commit | 6b1aefd5a606e04df91f9f29d80e28b428ff8b4b (patch) | |
tree | 68d4b490f5a24d83f15efd41556e67ba72989073 /include/clang/Basic/ObjCRuntime.h | |
parent | b57bc56b776793c4ba555e976e5413bf0b8d69a8 (diff) |
[ObjC] Use empty Objective-C collection literal constants when
available.
Original patch by Douglas Gregor with minor modifications.
This recommits r300389, which broke bots because there have been API
changes since the original patch was written.
rdar://problem/20689633
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300396 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/ObjCRuntime.h')
-rw-r--r-- | include/clang/Basic/ObjCRuntime.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/clang/Basic/ObjCRuntime.h b/include/clang/Basic/ObjCRuntime.h index 78fc899882..8dc259c7ab 100644 --- a/include/clang/Basic/ObjCRuntime.h +++ b/include/clang/Basic/ObjCRuntime.h @@ -326,6 +326,20 @@ public: } } + /// Are the empty collection symbols available? + bool hasEmptyCollections() const { + switch (getKind()) { + default: + return false; + case MacOSX: + return getVersion() >= VersionTuple(10, 11); + case iOS: + return getVersion() >= VersionTuple(9); + case WatchOS: + return getVersion() >= VersionTuple(2); + } + } + /// \brief Try to parse an Objective-C runtime specification from the given /// string. /// |