Coverage Report

Created: 2020-02-25 14:32

/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/lib/Basic/LangOptions.cpp
Line
Count
Source
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
3.92M
LangOptions::LangOptions() {
18
753M
#define LANGOPT(Name, Bits, Default, Description) Name = 
Default7.85M
;
19
62.8M
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) set##Name(Default);
20
3.92M
#include "clang/Basic/LangOptions.def"
21
3.92M
}
22
23
1.64k
void LangOptions::resetNonModularOptions() {
24
1.64k
#define LANGOPT(Name, Bits, Default, Description)
25
67.2k
#define BENIGN_LANGOPT(Name, Bits, Default, Description) Name = 
Default2.55k
;
26
1.64k
#define BENIGN_ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
27
1.64k
  Name = Default;
28
1.64k
#include "clang/Basic/LangOptions.def"
29
1.64k
30
1.64k
  // These options do not affect AST generation.
31
1.64k
  SanitizerBlacklistFiles.clear();
32
1.64k
  XRayAlwaysInstrumentFiles.clear();
33
1.64k
  XRayNeverInstrumentFiles.clear();
34
1.64k
35
1.64k
  CurrentModule.clear();
36
1.64k
  IsHeaderFile = false;
37
1.64k
}
38
39
111M
bool LangOptions::isNoBuiltinFunc(StringRef FuncName) const {
40
111M
  for (unsigned i = 0, e = NoBuiltinFuncs.size(); i != e; 
++i115k
)
41
115k
    if (FuncName.equals(NoBuiltinFuncs[i]))
42
39
      return true;
43
111M
  
return false111M
;
44
111M
}
45
46
22
VersionTuple LangOptions::getOpenCLVersionTuple() const {
47
22
  const int Ver = OpenCLCPlusPlus ? 
OpenCLCPlusPlusVersion4
:
OpenCLVersion18
;
48
22
  return VersionTuple(Ver / 100, (Ver % 100) / 10);
49
22
}