summaryrefslogtreecommitdiff
path: root/include/clang/Basic/ObjCRuntime.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Basic/ObjCRuntime.h')
-rw-r--r--include/clang/Basic/ObjCRuntime.h40
1 files changed, 36 insertions, 4 deletions
diff --git a/include/clang/Basic/ObjCRuntime.h b/include/clang/Basic/ObjCRuntime.h
index fcfbe56b496f..5329b38c2072 100644
--- a/include/clang/Basic/ObjCRuntime.h
+++ b/include/clang/Basic/ObjCRuntime.h
@@ -1,9 +1,8 @@
//===- ObjCRuntime.h - Objective-C Runtime Configuration --------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -247,6 +246,22 @@ public:
llvm_unreachable("bad kind");
}
+ /// Does this runtime provide the objc_alloc_init entrypoint? This can apply
+ /// the same optimization as objc_alloc, but also sends an -init message,
+ /// reducing code size on the caller.
+ bool shouldUseRuntimeFunctionForCombinedAllocInit() const {
+ switch (getKind()) {
+ case MacOSX:
+ return getVersion() >= VersionTuple(10, 14, 4);
+ case iOS:
+ return getVersion() >= VersionTuple(12, 2);
+ case WatchOS:
+ return getVersion() >= VersionTuple(5, 2);
+ default:
+ return false;
+ }
+ }
+
/// Does this runtime supports optimized setter entrypoints?
bool hasOptimizedSetter() const {
switch (getKind()) {
@@ -414,6 +429,23 @@ public:
}
}
+ /// Returns true if this Objective-C runtime supports Objective-C class
+ /// stubs.
+ bool allowsClassStubs() const {
+ switch (getKind()) {
+ case FragileMacOSX:
+ case GCC:
+ case GNUstep:
+ case ObjFW:
+ return false;
+ case MacOSX:
+ case iOS:
+ case WatchOS:
+ return true;
+ }
+ llvm_unreachable("bad kind");
+ }
+
/// Try to parse an Objective-C runtime specification from the given
/// string.
///