Coverage Report

Created: 2020-02-15 09:57

/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_ALIGNED_ALLOCATION_H
16
#define LLVM_CLANG_BASIC_ALIGNED_ALLOCATION_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.0k
inline llvm::VersionTuple alignedAllocMinVersion(llvm::Triple::OSType OS) {
25
17.0k
  switch (OS) {
26
0
  default:
27
0
    break;
28
16.7k
  case llvm::Triple::Darwin:
29
16.7k
  case llvm::Triple::MacOSX: // Earliest supporting version is 10.14.
30
16.7k
    return llvm::VersionTuple(10U, 14U);
31
16.7k
  case llvm::Triple::IOS:
32
232
  case llvm::Triple::TvOS: // Earliest supporting version is 11.0.0.
33
232
    return llvm::VersionTuple(11U);
34
232
  case llvm::Triple::WatchOS: // Earliest supporting version is 4.0.0.
35
64
    return llvm::VersionTuple(4U);
36
0
  }
37
0
38
0
  llvm_unreachable("Unexpected OS");
39
0
}
40
41
} // end namespace clang
42
43
#endif // LLVM_CLANG_BASIC_ALIGNED_ALLOCATION_H