clang: include/clang/Basic/CodeGenOptions.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_CLANG_BASIC_CODEGENOPTIONS_H
14#define LLVM_CLANG_BASIC_CODEGENOPTIONS_H
15
20#include "llvm/ADT/FloatingPointMode.h"
21#include "llvm/Frontend/Debug/Options.h"
22#include "llvm/Frontend/Driver/CodeGenOptions.h"
23#include "llvm/Support/CodeGen.h"
24#include "llvm/Support/Regex.h"
25#include "llvm/Target/TargetOptions.h"
26#include "llvm/Transforms/Instrumentation/AddressSanitizerOptions.h"
27#include
28#include
29#include
30#include
31
32namespace llvm {
33class PassBuilder;
34}
36
37
38
42
43public:
44#define CODEGENOPT(Name, Bits, Default) unsigned Name : Bits;
45#define ENUM_CODEGENOPT(Name, Type, Bits, Default)
46#include "clang/Basic/CodeGenOptions.def"
47
48protected:
49#define CODEGENOPT(Name, Bits, Default)
50#define ENUM_CODEGENOPT(Name, Type, Bits, Default) unsigned Name : Bits;
51#include "clang/Basic/CodeGenOptions.def"
52};
53
54
55
57public:
63
69
76
80 SRCK_InRegs
82
86
89 };
90
95 Embed_Marker
97
101 };
102
107 };
108
109
110
111
112
113
114
115
116
117
119
120
121
122
123
125
127 None,
128 Reserved,
129 NonLeaf,
130 All,
131 };
132
134 switch (Kind) {
136 return "none";
138 return "reserved";
140 return "non-leaf";
142 return "all";
143 }
144
145 llvm_unreachable("invalid FramePointerKind");
146 }
147
149 Auto,
150 Always,
151 Never,
153 };
154
159 };
160
165 };
166
167
169
170
171
173
174
175
176
178
179
181
182
184
185
187
188
190
191
193
194
196
197
199
200
201
203
204
205
207
209
210
211
213
214
216
217
218
220
221
222 llvm::DenormalMode FPDenormalMode = llvm::DenormalMode::getIEEE();
223
224
226
227
229
231
233
234
235
237
239
241 };
242
243
245
246
247
248
250
251
252
254
255
257
258
260
261
263
264
265
267
268
270
271
273
274
275
277
278
280
281
283
284
286
287
289
290
291
293
294
295
297
298
299
300
302
303
305
306
307
309
310
311
313
314
315
317
318
319
321
322
324
325
326
328
336 };
337
338
342 std::shared_ptrllvm::Regex Regex;
343
344
346
347
348
350
351
354 }
355 };
356
357
358
359
360
362
363
364
365
366
368
369
370
371
372
373
375
376
377
379
380
382
383
384
386
387
388
389
391
392
394
395
397
399
400
402
403
404
405
407
408
410
412
413
415
416
418
419
421
422
424
425
426
427
429
430
431
432
434
435
436
437
438
440
441
443
444
445
446
448
449
450
451
453
454
455
456
458
459
460
463
464
465
466
467
468
469
470
471
472
473
474
475
476
478
479
480
482
483
485
486public:
487
488#define CODEGENOPT(Name, Bits, Default)
489#define ENUM_CODEGENOPT(Name, Type, Bits, Default) \
490 Type get##Name() const { return static_cast(Name); } \
491 void set##Name(Type Value) { Name = static_cast(Value); }
492#include "clang/Basic/CodeGenOptions.def"
493
495
498 }
499
500
503 }
504
505
508 }
509
510
513 }
514
515
517
518
521 }
522
523
527 }
528
529
531
532
534 return getDebugInfo() >= llvm::codegenoptions::DebugInfoConstructor;
535 }
536
537
539 return getDebugInfo() >= llvm::codegenoptions::UnusedTypeInfo;
540 }
541
542
544 return SanitizeCoverageType || SanitizeCoverageIndirectCalls ||
545 SanitizeCoverageTraceCmp || SanitizeCoverageTraceLoads ||
546 SanitizeCoverageTraceStores || SanitizeCoverageControlFlow;
547 }
548
549
551 return SanitizeBinaryMetadataCovered || SanitizeBinaryMetadataAtomics ||
552 SanitizeBinaryMetadataUAR;
553 }
554
555
556
558};
559
560}
561
562#endif
enum clang::sema::@1725::IndirectLocalPathEntry::EntryKind Kind
Defines the clang::SanitizerKind enum.
Defines the clang::XRayInstrKind enum.
Bitfields of CodeGenOptions, split out from CodeGenOptions to ensure that this large collection of bi...
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
llvm::SmallVector< std::pair< std::string, std::string >, 0 > CoveragePrefixMap
Prefix replacement map for source-based code coverage to remap source file paths in coverage mapping.
std::string StackProtectorGuardSymbol
Specify a symbol to be the guard value.
SanitizerSet SanitizeMergeHandlers
Set of sanitizer checks that can merge handlers (smaller code size at the expense of debuggability).
const std::vector< std::string > & getNoBuiltinFuncs() const
llvm::SmallVector< std::pair< std::string, std::string >, 0 > DebugPrefixMap
std::string OptRecordFile
The name of the file to which the backend should save YAML optimization records.
std::string InstrProfileOutput
Name of the profile file to use as output for -fprofile-instr-generate, -fprofile-generate,...
std::string BinutilsVersion
std::string StackProtectorGuard
The guard style used for stack protector to get a initial value, this value usually be gotten from TL...
std::vector< BitcodeFileToLink > LinkBitcodeFiles
The files specified here are linked in to the module before optimizations.
std::string RecordCommandLine
The string containing the commandline for the llvm.commandline metadata, if non-empty.
std::optional< uint64_t > DiagnosticsHotnessThreshold
The minimum hotness value a diagnostic needs in order to be included in optimization diagnostics.
bool hasProfileInstr() const
Check if any form of instrumentation is on.
bool hasProfileIRUse() const
Check if IR level profile use is on.
char CoverageVersion[4]
The version string to put into coverage files.
std::string FloatABI
The ABI to use for passing floating point arguments.
StructReturnConventionKind
std::string ThinLinkBitcodeFile
Name of a file that can optionally be written with minimized bitcode to be used as input for the Thin...
bool hasProfileCSIRInstr() const
Check if CS IR level profile instrumentation is on.
std::vector< std::string > DependentLibraries
A list of dependent libraries.
std::string DebugPass
Enable additional debugging information.
llvm::Reloc::Model RelocationModel
The name of the relocation model to use.
llvm::DenormalMode FPDenormalMode
The floating-point denormal mode to use.
std::string CoverageNotesFile
The filename with path we use for coverage notes files.
std::string ProfileInstrumentUsePath
Name of the profile file to use as input for -fprofile-instr-use.
std::string SampleProfileFile
Name of the profile file to use with -fprofile-sample-use.
uint64_t LargeDataThreshold
The code model-specific large data threshold to use (-mlarge-data-threshold).
static StringRef getFramePointerKindName(FramePointerKind Kind)
std::string MemoryProfileOutput
Name of the profile file to use as output for with -fmemory-profile.
std::vector< std::function< void(llvm::PassBuilder &)> > PassBuilderCallbacks
List of pass builder callbacks.
std::string LimitFloatPrecision
The float precision limit to use, if non-empty.
std::string CodeModel
The code model to use (-mcmodel).
std::vector< std::string > TocDataVarsUserSpecified
List of global variables explicitly specified by the user as toc-data.
std::string CoverageDataFile
The filename with path we use for coverage data files.
std::vector< std::string > PassPlugins
List of dynamic shared object files to be loaded as pass plugins.
bool hasProfileClangInstr() const
Check if Clang profile instrumenation is on.
std::string DebugCompilationDir
The string to embed in debug information as the current working directory.
std::optional< uint32_t > DiagnosticsMisExpectTolerance
The maximum percentage profiling weights can deviate from the expected values in order to be included...
std::string StackUsageOutput
Name of the stack usage file (i.e., .su file) if user passes -fstack-usage.
std::string OptRecordPasses
The regex that filters the passes that should be saved to the optimization records.
std::vector< std::string > SanitizeCoverageAllowlistFiles
Path to allowlist file specifying which objects (files, functions) should exclusively be instrumented...
std::string SaveTempsFilePrefix
Prefix to use for -save-temps output.
XRayInstrSet XRayInstrumentationBundle
Set of XRay instrumentation kinds to emit.
std::vector< std::string > SanitizeCoverageIgnorelistFiles
Path to ignorelist file specifying which objects (files, functions) listed for instrumentation by san...
bool hasSanitizeCoverage() const
std::vector< std::string > Reciprocals
std::string MainFileName
The user provided name for the "main file", if non-empty.
std::string CudaGpuBinaryFileName
Name of file passed with -fcuda-include-gpubinary option to forward to CUDA runtime back-end for inco...
PointerAuthOptions PointerAuth
Configuration for pointer-signing.
llvm::DenormalMode FP32DenormalMode
The floating-point denormal mode to use, for float.
bool hasProfileIRInstr() const
Check if IR level profile instrumentation is on.
bool hasProfileCSIRUse() const
Check if CSIR profile use is on.
std::string CoverageCompilationDir
The string to embed in coverage mapping as the current working directory.
SanitizerSet SanitizeTrap
Set of sanitizer checks that trap rather than diagnose.
std::vector< std::string > SanitizeMetadataIgnorelistFiles
Path to ignorelist file specifying which objects (files, functions) listed for instrumentation by san...
SanitizerSet SanitizeRecover
Set of sanitizer checks that are non-fatal (i.e.
std::string ProfileExcludeFiles
Regexes separated by a semi-colon to filter the files to not instrument.
std::string AsSecureLogFile
The name of a file to use with .secure_log_unique directives.
SwiftAsyncFramePointerKind
std::string ProfileRemappingFile
Name of the profile remapping file to apply to the profile data supplied by -fprofile-sample-use or -...
bool hasReducedDebugInfo() const
Check if type and variable info should be emitted.
bool hasSanitizeBinaryMetadata() const
OptRemark OptimizationRemark
Selected optimizations for which we should enable optimization remarks.
std::string ThinLTOIndexFile
Name of the function summary index file to use for ThinLTO function importing.
const char * Argv0
Executable and command-line used to create a given CompilerInvocation.
std::string TrapFuncName
If not an empty string, trap intrinsics are lowered to calls to this function instead of to trap inst...
SanitizerMaskCutoffs SanitizeSkipHotCutoffs
Set of thresholds in a range [0.0, 1.0]: the top hottest code responsible for the given fraction of P...
std::string SplitDwarfFile
The name for the split debug info file used for the DW_AT_[GNU_]dwo_name attribute in the skeleton CU...
std::string StackProtectorGuardReg
The TLS base register when StackProtectorGuard is "tls", or register used to store the stack canary f...
std::vector< std::string > DefaultFunctionAttrs
std::vector< std::string > NoBuiltinFuncs
A list of all -fno-builtin-* function names (e.g., memset).
std::vector< uint8_t > CmdArgs
List of backend command-line options for -fembed-bitcode.
OptRemark OptimizationRemarkAnalysis
Selected optimizations for which we should enable optimization analyses.
std::vector< std::string > CommandLineArgs
std::vector< std::string > LinkerOptions
A list of linker options to embed in the object file.
std::string MemoryProfileUsePath
Name of the profile file to use as input for -fmemory-profile-use.
void resetNonModularOptions(StringRef ModuleFormat)
Reset all of the options that are not considered when building a module.
std::string OptRecordFormat
The format used for serializing remarks (default: YAML)
bool hasProfileClangUse() const
Check if Clang profile use is on.
std::vector< std::string > OffloadObjects
List of filenames passed in using the -fembed-offload-object option.
std::string SymbolPartition
The name of the partition that symbols are assigned to, specified with -fsymbol-partition (see https:...
std::vector< std::string > NoTocDataVars
List of global variables that over-ride the toc-data default.
std::string ProfileFilterFiles
Regexes separated by a semi-colon to filter the files to instrument.
bool hasMaybeUnusedDebugInfo() const
Check if maybe unused type info should be emitted.
std::string PreferVectorWidth
The preferred width for auto-vectorization transforms.
std::string ObjectFilenameForDebug
Output filename used in the COFF debug information.
std::string SplitDwarfOutput
Output filename for the split debug info, not used in the skeleton CU.
std::string DwarfDebugFlags
The string to embed in the debug information for the compile unit, if non-empty.
std::string DIBugsReportFilePath
The file to use for dumping bug report by Debugify for original debug info.
OptRemark OptimizationRemarkMissed
Selected optimizations for which we should enable missed optimization remarks.
The base class of CompilerInvocation.
Helper class for holding the data necessary to invoke the compiler.
The JSON file list parser is used to communicate input to InstallAPI.
Diagnostic wrappers for TextAPI types for error reporting.
bool Internalize
If true, we use LLVM module internalizer.
bool PropagateAttrs
If true, we set attributes functions in the bitcode library according to our CodeGenOptions,...
std::string Filename
The filename of the bitcode file to link in.
unsigned LinkFlags
Bitwise combination of llvm::Linker::Flags, passed to the LLVM linker.