diff options
Diffstat (limited to 'include/clang/Basic/ObjCRuntime.h')
-rw-r--r-- | include/clang/Basic/ObjCRuntime.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/include/clang/Basic/ObjCRuntime.h b/include/clang/Basic/ObjCRuntime.h index fcfbe56b49..fc87f20d56 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()) { |