Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/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
20.2k
inline llvm::VersionTuple alignedAllocMinVersion(llvm::Triple::OSType OS) {
25
20.2k
  switch (OS) {
26
20.2k
  default:
27
0
    break;
28
20.2k
  case llvm::Triple::Darwin:
29
10.2k
  case llvm::Triple::MacOSX: // Earliest supporting version is 10.14.
30
10.2k
    return llvm::VersionTuple(10U, 14U);
31
10.2k
  case llvm::Triple::IOS:
32
9.95k
  case llvm::Triple::TvOS: // Earliest supporting version is 11.0.0.
33
9.95k
    return llvm::VersionTuple(11U);
34
9.95k
  case llvm::Triple::WatchOS: // Earliest supporting version is 4.0.0.
35
61
    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