1 //===--- AlignedAllocation.h - Aligned Allocation ---------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// Defines a function that returns the minimum OS versions supporting
12 /// C++17's aligned allocation functions.
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_CLANG_BASIC_ALIGNED_ALLOCATION_H
17 #define LLVM_CLANG_BASIC_ALIGNED_ALLOCATION_H
19 #include "llvm/ADT/Triple.h"
20 #include "llvm/Support/ErrorHandling.h"
21 #include "llvm/Support/VersionTuple.h"
25 inline llvm::VersionTuple alignedAllocMinVersion(llvm::Triple::OSType OS) {
29 case llvm::Triple::Darwin:
30 case llvm::Triple::MacOSX: // Earliest supporting version is 10.14.
31 return llvm::VersionTuple(10U, 14U);
32 case llvm::Triple::IOS:
33 case llvm::Triple::TvOS: // Earliest supporting version is 11.0.0.
34 return llvm::VersionTuple(11U);
35 case llvm::Triple::WatchOS: // Earliest supporting version is 4.0.0.
36 return llvm::VersionTuple(4U);
39 llvm_unreachable("Unexpected OS");
42 } // end namespace clang
44 #endif // LLVM_CLANG_BASIC_ALIGNED_ALLOCATION_H