Coverage Report

Created: 2018-12-09 11:54

/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
17.7k
inline llvm::VersionTuple alignedAllocMinVersion(llvm::Triple::OSType OS) {
26
17.7k
  switch (OS) {
27
17.7k
  default:
28
0
    break;
29
17.7k
  case llvm::Triple::Darwin:
30
7.82k
  case llvm::Triple::MacOSX: // Earliest supporting version is 10.13.
31
7.82k
    return llvm::VersionTuple(10U, 13U);
32
9.85k
  case llvm::Triple::IOS:
33
9.85k
  case llvm::Triple::TvOS: // Earliest supporting version is 11.0.0.
34
9.85k
    return llvm::VersionTuple(11U);
35
9.85k
  case llvm::Triple::WatchOS: // Earliest supporting version is 4.0.0.
36
54
    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