diff options
author | John McCall <rjmccall@apple.com> | 2012-06-20 21:58:02 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2012-06-20 21:58:02 +0000 |
commit | 0b92fcb1353d2d8b31b6c485e6caa14568aca43b (patch) | |
tree | 3026711a737a0db3164592f467792fbb4a4aea01 /include/clang/Basic/ObjCRuntime.h | |
parent | a6366f5c7e92466ebad0042afa55c2e5952ebe61 (diff) | |
download | clang-0b92fcb1353d2d8b31b6c485e6caa14568aca43b.tar.gz clang-0b92fcb1353d2d8b31b6c485e6caa14568aca43b.tar.bz2 clang-0b92fcb1353d2d8b31b6c485e6caa14568aca43b.tar.xz |
Introduce ObjCRuntime::hasWeakClassImport() and use it in the appropriate
places. I've turned this off for the GNU runtimes --- I don't know if
they support weak class import, but it's easy enough for them to opt in.
Also tweak a comment per review by Jordan.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158860 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/ObjCRuntime.h')
-rw-r--r-- | include/clang/Basic/ObjCRuntime.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/clang/Basic/ObjCRuntime.h b/include/clang/Basic/ObjCRuntime.h index b87632ff6a..a1024c4a58 100644 --- a/include/clang/Basic/ObjCRuntime.h +++ b/include/clang/Basic/ObjCRuntime.h @@ -160,6 +160,18 @@ public: llvm_unreachable("bad kind"); } + /// Does this runtime support weakly importing classes? + bool hasWeakClassImport() const { + switch (getKind()) { + case MacOSX: return true; + case iOS: return true; + case FragileMacOSX: return false; + case FragileGNU: return false; + case GNU: return false; + } + llvm_unreachable("bad kind"); + } + /// Try to parse an Objective-C runtime specification from the given string. /// /// Return true on error. |