Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:36:48

0001 //===--- AlignedAllocation.h - Aligned Allocation ---------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 ///
0009 /// \file
0010 /// Defines a function that returns the minimum OS versions supporting
0011 /// C++17's aligned allocation functions.
0012 ///
0013 //===----------------------------------------------------------------------===//
0014 
0015 #ifndef LLVM_CLANG_BASIC_ALIGNEDALLOCATION_H
0016 #define LLVM_CLANG_BASIC_ALIGNEDALLOCATION_H
0017 
0018 #include "llvm/Support/ErrorHandling.h"
0019 #include "llvm/Support/VersionTuple.h"
0020 #include "llvm/TargetParser/Triple.h"
0021 
0022 namespace clang {
0023 
0024 inline llvm::VersionTuple alignedAllocMinVersion(llvm::Triple::OSType OS) {
0025   switch (OS) {
0026   default:
0027     break;
0028   case llvm::Triple::Darwin:
0029   case llvm::Triple::MacOSX: // Earliest supporting version is 10.13.
0030     return llvm::VersionTuple(10U, 13U);
0031   case llvm::Triple::IOS:
0032   case llvm::Triple::TvOS: // Earliest supporting version is 11.0.0.
0033     return llvm::VersionTuple(11U);
0034   case llvm::Triple::WatchOS: // Earliest supporting version is 4.0.0.
0035     return llvm::VersionTuple(4U);
0036   case llvm::Triple::ZOS:
0037     return llvm::VersionTuple(); // All z/OS versions have no support.
0038   }
0039 
0040   llvm_unreachable("Unexpected OS");
0041 }
0042 
0043 } // end namespace clang
0044 
0045 #endif // LLVM_CLANG_BASIC_ALIGNEDALLOCATION_H