Coverage Report

Created: 2022-01-22 13:19

/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/include/clang/Basic/CodeGenOptions.h
Line
Count
Source (jump to first uncovered line)
1
//===--- CodeGenOptions.h ---------------------------------------*- C++ -*-===//
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 CodeGenOptions interface.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef LLVM_CLANG_BASIC_CODEGENOPTIONS_H
14
#define LLVM_CLANG_BASIC_CODEGENOPTIONS_H
15
16
#include "clang/Basic/DebugInfoOptions.h"
17
#include "clang/Basic/Sanitizers.h"
18
#include "clang/Basic/XRayInstr.h"
19
#include "llvm/ADT/FloatingPointMode.h"
20
#include "llvm/Support/CodeGen.h"
21
#include "llvm/Support/Regex.h"
22
#include "llvm/Target/TargetOptions.h"
23
#include "llvm/Transforms/Instrumentation/AddressSanitizerOptions.h"
24
#include <map>
25
#include <memory>
26
#include <string>
27
#include <vector>
28
29
namespace clang {
30
31
/// Bitfields of CodeGenOptions, split out from CodeGenOptions to ensure
32
/// that this large collection of bitfields is a trivial class type.
33
class CodeGenOptionsBase {
34
  friend class CompilerInvocation;
35
36
public:
37
#define CODEGENOPT(Name, Bits, Default) unsigned Name : Bits;
38
#define ENUM_CODEGENOPT(Name, Type, Bits, Default)
39
#include "clang/Basic/CodeGenOptions.def"
40
41
protected:
42
#define CODEGENOPT(Name, Bits, Default)
43
#define ENUM_CODEGENOPT(Name, Type, Bits, Default) unsigned Name : Bits;
44
#include "clang/Basic/CodeGenOptions.def"
45
};
46
47
/// CodeGenOptions - Track various options which control how the code
48
/// is optimized and passed to the backend.
49
class CodeGenOptions : public CodeGenOptionsBase {
50
public:
51
  enum InliningMethod {
52
    NormalInlining,     // Use the standard function inlining pass.
53
    OnlyHintInlining,   // Inline only (implicitly) hinted functions.
54
    OnlyAlwaysInlining  // Only run the always inlining pass.
55
  };
56
57
  enum VectorLibrary {
58
    NoLibrary,         // Don't use any vector library.
59
    Accelerate,        // Use the Accelerate framework.
60
    LIBMVEC,           // GLIBC vector math library.
61
    MASSV,             // IBM MASS vector library.
62
    SVML,              // Intel short vector math library.
63
    Darwin_libsystem_m // Use Darwin's libsytem_m vector functions.
64
  };
65
66
  enum ObjCDispatchMethodKind {
67
    Legacy = 0,
68
    NonLegacy = 1,
69
    Mixed = 2
70
  };
71
72
  enum TLSModel {
73
    GeneralDynamicTLSModel,
74
    LocalDynamicTLSModel,
75
    InitialExecTLSModel,
76
    LocalExecTLSModel
77
  };
78
79
  enum StructReturnConventionKind {
80
    SRCK_Default,  // No special option was passed.
81
    SRCK_OnStack,  // Small structs on the stack (-fpcc-struct-return).
82
    SRCK_InRegs    // Small structs in registers (-freg-struct-return).
83
  };
84
85
  enum ProfileInstrKind {
86
    ProfileNone,       // Profile instrumentation is turned off.
87
    ProfileClangInstr, // Clang instrumentation to generate execution counts
88
                       // to use with PGO.
89
    ProfileIRInstr,    // IR level PGO instrumentation in LLVM.
90
    ProfileCSIRInstr, // IR level PGO context sensitive instrumentation in LLVM.
91
  };
92
93
  enum EmbedBitcodeKind {
94
    Embed_Off,      // No embedded bitcode.
95
    Embed_All,      // Embed both bitcode and commandline in the output.
96
    Embed_Bitcode,  // Embed just the bitcode in the output.
97
    Embed_Marker    // Embed a marker as a placeholder for bitcode.
98
  };
99
100
  enum InlineAsmDialectKind {
101
    IAD_ATT,
102
    IAD_Intel,
103
  };
104
105
  // This field stores one of the allowed values for the option
106
  // -fbasic-block-sections=.  The allowed values with this option are:
107
  // {"labels", "all", "list=<file>", "none"}.
108
  //
109
  // "labels":      Only generate basic block symbols (labels) for all basic
110
  //                blocks, do not generate unique sections for basic blocks.
111
  //                Use the machine basic block id in the symbol name to
112
  //                associate profile info from virtual address to machine
113
  //                basic block.
114
  // "all" :        Generate basic block sections for all basic blocks.
115
  // "list=<file>": Generate basic block sections for a subset of basic blocks.
116
  //                The functions and the machine basic block ids are specified
117
  //                in the file.
118
  // "none":        Disable sections/labels for basic blocks.
119
  std::string BBSections;
120
121
  // If set, override the default value of MCAsmInfo::BinutilsVersion. If
122
  // DisableIntegratedAS is specified, the assembly output will consider GNU as
123
  // support. "none" means that all ELF features can be used, regardless of
124
  // binutils support.
125
  std::string BinutilsVersion;
126
127
  enum class FramePointerKind {
128
    None,        // Omit all frame pointers.
129
    NonLeaf,     // Keep non-leaf frame pointers.
130
    All,         // Keep all frame pointers.
131
  };
132
133
  enum class SwiftAsyncFramePointerKind {
134
    Auto, // Choose Swift async extended frame info based on deployment target.
135
    Always, // Unconditionally emit Swift async extended frame info.
136
    Never,  // Don't emit Swift async extended frame info.
137
    Default = Always,
138
  };
139
140
  enum FiniteLoopsKind {
141
    Language, // Not specified, use language standard.
142
    Always,   // All loops are assumed to be finite.
143
    Never,    // No loop is assumed to be finite.
144
  };
145
146
  /// The code model to use (-mcmodel).
147
  std::string CodeModel;
148
149
  /// The filename with path we use for coverage data files. The runtime
150
  /// allows further manipulation with the GCOV_PREFIX and GCOV_PREFIX_STRIP
151
  /// environment variables.
152
  std::string CoverageDataFile;
153
154
  /// The filename with path we use for coverage notes files.
155
  std::string CoverageNotesFile;
156
157
  /// Regexes separated by a semi-colon to filter the files to instrument.
158
  std::string ProfileFilterFiles;
159
160
  /// Regexes separated by a semi-colon to filter the files to not instrument.
161
  std::string ProfileExcludeFiles;
162
163
  /// The version string to put into coverage files.
164
  char CoverageVersion[4];
165
166
  /// Enable additional debugging information.
167
  std::string DebugPass;
168
169
  /// The string to embed in debug information as the current working directory.
170
  std::string DebugCompilationDir;
171
172
  /// The string to embed in coverage mapping as the current working directory.
173
  std::string CoverageCompilationDir;
174
175
  /// The string to embed in the debug information for the compile unit, if
176
  /// non-empty.
177
  std::string DwarfDebugFlags;
178
179
  /// The string containing the commandline for the llvm.commandline metadata,
180
  /// if non-empty.
181
  std::string RecordCommandLine;
182
183
  std::map<std::string, std::string> DebugPrefixMap;
184
  std::map<std::string, std::string> CoveragePrefixMap;
185
186
  /// The ABI to use for passing floating point arguments.
187
  std::string FloatABI;
188
189
  /// The file to use for dumping bug report by `Debugify` for original
190
  /// debug info.
191
  std::string DIBugsReportFilePath;
192
193
  /// The floating-point denormal mode to use.
194
  llvm::DenormalMode FPDenormalMode = llvm::DenormalMode::getIEEE();
195
196
  /// The floating-point denormal mode to use, for float.
197
  llvm::DenormalMode FP32DenormalMode = llvm::DenormalMode::getIEEE();
198
199
  /// The float precision limit to use, if non-empty.
200
  std::string LimitFloatPrecision;
201
202
  struct BitcodeFileToLink {
203
    /// The filename of the bitcode file to link in.
204
    std::string Filename;
205
    /// If true, we set attributes functions in the bitcode library according to
206
    /// our CodeGenOptions, much as we set attrs on functions that we generate
207
    /// ourselves.
208
    bool PropagateAttrs = false;
209
    /// If true, we use LLVM module internalizer.
210
    bool Internalize = false;
211
    /// Bitwise combination of llvm::Linker::Flags, passed to the LLVM linker.
212
    unsigned LinkFlags = 0;
213
  };
214
215
  /// The files specified here are linked in to the module before optimizations.
216
  std::vector<BitcodeFileToLink> LinkBitcodeFiles;
217
218
  /// The user provided name for the "main file", if non-empty. This is useful
219
  /// in situations where the input file name does not match the original input
220
  /// file, for example with -save-temps.
221
  std::string MainFileName;
222
223
  /// The name for the split debug info file used for the DW_AT_[GNU_]dwo_name
224
  /// attribute in the skeleton CU.
225
  std::string SplitDwarfFile;
226
227
  /// Output filename for the split debug info, not used in the skeleton CU.
228
  std::string SplitDwarfOutput;
229
230
  /// Output filename used in the COFF debug information.
231
  std::string ObjectFilenameForDebug;
232
233
  /// The name of the relocation model to use.
234
  llvm::Reloc::Model RelocationModel;
235
236
  /// If not an empty string, trap intrinsics are lowered to calls to this
237
  /// function instead of to trap instructions.
238
  std::string TrapFuncName;
239
240
  /// A list of dependent libraries.
241
  std::vector<std::string> DependentLibraries;
242
243
  /// A list of linker options to embed in the object file.
244
  std::vector<std::string> LinkerOptions;
245
246
  /// Name of the profile file to use as output for -fprofile-instr-generate,
247
  /// -fprofile-generate, and -fcs-profile-generate.
248
  std::string InstrProfileOutput;
249
250
  /// Name of the profile file to use with -fprofile-sample-use.
251
  std::string SampleProfileFile;
252
253
  /// Name of the profile file to use as output for with -fmemory-profile.
254
  std::string MemoryProfileOutput;
255
256
  /// Name of the profile file to use as input for -fprofile-instr-use
257
  std::string ProfileInstrumentUsePath;
258
259
  /// Name of the profile remapping file to apply to the profile data supplied
260
  /// by -fprofile-sample-use or -fprofile-instr-use.
261
  std::string ProfileRemappingFile;
262
263
  /// Name of the function summary index file to use for ThinLTO function
264
  /// importing.
265
  std::string ThinLTOIndexFile;
266
267
  /// Name of a file that can optionally be written with minimized bitcode
268
  /// to be used as input for the ThinLTO thin link step, which only needs
269
  /// the summary and module symbol table (and not, e.g. any debug metadata).
270
  std::string ThinLinkBitcodeFile;
271
272
  /// Prefix to use for -save-temps output.
273
  std::string SaveTempsFilePrefix;
274
275
  /// Name of file passed with -fcuda-include-gpubinary option to forward to
276
  /// CUDA runtime back-end for incorporating them into host-side object file.
277
  std::string CudaGpuBinaryFileName;
278
279
  /// The name of the file to which the backend should save YAML optimization
280
  /// records.
281
  std::string OptRecordFile;
282
283
  /// The regex that filters the passes that should be saved to the optimization
284
  /// records.
285
  std::string OptRecordPasses;
286
287
  /// The format used for serializing remarks (default: YAML)
288
  std::string OptRecordFormat;
289
290
  /// The name of the partition that symbols are assigned to, specified with
291
  /// -fsymbol-partition (see https://lld.llvm.org/Partitions.html).
292
  std::string SymbolPartition;
293
294
  enum RemarkKind {
295
    RK_Missing,            // Remark argument not present on the command line.
296
    RK_Enabled,            // Remark enabled via '-Rgroup'.
297
    RK_EnabledEverything,  // Remark enabled via '-Reverything'.
298
    RK_Disabled,           // Remark disabled via '-Rno-group'.
299
    RK_DisabledEverything, // Remark disabled via '-Rno-everything'.
300
    RK_WithPattern,        // Remark pattern specified via '-Rgroup=regexp'.
301
  };
302
303
  /// Optimization remark with an optional regular expression pattern.
304
  struct OptRemark {
305
    RemarkKind Kind;
306
    std::string Pattern;
307
    std::shared_ptr<llvm::Regex> Regex;
308
309
    /// By default, optimization remark is missing.
310
978k
    OptRemark() : Kind(RK_Missing), Regex(nullptr) {}
311
312
    /// Returns true iff the optimization remark holds a valid regular
313
    /// expression.
314
7.27M
    bool hasValidPattern() const { return Regex != nullptr; }
315
316
    /// Matches the given string against the regex, if there is some.
317
6.04M
    bool patternMatches(StringRef String) const {
318
6.04M
      return hasValidPattern() && 
Regex->match(String)1.27k
;
319
6.04M
    }
320
  };
321
322
  /// Selected optimizations for which we should enable optimization remarks.
323
  /// Transformation passes whose name matches the contained (optional) regular
324
  /// expression (and support this feature), will emit a diagnostic whenever
325
  /// they perform a transformation.
326
  OptRemark OptimizationRemark;
327
328
  /// Selected optimizations for which we should enable missed optimization
329
  /// remarks. Transformation passes whose name matches the contained (optional)
330
  /// regular expression (and support this feature), will emit a diagnostic
331
  /// whenever they tried but failed to perform a transformation.
332
  OptRemark OptimizationRemarkMissed;
333
334
  /// Selected optimizations for which we should enable optimization analyses.
335
  /// Transformation passes whose name matches the contained (optional) regular
336
  /// expression (and support this feature), will emit a diagnostic whenever
337
  /// they want to explain why they decided to apply or not apply a given
338
  /// transformation.
339
  OptRemark OptimizationRemarkAnalysis;
340
341
  /// Set of files defining the rules for the symbol rewriting.
342
  std::vector<std::string> RewriteMapFiles;
343
344
  /// Set of sanitizer checks that are non-fatal (i.e. execution should be
345
  /// continued when possible).
346
  SanitizerSet SanitizeRecover;
347
348
  /// Set of sanitizer checks that trap rather than diagnose.
349
  SanitizerSet SanitizeTrap;
350
351
  /// List of backend command-line options for -fembed-bitcode.
352
  std::vector<uint8_t> CmdArgs;
353
354
  /// A list of all -fno-builtin-* function names (e.g., memset).
355
  std::vector<std::string> NoBuiltinFuncs;
356
357
  std::vector<std::string> Reciprocals;
358
359
  /// The preferred width for auto-vectorization transforms. This is intended to
360
  /// override default transforms based on the width of the architected vector
361
  /// registers.
362
  std::string PreferVectorWidth;
363
364
  /// Set of XRay instrumentation kinds to emit.
365
  XRayInstrSet XRayInstrumentationBundle;
366
367
  std::vector<std::string> DefaultFunctionAttrs;
368
369
  /// List of dynamic shared object files to be loaded as pass plugins.
370
  std::vector<std::string> PassPlugins;
371
372
  /// Path to allowlist file specifying which objects
373
  /// (files, functions) should exclusively be instrumented
374
  /// by sanitizer coverage pass.
375
  std::vector<std::string> SanitizeCoverageAllowlistFiles;
376
377
  /// The guard style used for stack protector to get a initial value, this
378
  /// value usually be gotten from TLS or get from __stack_chk_guard, or some
379
  /// other styles we may implement in the future.
380
  std::string StackProtectorGuard;
381
382
  /// The TLS base register when StackProtectorGuard is "tls", or register used
383
  /// to store the stack canary for "sysreg".
384
  /// On x86 this can be "fs" or "gs".
385
  /// On AArch64 this can only be "sp_el0".
386
  std::string StackProtectorGuardReg;
387
388
  /// Path to ignorelist file specifying which objects
389
  /// (files, functions) listed for instrumentation by sanitizer
390
  /// coverage pass should actually not be instrumented.
391
  std::vector<std::string> SanitizeCoverageIgnorelistFiles;
392
393
  /// Name of the stack usage file (i.e., .su file) if user passes
394
  /// -fstack-usage. If empty, it can be implied that -fstack-usage is not
395
  /// passed on the command line.
396
  std::string StackUsageOutput;
397
398
  /// Executable and command-line used to create a given CompilerInvocation.
399
  /// Most of the time this will be the full -cc1 command.
400
  const char *Argv0 = nullptr;
401
  std::vector<std::string> CommandLineArgs;
402
403
  /// The minimum hotness value a diagnostic needs in order to be included in
404
  /// optimization diagnostics.
405
  ///
406
  /// The threshold is an Optional value, which maps to one of the 3 states:
407
  /// 1. 0            => threshold disabled. All remarks will be printed.
408
  /// 2. positive int => manual threshold by user. Remarks with hotness exceed
409
  ///                    threshold will be printed.
410
  /// 3. None         => 'auto' threshold by user. The actual value is not
411
  ///                    available at command line, but will be synced with
412
  ///                    hotness threshold from profile summary during
413
  ///                    compilation.
414
  ///
415
  /// If threshold option is not specified, it is disabled by default.
416
  Optional<uint64_t> DiagnosticsHotnessThreshold = 0;
417
418
public:
419
  // Define accessors/mutators for code generation options of enumeration type.
420
#define CODEGENOPT(Name, Bits, Default)
421
#define ENUM_CODEGENOPT(Name, Type, Bits, Default) \
422
7.54M
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::CodeGenOptions::getProfileUse() const
Line
Count
Source
422
212k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::CodeGenOptions::getDebugSimpleTemplateNames() const
Line
Count
Source
422
919k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::CodeGenOptions::getDebugInfo() const
Line
Count
Source
422
4.28M
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::CodeGenOptions::getCompressDebugSections() const
Line
Count
Source
422
16.0k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::CodeGenOptions::getFramePointer() const
Line
Count
Source
422
382k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::CodeGenOptions::getEmbedBitcode() const
Line
Count
Source
422
19.3k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::CodeGenOptions::getInlineAsmDialect() const
Line
Count
Source
422
1.80k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::CodeGenOptions::getObjCDispatchMethod() const
Line
Count
Source
422
11.7k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::CodeGenOptions::getProfileInstr() const
Line
Count
Source
422
1.16M
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::CodeGenOptions::getStructReturnConvention() const
Line
Count
Source
422
3.16k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::CodeGenOptions::getSanitizeAddressUseAfterReturn() const
Line
Count
Source
422
105
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::CodeGenOptions::getSanitizeAddressDtor() const
Line
Count
Source
422
105
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::CodeGenOptions::getFiniteLoops() const
Line
Count
Source
422
268k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::CodeGenOptions::getDebuggerTuning() const
Line
Count
Source
422
110k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::CodeGenOptions::getInlining() const
Line
Count
Source
422
104k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::CodeGenOptions::getVecLib() const
Line
Count
Source
422
23.8k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::CodeGenOptions::getDefaultTLSModel() const
Line
Count
Source
422
632
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::CodeGenOptions::getSwiftAsyncFramePointer() const
Line
Count
Source
422
16.0k
  Type get##Name() const { return static_cast<Type>(Name); } \
423
3.55M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::CodeGenOptions::setCompressDebugSections(llvm::DebugCompressionType)
Line
Count
Source
423
187k
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::CodeGenOptions::setFramePointer(clang::CodeGenOptions::FramePointerKind)
Line
Count
Source
423
202k
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::CodeGenOptions::setEmbedBitcode(clang::CodeGenOptions::EmbedBitcodeKind)
Line
Count
Source
423
187k
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::CodeGenOptions::setInlineAsmDialect(clang::CodeGenOptions::InlineAsmDialectKind)
Line
Count
Source
423
187k
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::CodeGenOptions::setObjCDispatchMethod(clang::CodeGenOptions::ObjCDispatchMethodKind)
Line
Count
Source
423
187k
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::CodeGenOptions::setProfileInstr(clang::CodeGenOptions::ProfileInstrKind)
Line
Count
Source
423
187k
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::CodeGenOptions::setProfileUse(clang::CodeGenOptions::ProfileInstrKind)
Line
Count
Source
423
187k
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::CodeGenOptions::setStructReturnConvention(clang::CodeGenOptions::StructReturnConventionKind)
Line
Count
Source
423
187k
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::CodeGenOptions::setSanitizeAddressUseAfterReturn(llvm::AsanDetectStackUseAfterReturnMode)
Line
Count
Source
423
187k
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::CodeGenOptions::setSanitizeAddressDtor(llvm::AsanDtorKind)
Line
Count
Source
423
187k
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::CodeGenOptions::setFiniteLoops(clang::CodeGenOptions::FiniteLoopsKind)
Line
Count
Source
423
187k
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::CodeGenOptions::setDebugSimpleTemplateNames(clang::codegenoptions::DebugTemplateNamesKind)
Line
Count
Source
423
187k
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::CodeGenOptions::setDebugInfo(clang::codegenoptions::DebugInfoKind)
Line
Count
Source
423
211k
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::CodeGenOptions::setDebuggerTuning(llvm::DebuggerKind)
Line
Count
Source
423
187k
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::CodeGenOptions::setInlining(clang::CodeGenOptions::InliningMethod)
Line
Count
Source
423
329k
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::CodeGenOptions::setVecLib(clang::CodeGenOptions::VectorLibrary)
Line
Count
Source
423
187k
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::CodeGenOptions::setDefaultTLSModel(clang::CodeGenOptions::TLSModel)
Line
Count
Source
423
187k
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::CodeGenOptions::setSwiftAsyncFramePointer(clang::CodeGenOptions::SwiftAsyncFramePointerKind)
Line
Count
Source
423
187k
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
424
#include "clang/Basic/CodeGenOptions.def"
425
426
  CodeGenOptions();
427
428
0
  const std::vector<std::string> &getNoBuiltinFuncs() const {
429
0
    return NoBuiltinFuncs;
430
0
  }
431
432
  /// Check if Clang profile instrumenation is on.
433
811k
  bool hasProfileClangInstr() const {
434
811k
    return getProfileInstr() == ProfileClangInstr;
435
811k
  }
436
437
  /// Check if IR level profile instrumentation is on.
438
19.5k
  bool hasProfileIRInstr() const {
439
19.5k
    return getProfileInstr() == ProfileIRInstr;
440
19.5k
  }
441
442
  /// Check if CS IR level profile instrumentation is on.
443
19.6k
  bool hasProfileCSIRInstr() const {
444
19.6k
    return getProfileInstr() == ProfileCSIRInstr;
445
19.6k
  }
446
447
  /// Check if Clang profile use is on.
448
35.0k
  bool hasProfileClangUse() const {
449
35.0k
    return getProfileUse() == ProfileClangInstr;
450
35.0k
  }
451
452
  /// Check if IR level profile use is on.
453
19.5k
  bool hasProfileIRUse() const {
454
19.5k
    return getProfileUse() == ProfileIRInstr ||
455
19.5k
           
getProfileUse() == ProfileCSIRInstr19.5k
;
456
19.5k
  }
457
458
  /// Check if CSIR profile use is on.
459
78
  bool hasProfileCSIRUse() const { return getProfileUse() == ProfileCSIRInstr; }
460
461
  /// Check if type and variable info should be emitted.
462
1.99M
  bool hasReducedDebugInfo() const {
463
1.99M
    return getDebugInfo() >= codegenoptions::DebugInfoConstructor;
464
1.99M
  }
465
466
  /// Check if maybe unused type info should be emitted.
467
2.14M
  bool hasMaybeUnusedDebugInfo() const {
468
2.14M
    return getDebugInfo() >= codegenoptions::UnusedTypeInfo;
469
2.14M
  }
470
471
  // Check if any one of SanitizeCoverage* is enabled.
472
157k
  bool hasSanitizeCoverage() const {
473
157k
    return SanitizeCoverageType || 
SanitizeCoverageIndirectCalls157k
||
474
157k
           
SanitizeCoverageTraceCmp157k
||
SanitizeCoverageTraceLoads157k
||
475
157k
           
SanitizeCoverageTraceStores157k
;
476
157k
  }
477
};
478
479
}  // end namespace clang
480
481
#endif