Coverage Report

Created: 2020-11-24 06:42

/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
6.93M
LangOptions::LangOptions() {
18
1.52G
#define LANGOPT(Name, Bits, Default, Description) Name = 
Default13.8M
;
19
159M
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) set##Name(Default);
20
6.93M
#include "clang/Basic/LangOptions.def"
21
6.93M
}
22
23
1.66k
void LangOptions::resetNonModularOptions() {
24
1.66k
#define LANGOPT(Name, Bits, Default, Description)
25
86.7k
#define BENIGN_LANGOPT(Name, Bits, Default, Description) Name = 
Default2.57k
;
26
1.66k
#define BENIGN_ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
27
6.67k
  Name = static_cast<unsigned>(Default);
28
1.66k
#include "clang/Basic/LangOptions.def"
29
30
  // These options do not affect AST generation.
31
1.66k
  SanitizerBlacklistFiles.clear();
32
1.66k
  XRayAlwaysInstrumentFiles.clear();
33
1.66k
  XRayNeverInstrumentFiles.clear();
34
35
1.66k
  CurrentModule.clear();
36
1.66k
  IsHeaderFile = false;
37
1.66k
}
38
39
190M
bool LangOptions::isNoBuiltinFunc(StringRef FuncName) const {
40
190M
  for (unsigned i = 0, e = NoBuiltinFuncs.size(); i != e; 
++i162k
)
41
162k
    if (FuncName.equals(NoBuiltinFuncs[i]))
42
53
      return true;
43
190M
  return false;
44
190M
}
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
609k
FPOptions FPOptions::defaultWithoutTrailingStorage(const LangOptions &LO) {
52
609k
  FPOptions result(LO);
53
609k
  return result;
54
609k
}
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
}