Coverage Report

Created: 2024-01-17 10:31

/src/llvm-project/clang/lib/Basic/CodeGenOptions.cpp
Line
Count
Source (jump to first uncovered line)
1
//===--- CodeGenOptions.cpp -----------------------------------------------===//
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
#include "clang/Basic/CodeGenOptions.h"
10
#include <string.h>
11
12
namespace clang {
13
14
138
CodeGenOptions::CodeGenOptions() {
15
29.9k
#define CODEGENOPT(Name, Bits, Default) Name = Default;
16
3.03k
#define ENUM_CODEGENOPT(Name, Type, Bits, Default) set##Name(Default);
17
138
#include "clang/Basic/CodeGenOptions.def"
18
19
138
  RelocationModel = llvm::Reloc::PIC_;
20
138
  memcpy(CoverageVersion, "408*", 4);
21
138
}
22
23
0
void CodeGenOptions::resetNonModularOptions(StringRef ModuleFormat) {
24
  // First reset all CodeGen options only. The Debug options are handled later.
25
0
#define DEBUGOPT(Name, Bits, Default)
26
0
#define VALUE_DEBUGOPT(Name, Bits, Default)
27
0
#define ENUM_DEBUGOPT(Name, Type, Bits, Default)
28
0
#define CODEGENOPT(Name, Bits, Default) Name = Default;
29
0
#define ENUM_CODEGENOPT(Name, Type, Bits, Default) set##Name(Default);
30
0
#include "clang/Basic/CodeGenOptions.def"
31
32
  // Next reset all debug options that can always be reset, because they never
33
  // affect the PCM.
34
0
#define DEBUGOPT(Name, Bits, Default)
35
0
#define VALUE_DEBUGOPT(Name, Bits, Default)
36
0
#define ENUM_DEBUGOPT(Name, Type, Bits, Default)
37
0
#define BENIGN_DEBUGOPT(Name, Bits, Default) Name = Default;
38
0
#define BENIGN_VALUE_DEBUGOPT(Name, Bits, Default) Name = Default;
39
0
#define BENIGN_ENUM_DEBUGOPT(Name, Type, Bits, Default) set##Name(Default);
40
0
#include "clang/Basic/DebugOptions.def"
41
42
  // Conditionally reset debug options that only matter when the debug info is
43
  // emitted into the PCM (-gmodules).
44
0
  if (ModuleFormat == "raw" && !DebugTypeExtRefs) {
45
0
#define DEBUGOPT(Name, Bits, Default) Name = Default;
46
0
#define VALUE_DEBUGOPT(Name, Bits, Default) Name = Default;
47
0
#define ENUM_DEBUGOPT(Name, Type, Bits, Default) set##Name(Default);
48
0
#define BENIGN_DEBUGOPT(Name, Bits, Default)
49
0
#define BENIGN_VALUE_DEBUGOPT(Name, Bits, Default)
50
0
#define BENIGN_ENUM_DEBUGOPT(Name, Type, Bits, Default)
51
0
#include "clang/Basic/DebugOptions.def"
52
0
  }
53
54
0
  RelocationModel = llvm::Reloc::PIC_;
55
0
  memcpy(CoverageVersion, "408*", 4);
56
0
}
57
58
}  // end namespace clang