Coverage Report

Created: 2018-09-25 23:22

/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
//                     The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
///
10
/// \file
11
/// Defines a function that returns the minimum OS versions supporting
12
/// C++17's aligned allocation functions.
13
///
14
//===----------------------------------------------------------------------===//
15
16
#ifndef LLVM_CLANG_BASIC_ALIGNED_ALLOCATION_H
17
#define LLVM_CLANG_BASIC_ALIGNED_ALLOCATION_H
18
19
#include "llvm/ADT/Triple.h"
20
#include "llvm/Support/ErrorHandling.h"
21
#include "llvm/Support/VersionTuple.h"
22
23
namespace clang {
24
25
18.0k
inline llvm::VersionTuple alignedAllocMinVersion(llvm::Triple::OSType OS) {
26
18.0k
  switch (OS) {
27
18.0k
  default:
28
0
    break;
29
18.0k
  case llvm::Triple::Darwin:
30
8.17k
  case llvm::Triple::MacOSX: // Earliest supporting version is 10.13.
31
8.17k
    return llvm::VersionTuple(10U, 13U);
32
9.81k
  case llvm::Triple::IOS:
33
9.81k
  case llvm::Triple::TvOS: // Earliest supporting version is 11.0.0.
34
9.81k
    return llvm::VersionTuple(11U);
35
9.81k
  case llvm::Triple::WatchOS: // Earliest supporting version is 4.0.0.
36
53
    return llvm::VersionTuple(4U);
37
0
  }
38
0
39
0
  llvm_unreachable("Unexpected OS");
40
0
}
41
42
} // end namespace clang
43
44
#endif // LLVM_CLANG_BASIC_ALIGNED_ALLOCATION_H