/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/include/clang/Basic/AlignedAllocation.h
Line | Count | Source (jump to first uncovered line) |
1 | | //===--- AlignedAllocation.h - Aligned Allocation ---------------*- C++ -*-===// |
2 | | // |
3 | | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | | // See https://llvm.org/LICENSE.txt for license information. |
5 | | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | | // |
7 | | //===----------------------------------------------------------------------===// |
8 | | /// |
9 | | /// \file |
10 | | /// Defines a function that returns the minimum OS versions supporting |
11 | | /// C++17's aligned allocation functions. |
12 | | /// |
13 | | //===----------------------------------------------------------------------===// |
14 | | |
15 | | #ifndef LLVM_CLANG_BASIC_ALIGNEDALLOCATION_H |
16 | | #define LLVM_CLANG_BASIC_ALIGNEDALLOCATION_H |
17 | | |
18 | | #include "llvm/ADT/Triple.h" |
19 | | #include "llvm/Support/ErrorHandling.h" |
20 | | #include "llvm/Support/VersionTuple.h" |
21 | | |
22 | | namespace clang { |
23 | | |
24 | 17.7k | inline llvm::VersionTuple alignedAllocMinVersion(llvm::Triple::OSType OS) { |
25 | 17.7k | switch (OS) { |
26 | 0 | default: |
27 | 0 | break; |
28 | 0 | case llvm::Triple::Darwin: |
29 | 17.3k | case llvm::Triple::MacOSX: // Earliest supporting version is 10.13. |
30 | 17.3k | return llvm::VersionTuple(10U, 13U); |
31 | 196 | case llvm::Triple::IOS: |
32 | 254 | case llvm::Triple::TvOS: // Earliest supporting version is 11.0.0. |
33 | 254 | return llvm::VersionTuple(11U); |
34 | 70 | case llvm::Triple::WatchOS: // Earliest supporting version is 4.0.0. |
35 | 70 | return llvm::VersionTuple(4U); |
36 | 46 | case llvm::Triple::ZOS: |
37 | 46 | return llvm::VersionTuple(); // All z/OS versions have no support. |
38 | 17.7k | } |
39 | | |
40 | 0 | llvm_unreachable("Unexpected OS"); |
41 | 0 | } |
42 | | |
43 | | } // end namespace clang |
44 | | |
45 | | #endif // LLVM_CLANG_BASIC_ALIGNEDALLOCATION_H |