Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/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
997k
LangOptions::LangOptions() {
18
182M
#define LANGOPT(Name, Bits, Default, Description) Name = 
Default1.99M
;
19
11.9M
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) set##Name(Default);
20
997k
#include "clang/Basic/LangOptions.def"
21
997k
}
22
23
1.27k
void LangOptions::resetNonModularOptions() {
24
1.27k
#define LANGOPT(Name, Bits, Default, Description)
25
49.7k
#define BENIGN_LANGOPT(Name, Bits, Default, Description) Name = 
Default1.97k
;
26
1.27k
#define BENIGN_ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
27
1.27k
  Name = Default;
28
1.27k
#include "clang/Basic/LangOptions.def"
29
1.27k
30
1.27k
  // These options do not affect AST generation.
31
1.27k
  SanitizerBlacklistFiles.clear();
32
1.27k
  XRayAlwaysInstrumentFiles.clear();
33
1.27k
  XRayNeverInstrumentFiles.clear();
34
1.27k
35
1.27k
  CurrentModule.clear();
36
1.27k
  IsHeaderFile = false;
37
1.27k
}
38
39
98.2M
bool LangOptions::isNoBuiltinFunc(StringRef FuncName) const {
40
98.4M
  for (unsigned i = 0, e = NoBuiltinFuncs.size(); i != e; 
++i111k
)
41
111k
    if (FuncName.equals(NoBuiltinFuncs[i]))
42
38
      return true;
43
98.2M
  
return false98.2M
;
44
98.2M
}
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
}