Coverage Report

Created: 2020-09-15 12:33

/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/lib/Basic/LangOptions.cpp
Line
Count
Source (jump to first uncovered line)
1
//===- LangOptions.cpp - C Language Family Language Options ---------------===//
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
//  This file defines the LangOptions class.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#include "clang/Basic/LangOptions.h"
14
15
using namespace clang;
16
17
4.14M
LangOptions::LangOptions() {
18
890M
#define LANGOPT(Name, Bits, Default, Description) Name = 
Default8.28M
;
19
74.5M
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) set##Name(Default);
20
4.14M
#include "clang/Basic/LangOptions.def"
21
4.14M
}
22
23
1.66k
void LangOptions::resetNonModularOptions() {
24
1.66k
#define LANGOPT(Name, Bits, Default, Description)
25
84.8k
#define BENIGN_LANGOPT(Name, Bits, Default, Description) Name = 
Default2.57k
;
26
1.66k
#define BENIGN_ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
27
6.65k
  Name = static_cast<unsigned>(Default);
28
1.66k
#include "clang/Basic/LangOptions.def"
29
1.66k
30
  // These options do not affect AST generation.
31
1.66k
  SanitizerBlacklistFiles.clear();
32
1.66k
  XRayAlwaysInstrumentFiles.clear();
33
1.66k
  XRayNeverInstrumentFiles.clear();
34
1.66k
35
1.66k
  CurrentModule.clear();
36
1.66k
  IsHeaderFile = false;
37
1.66k
}
38
39
181M
bool LangOptions::isNoBuiltinFunc(StringRef FuncName) const {
40
181M
  for (unsigned i = 0, e = NoBuiltinFuncs.size(); i != e; 
++i158k
)
41
158k
    if (FuncName.equals(NoBuiltinFuncs[i]))
42
53
      return true;
43
181M
  return false;
44
181M
}
45
46
22
VersionTuple LangOptions::getOpenCLVersionTuple() const {
47
18
  const int Ver = OpenCLCPlusPlus ? 
OpenCLCPlusPlusVersion4
: OpenCLVersion;
48
22
  return VersionTuple(Ver / 100, (Ver % 100) / 10);
49
22
}
50
51
413k
FPOptions FPOptions::defaultWithoutTrailingStorage(const LangOptions &LO) {
52
413k
  FPOptions result(LO);
53
413k
  return result;
54
413k
}
55
56
0
LLVM_DUMP_METHOD void FPOptions::dump() {
57
0
#define OPTION(NAME, TYPE, WIDTH, PREVIOUS)                                    \
58
0
  llvm::errs() << "\n " #NAME " " << get##NAME();
59
0
#include "clang/Basic/FPOptions.def"
60
0
  llvm::errs() << "\n";
61
0
}
62
63
0
LLVM_DUMP_METHOD void FPOptionsOverride::dump() {
64
0
#define OPTION(NAME, TYPE, WIDTH, PREVIOUS)                                    \
65
0
  if (has##NAME##Override())                                                   \
66
0
    llvm::errs() << "\n " #NAME " Override is " << get##NAME##Override();
67
0
#include "clang/Basic/FPOptions.def"
68
0
  llvm::errs() << "\n";
69
0
}