clang 20.0.0git
LangOptions.h
Go to the documentation of this file.
1//===- LangOptions.h - C Language Family Language Options -------*- 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/// \file
10/// Defines the clang::LangOptions interface.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_BASIC_LANGOPTIONS_H
15#define LLVM_CLANG_BASIC_LANGOPTIONS_H
16
19#include "clang/Basic/LLVM.h"
25#include "llvm/ADT/FloatingPointMode.h"
26#include "llvm/ADT/StringRef.h"
27#include "llvm/TargetParser/Triple.h"
28#include <optional>
29#include <string>
30#include <vector>
31
32namespace clang {
33
34/// In the Microsoft ABI, this controls the placement of virtual displacement
35/// members used to implement virtual inheritance.
37
38/// Shader programs run in specific pipeline stages.
39/// The order of these values matters, and must be kept in sync with the
40/// Triple Environment enum in llvm::Triple. The ordering is enforced in
41/// static_asserts in Triple.cpp and in clang/Basic/HLSLRuntime.h.
42enum class ShaderStage {
43 Pixel = 0,
44 Vertex,
46 Hull,
47 Domain,
48 Compute,
49 Library,
52 AnyHit,
54 Miss,
56 Mesh,
58 Invalid,
59};
60
61enum class PointerAuthenticationMode : unsigned {
62 None,
63 Strip,
66};
67
68/// Bitfields of LangOptions, split out from LangOptions in order to ensure that
69/// this large collection of bitfields is a trivial class type.
71 friend class CompilerInvocation;
73
74public:
76 using RoundingMode = llvm::RoundingMode;
78
81
82 // Automatic variables live on the stack, and when trivial they're usually
83 // uninitialized because it's undefined behavior to use them without
84 // initializing them.
86
88 // Default C standard behavior.
90
91 // -fwrapv
93
94 // -ftrapv
96 };
97
98 // FIXME: Unify with TUKind.
100 /// Not compiling a module interface at all.
102
103 /// Compiling a module from a module map.
105
106 /// Compiling a module header unit.
108
109 /// Compiling a C++ modules interface unit.
111 };
112
118 };
119
121
130 };
131
133
134 // Corresponds to _MSC_VER
136 MSVC2010 = 1600,
137 MSVC2012 = 1700,
138 MSVC2013 = 1800,
139 MSVC2015 = 1900,
140 MSVC2017 = 1910,
143 MSVC2019 = 1920,
147 };
148
153 // The "default" SYCL version to be used when none is specified on the
154 // frontend command line.
156 };
157
160 HLSL_2015 = 2015,
161 HLSL_2016 = 2016,
162 HLSL_2017 = 2017,
163 HLSL_2018 = 2018,
164 HLSL_2021 = 2021,
165 HLSL_202x = 2028,
166 HLSL_202y = 2029,
167 };
168
169 /// Clang versions with different platform ABI conformance.
170 enum class ClangABI {
171 /// Attempt to be ABI-compatible with code generated by Clang 3.8.x
172 /// (SVN r257626). This causes <1 x long long> to be passed in an
173 /// integer register instead of an SSE register on x64_64.
174 Ver3_8,
175
176 /// Attempt to be ABI-compatible with code generated by Clang 4.0.x
177 /// (SVN r291814). This causes move operations to be ignored when
178 /// determining whether a class type can be passed or returned directly.
179 Ver4,
180
181 /// Attempt to be ABI-compatible with code generated by Clang 6.0.x
182 /// (SVN r321711). This causes determination of whether a type is
183 /// standard-layout to ignore collisions between empty base classes
184 /// and between base classes and member subobjects, which affects
185 /// whether we reuse base class tail padding in some ABIs.
186 Ver6,
187
188 /// Attempt to be ABI-compatible with code generated by Clang 7.0.x
189 /// (SVN r338536). This causes alignof (C++) and _Alignof (C11) to be
190 /// compatible with __alignof (i.e., return the preferred alignment)
191 /// rather than returning the required alignment.
192 Ver7,
193
194 /// Attempt to be ABI-compatible with code generated by Clang 9.0.x
195 /// (SVN r351319). This causes vectors of __int128 to be passed in memory
196 /// instead of passing in multiple scalar registers on x86_64 on Linux and
197 /// NetBSD.
198 Ver9,
199
200 /// Attempt to be ABI-compatible with code generated by Clang 11.0.x
201 /// (git 2e10b7a39b93). This causes clang to pass unions with a 256-bit
202 /// vector member on the stack instead of using registers, to not properly
203 /// mangle substitutions for template names in some cases, and to mangle
204 /// declaration template arguments without a cast to the parameter type
205 /// even when that can lead to mangling collisions.
206 Ver11,
207
208 /// Attempt to be ABI-compatible with code generated by Clang 12.0.x
209 /// (git 8e464dd76bef). This causes clang to mangle lambdas within
210 /// global-scope inline variables incorrectly.
211 Ver12,
212
213 /// Attempt to be ABI-compatible with code generated by Clang 14.0.x.
214 /// This causes clang to:
215 /// - mangle dependent nested names incorrectly.
216 /// - make trivial only those defaulted copy constructors with a
217 /// parameter-type-list equivalent to the parameter-type-list of an
218 /// implicit declaration.
219 Ver14,
220
221 /// Attempt to be ABI-compatible with code generated by Clang 15.0.x.
222 /// This causes clang to:
223 /// - Reverse the implementation for DR692, DR1395 and DR1432.
224 /// - pack non-POD members of packed structs.
225 /// - consider classes with defaulted special member functions non-pod.
226 Ver15,
227
228 /// Attempt to be ABI-compatible with code generated by Clang 17.0.x.
229 /// This causes clang to revert some fixes to its implementation of the
230 /// Itanium name mangling scheme, with the consequence that overloaded
231 /// function templates are mangled the same if they differ only by:
232 /// - constraints
233 /// - whether a non-type template parameter has a deduced type
234 /// - the parameter list of a template template parameter
235 Ver17,
236
237 /// Attempt to be ABI-compatible with code generated by Clang 18.0.x.
238 /// This causes clang to revert some fixes to the mangling of lambdas
239 /// in the initializers of members of local classes.
240 Ver18,
241
242 /// Attempt to be ABI-compatible with code generated by Clang 19.0.x.
243 /// This causes clang to:
244 /// - Incorrectly mangle the 'base type' substitutions of the CXX
245 /// construction vtable because it hasn't added 'type' as a substitution.
246 /// - Skip mangling enclosing class templates of member-like friend
247 /// function templates.
248 Ver19,
249
250 /// Conform to the underlying platform's C and C++ ABIs as closely
251 /// as we can.
252 Latest
253 };
254
255 enum class CoreFoundationABI {
256 /// No interoperability ABI has been specified
258 /// CoreFoundation does not have any language interoperability
260 /// Interoperability with the ObjectiveC runtime
262 /// Interoperability with the latest known version of the Swift runtime
263 Swift,
264 /// Interoperability with the Swift 5.0 runtime
265 Swift5_0,
266 /// Interoperability with the Swift 4.2 runtime
267 Swift4_2,
268 /// Interoperability with the Swift 4.1 runtime
269 Swift4_1,
270 };
271
273 // Disable the floating point pragma
275
276 // Enable the floating point pragma
278
279 // Aggressively fuse FP ops (E.g. FMA) disregarding pragmas.
281
282 // Aggressively fuse FP ops and honor pragmas.
284 };
285
286 /// Possible floating point exception behavior.
288 /// Assume that floating-point exceptions are masked.
290 /// Transformations do not cause new exceptions but may hide some.
292 /// Strictly preserve the floating-point exception semantics.
294 /// Used internally to represent initial unspecified value.
296 };
297
298 /// Possible float expression evaluation method choices.
300 /// The evaluation method cannot be determined or is inconsistent for this
301 /// target.
303 /// Use the declared type for fp arithmetic.
305 /// Use the type double for fp arithmetic.
307 /// Use extended type for fp arithmetic.
309 /// Used only for FE option processing; this is only used to indicate that
310 /// the user did not specify an explicit evaluation method on the command
311 /// line and so the target should be queried for its default evaluation
312 /// method instead.
314 };
315
317
318 /// Possible exception handling behavior.
320
322 /// Permit no implicit vector bitcasts.
323 None,
324 /// Permit vector bitcasts between integer vectors with different numbers
325 /// of elements but the same total bit-width.
326 Integer,
327 /// Permit vector bitcasts between all vectors with the same total
328 /// bit-width.
329 All,
330 };
331
333 // All vector compares produce scalars except vector pixel and vector bool.
334 // The types vector pixel and vector bool return vector results.
335 Mixed,
336 // All vector compares produce vector results as in GCC.
337 GCC,
338 // All vector compares produce scalars as in XL.
339 XL,
340 // Default clang behaviour.
341 Default = Mixed,
342 };
343
345 /// No signing for any function.
346 None,
347 /// Sign the return address of functions that spill LR.
348 NonLeaf,
349 /// Sign the return address of all functions,
350 All
351 };
352
354 /// Return address signing uses APIA key.
355 AKey,
356 /// Return address signing uses APIB key.
357 BKey
358 };
359
360 enum class ThreadModelKind {
361 /// POSIX Threads.
362 POSIX,
363 /// Single Threaded Environment.
364 Single
365 };
366
367 enum class ExtendArgsKind {
368 /// Integer arguments are sign or zero extended to 32/64 bits
369 /// during default argument promotions.
372 };
373
375 /// Legacy default stream
376 Legacy,
377 /// Per-thread default stream
378 PerThread,
379 };
380
381 /// Exclude certain code patterns from being instrumented by arithmetic
382 /// overflow sanitizers
384 /// Don't exclude any overflow patterns from sanitizers
385 None = 1 << 0,
386 /// Exclude all overflow patterns (below)
387 All = 1 << 1,
388 /// if (a + b < a)
390 /// if (a + b < a)
392 /// -1UL
394 /// while (count--)
396 };
397
399 None,
400 /// map only explicit default visibilities to exported
401 Explicit,
402 /// map all default visibilities to exported
403 All,
404 };
405
407 /// Force hidden visibility
409 /// Force protected visibility
411 /// Force default visibility
413 /// Don't alter the visibility
414 Source,
415 };
416
418 /// Keep the IR-gen assigned visibility.
419 Keep,
420 /// Override the IR-gen assigned visibility with default visibility.
421 Default,
422 /// Override the IR-gen assigned visibility with hidden visibility.
423 Hidden,
424 /// Override the IR-gen assigned visibility with protected visibility.
425 Protected,
426 };
427
429 /// Any trailing array member is a FAM.
430 Default = 0,
431 /// Any trailing array member of undefined, 0, or 1 size is a FAM.
433 /// Any trailing array member of undefined or 0 size is a FAM.
435 /// Any trailing array member of undefined size is a FAM.
436 IncompleteOnly = 3,
437 };
438
439 /// Controls the various implementations for complex multiplication and
440 // division.
442 /// Implementation of complex division and multiplication using a call to
443 /// runtime library functions(generally the case, but the BE might
444 /// sometimes replace the library call if it knows enough about the
445 /// potential range of the inputs). Overflow and non-finite values are
446 /// handled by the library implementation. This is the default value.
448
449 /// Implementation of complex division offering an improved handling
450 /// for overflow in intermediate calculations with no special handling for
451 /// NaN and infinite values.
453
454 /// Implementation of complex division using algebraic formulas at
455 /// higher precision. Overflow is handled. Non-finite values are handled in
456 /// some cases. If the target hardware does not have native support for a
457 /// higher precision data type, an implementation for the complex operation
458 /// will be used to provide improved guards against intermediate overflow,
459 /// but overflow and underflow may still occur in some cases. NaN and
460 /// infinite values are not handled.
462
463 /// Implementation of complex division and multiplication using
464 /// algebraic formulas at source precision. No special handling to avoid
465 /// overflow. NaN and infinite values are not handled.
467
468 /// No range rule is enabled.
469 CX_None
470 };
471
472 /// Controls which variables have static destructors registered.
474 /// Register static destructors for all variables.
475 All,
476 /// Register static destructors only for thread-local variables.
478 /// Don't register static destructors for any variables.
479 None,
480 };
481
482 // Define simple language options (with no accessors).
483#define LANGOPT(Name, Bits, Default, Description) unsigned Name : Bits;
484#define ENUM_LANGOPT(Name, Type, Bits, Default, Description)
485#include "clang/Basic/LangOptions.def"
486
487protected:
488 // Define language options of enumeration type. These are private, and will
489 // have accessors (below).
490#define LANGOPT(Name, Bits, Default, Description)
491#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
492 LLVM_PREFERRED_TYPE(Type) \
493 unsigned Name : Bits;
494#include "clang/Basic/LangOptions.def"
495};
496
497/// Keeps track of the various options that can be
498/// enabled, which controls the dialect of C or C++ that is accepted.
500public:
501 /// The used language standard.
503
504 /// Set of enabled sanitizers.
506 /// Is at least one coverage instrumentation type enabled.
507 bool SanitizeCoverage = false;
508
509 /// Paths to files specifying which objects
510 /// (files, functions, variables) should not be instrumented.
511 std::vector<std::string> NoSanitizeFiles;
512
513 /// Paths to the XRay "always instrument" files specifying which
514 /// objects (files, functions, variables) should be imbued with the XRay
515 /// "always instrument" attribute.
516 /// WARNING: This is a deprecated field and will go away in the future.
517 std::vector<std::string> XRayAlwaysInstrumentFiles;
518
519 /// Paths to the XRay "never instrument" files specifying which
520 /// objects (files, functions, variables) should be imbued with the XRay
521 /// "never instrument" attribute.
522 /// WARNING: This is a deprecated field and will go away in the future.
523 std::vector<std::string> XRayNeverInstrumentFiles;
524
525 /// Paths to the XRay attribute list files, specifying which objects
526 /// (files, functions, variables) should be imbued with the appropriate XRay
527 /// attribute(s).
528 std::vector<std::string> XRayAttrListFiles;
529
530 /// Paths to special case list files specifying which entities
531 /// (files, functions) should or should not be instrumented.
532 std::vector<std::string> ProfileListFiles;
533
535
537
539
540 /// The name of the handler function to be called when -ftrapv is
541 /// specified.
542 ///
543 /// If none is specified, abort (GCC-compatible behaviour).
544 std::string OverflowHandler;
545
546 /// The module currently being compiled as specified by -fmodule-name.
547 std::string ModuleName;
548
549 /// The name of the current module, of which the main source file
550 /// is a part. If CompilingModule is set, we are compiling the interface
551 /// of this module, otherwise we are compiling an implementation file of
552 /// it. This starts as ModuleName in case -fmodule-name is provided and
553 /// changes during compilation to reflect the current module.
554 std::string CurrentModule;
555
556 /// The names of any features to enable in module 'requires' decls
557 /// in addition to the hard-coded list in Module.cpp and the target features.
558 ///
559 /// This list is sorted.
560 std::vector<std::string> ModuleFeatures;
561
562 /// Options for parsing comments.
564
565 /// A list of all -fno-builtin-* function names (e.g., memset).
566 std::vector<std::string> NoBuiltinFuncs;
567
568 /// A prefix map for __FILE__, __BASE_FILE__ and __builtin_FILE().
569 std::map<std::string, std::string, std::greater<std::string>> MacroPrefixMap;
570
571 /// Triples of the OpenMP targets that the host code codegen should
572 /// take into account in order to generate accurate offloading descriptors.
573 std::vector<llvm::Triple> OMPTargetTriples;
574
575 /// Name of the IR file that contains the result of the OpenMP target
576 /// host code generation.
577 std::string OMPHostIRFile;
578
579 /// The user provided compilation unit ID, if non-empty. This is used to
580 /// externalize static variables which is needed to support accessing static
581 /// device variables in host code for single source offloading languages
582 /// like CUDA/HIP.
583 std::string CUID;
584
585 /// C++ ABI to compile with, if specified by the frontend through -fc++-abi=.
586 /// This overrides the default ABI used by the target.
587 std::optional<TargetCXXABI::Kind> CXXABI;
588
589 /// Indicates whether the front-end is explicitly told that the
590 /// input is a header file (i.e. -x c-header).
591 bool IsHeaderFile = false;
592
593 /// The default stream kind used for HIP kernel launching.
595
596 /// Which overflow patterns should be excluded from sanitizer instrumentation
598
599 std::vector<std::string> OverflowPatternExclusionValues;
600
601 /// The seed used by the randomize structure layout feature.
602 std::string RandstructSeed;
603
604 /// Indicates whether to use target's platform-specific file separator when
605 /// __FILE__ macro is used and when concatenating filename with directory or
606 /// to use build environment environment's platform-specific file separator.
607 ///
608 /// The plaform-specific path separator is the backslash(\‍) for Windows and
609 /// forward slash (/) elsewhere.
611
612 // Indicates whether we should keep all nullptr checks for pointers
613 // received as a result of a standard operator new (-fcheck-new)
614 bool CheckNew = false;
615
616 // In OpenACC mode, contains a user provided override for the _OPENACC macro.
617 // This exists so that we can override the macro value and test our incomplete
618 // implementation on real-world examples.
620
621 // Indicates if the wasm-opt binary must be ignored in the case of a
622 // WebAssembly target.
623 bool NoWasmOpt = false;
624
625 LangOptions();
626
627 /// Set language defaults for the given input language and
628 /// language standard in the given LangOptions object.
629 ///
630 /// \param Opts - The LangOptions object to set up.
631 /// \param Lang - The input language.
632 /// \param T - The target triple.
633 /// \param Includes - If the language requires extra headers to be implicitly
634 /// included, they will be appended to this list.
635 /// \param LangStd - The input language standard.
636 static void
637 setLangDefaults(LangOptions &Opts, Language Lang, const llvm::Triple &T,
638 std::vector<std::string> &Includes,
640
641 // Define accessors/mutators for language options of enumeration type.
642#define LANGOPT(Name, Bits, Default, Description)
643#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
644 Type get##Name() const { return static_cast<Type>(Name); } \
645 void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
646#include "clang/Basic/LangOptions.def"
647
648 /// Are we compiling a module?
649 bool isCompilingModule() const {
650 return getCompilingModule() != CMK_None;
651 }
652
653 /// Are we compiling a module implementation?
655 return !isCompilingModule() && !ModuleName.empty();
656 }
657
658 /// Do we need to track the owning module for a local declaration?
660 return isCompilingModule() || ModulesLocalVisibility;
661 }
662
664 return getSignedOverflowBehavior() == SOB_Defined;
665 }
666
669 !ObjCSubscriptingLegacyRuntime;
670 }
671
672 bool isCompatibleWithMSVC(MSVCMajorVersion MajorVersion) const {
673 return MSCompatibilityVersion >= MajorVersion * 100000U;
674 }
675
678 return false;
680 return true;
682 }
683
684 /// Reset all of the options that are not considered when building a
685 /// module.
687
688 /// Is this a libc/libm function that is no longer recognized as a
689 /// builtin because a -fno-builtin-* option has been specified?
690 bool isNoBuiltinFunc(StringRef Name) const;
691
692 /// True if any ObjC types may have non-trivial lifetime qualifiers.
694 return ObjCAutoRefCount || ObjCWeak;
695 }
696
698 return ConvergentFunctions;
699 }
700
701 /// Return true if atomicrmw operations targeting allocations in private
702 /// memory are undefined.
704 // Should be false for OpenMP.
705 // TODO: Should this be true for SYCL?
706 return OpenCL || CUDA;
707 }
708
709 /// Return the OpenCL C or C++ version as a VersionTuple.
710 VersionTuple getOpenCLVersionTuple() const;
711
712 /// Return the OpenCL version that kernel language is compatible with
713 unsigned getOpenCLCompatibleVersion() const;
714
715 /// Return the OpenCL C or C++ for OpenCL language name and version
716 /// as a string.
717 std::string getOpenCLVersionString() const;
718
719 /// Returns true if functions without prototypes or functions with an
720 /// identifier list (aka K&R C functions) are not allowed.
722 return CPlusPlus || C23 || DisableKNRFunctions;
723 }
724
725 /// Returns true if implicit function declarations are allowed in the current
726 /// language mode.
728 return !requiresStrictPrototypes() && !OpenCL;
729 }
730
731 /// Returns true if the language supports calling the 'atexit' function.
732 bool hasAtExit() const { return !(OpenMP && OpenMPIsTargetDevice); }
733
734 /// Returns true if implicit int is part of the language requirements.
735 bool isImplicitIntRequired() const { return !CPlusPlus && !C99; }
736
737 /// Returns true if implicit int is supported at all.
738 bool isImplicitIntAllowed() const { return !CPlusPlus && !C23; }
739
740 /// Check if return address signing is enabled.
741 bool hasSignReturnAddress() const {
742 return getSignReturnAddressScope() != SignReturnAddressScopeKind::None;
743 }
744
745 /// Check if return address signing uses AKey.
747 return getSignReturnAddressKey() == SignReturnAddressKeyKind::AKey;
748 }
749
750 /// Check if leaf functions are also signed.
752 return getSignReturnAddressScope() == SignReturnAddressScopeKind::All;
753 }
754
755 bool hasSjLjExceptions() const {
756 return getExceptionHandling() == ExceptionHandlingKind::SjLj;
757 }
758
759 bool hasSEHExceptions() const {
760 return getExceptionHandling() == ExceptionHandlingKind::WinEH;
761 }
762
763 bool hasDWARFExceptions() const {
764 return getExceptionHandling() == ExceptionHandlingKind::DwarfCFI;
765 }
766
767 bool hasWasmExceptions() const {
768 return getExceptionHandling() == ExceptionHandlingKind::Wasm;
769 }
770
771 bool isSYCL() const { return SYCLIsDevice || SYCLIsHost; }
772
774 return getDefaultVisibilityExportMapping() !=
776 }
777
779 return getDefaultVisibilityExportMapping() ==
781 }
782
784 return getDefaultVisibilityExportMapping() ==
786 }
787
789 return getGlobalAllocationFunctionVisibility() !=
791 }
792
794 return getGlobalAllocationFunctionVisibility() ==
796 }
797
799 return getGlobalAllocationFunctionVisibility() ==
801 }
802
804 return getGlobalAllocationFunctionVisibility() ==
806 }
807
808 /// Remap path prefix according to -fmacro-prefix-path option.
810
812 return RoundingMath ? RoundingMode::Dynamic
813 : RoundingMode::NearestTiesToEven;
814 }
815
817 FPExceptionModeKind EM = getFPExceptionMode();
820 return EM;
821 }
822};
823
824/// Floating point control options
825class FPOptionsOverride;
827public:
828 // We start by defining the layout.
829 using storage_type = uint32_t;
830
831 using RoundingMode = llvm::RoundingMode;
832
833 static constexpr unsigned StorageBitSize = 8 * sizeof(storage_type);
834
835 // Define a fake option named "First" so that we have a PREVIOUS even for the
836 // real first option.
837 static constexpr storage_type FirstShift = 0, FirstWidth = 0;
838#define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
839 static constexpr storage_type NAME##Shift = \
840 PREVIOUS##Shift + PREVIOUS##Width; \
841 static constexpr storage_type NAME##Width = WIDTH; \
842 static constexpr storage_type NAME##Mask = ((1 << NAME##Width) - 1) \
843 << NAME##Shift;
844#include "clang/Basic/FPOptions.def"
845
846 static constexpr storage_type TotalWidth = 0
847#define OPTION(NAME, TYPE, WIDTH, PREVIOUS) +WIDTH
848#include "clang/Basic/FPOptions.def"
849 ;
850 static_assert(TotalWidth <= StorageBitSize, "Too short type for FPOptions");
851
852private:
854
855 FPOptionsOverride getChangesSlow(const FPOptions &Base) const;
856
857public:
859 setFPContractMode(LangOptions::FPM_Off);
860 setConstRoundingMode(RoundingMode::Dynamic);
861 setSpecifiedExceptionMode(LangOptions::FPE_Default);
862 }
863 explicit FPOptions(const LangOptions &LO) {
864 Value = 0;
865 // The language fp contract option FPM_FastHonorPragmas has the same effect
866 // as FPM_Fast in frontend. For simplicity, use FPM_Fast uniformly in
867 // frontend.
868 auto LangOptContractMode = LO.getDefaultFPContractMode();
869 if (LangOptContractMode == LangOptions::FPM_FastHonorPragmas)
870 LangOptContractMode = LangOptions::FPM_Fast;
871 setFPContractMode(LangOptContractMode);
872 setRoundingMath(LO.RoundingMath);
873 setConstRoundingMode(LangOptions::RoundingMode::Dynamic);
874 setSpecifiedExceptionMode(LO.getFPExceptionMode());
875 setAllowFPReassociate(LO.AllowFPReassoc);
876 setNoHonorNaNs(LO.NoHonorNaNs);
877 setNoHonorInfs(LO.NoHonorInfs);
878 setNoSignedZero(LO.NoSignedZero);
879 setAllowReciprocal(LO.AllowRecip);
880 setAllowApproxFunc(LO.ApproxFunc);
881 if (getFPContractMode() == LangOptions::FPM_On &&
882 getRoundingMode() == llvm::RoundingMode::Dynamic &&
884 // If the FP settings are set to the "strict" model, then
885 // FENV access is set to true. (ffp-model=strict)
886 setAllowFEnvAccess(true);
887 else
888 setAllowFEnvAccess(LangOptions::FPM_Off);
889 setComplexRange(LO.getComplexRange());
890 }
891
893 return getFPContractMode() == LangOptions::FPM_On;
894 }
896 setFPContractMode(LangOptions::FPM_On);
897 }
898
900 return getFPContractMode() == LangOptions::FPM_Fast;
901 }
903 setFPContractMode(LangOptions::FPM_Fast);
904 }
905
906 bool isFPConstrained() const {
907 return getRoundingMode() != llvm::RoundingMode::NearestTiesToEven ||
909 getAllowFEnvAccess();
910 }
911
913 RoundingMode RM = getConstRoundingMode();
914 if (RM == RoundingMode::Dynamic) {
915 // C23: 7.6.2p3 If the FE_DYNAMIC mode is specified and FENV_ACCESS is
916 // "off", the translator may assume that the default rounding mode is in
917 // effect.
918 if (!getAllowFEnvAccess() && !getRoundingMath())
919 RM = RoundingMode::NearestTiesToEven;
920 }
921 return RM;
922 }
923
925 LangOptions::FPExceptionModeKind EM = getSpecifiedExceptionMode();
927 if (getAllowFEnvAccess())
929 else
931 }
932 return EM;
933 }
934
935 bool operator==(FPOptions other) const { return Value == other.Value; }
936
937 /// Return the default value of FPOptions that's used when trailing
938 /// storage isn't required.
940
943 FPOptions Opts;
944 Opts.Value = Value;
945 return Opts;
946 }
947
948 /// Return difference with the given option set.
950
952
953 // We can define most of the accessors automatically:
954#define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
955 TYPE get##NAME() const { \
956 return static_cast<TYPE>((Value & NAME##Mask) >> NAME##Shift); \
957 } \
958 void set##NAME(TYPE value) { \
959 Value = (Value & ~NAME##Mask) | (storage_type(value) << NAME##Shift); \
960 }
961#include "clang/Basic/FPOptions.def"
962 LLVM_DUMP_METHOD void dump();
963};
964
965/// Represents difference between two FPOptions values.
966///
967/// The effect of language constructs changing the set of floating point options
968/// is usually a change of some FP properties while leaving others intact. This
969/// class describes such changes by keeping information about what FP options
970/// are overridden.
971///
972/// The integral set of FP options, described by the class FPOptions, may be
973/// represented as a default FP option set, defined by language standard and
974/// command line options, with the overrides introduced by pragmas.
975///
976/// The is implemented as a value of the new FPOptions plus a mask showing which
977/// fields are actually set in it.
980 FPOptions::storage_type OverrideMask = 0;
981
982public:
983 using RoundingMode = llvm::RoundingMode;
984
985 /// The type suitable for storing values of FPOptionsOverride. Must be twice
986 /// as wide as bit size of FPOption.
987 using storage_type = uint64_t;
988 static_assert(sizeof(storage_type) >= 2 * sizeof(FPOptions::storage_type),
989 "Too short type for FPOptionsOverride");
990
991 /// Bit mask selecting bits of OverrideMask in serialized representation of
992 /// FPOptionsOverride.
994 (static_cast<storage_type>(1) << FPOptions::StorageBitSize) - 1;
995
998 : Options(LO), OverrideMask(OverrideMaskBits) {}
1000 : Options(FPO), OverrideMask(OverrideMaskBits) {}
1002 : Options(FPO), OverrideMask(Mask) {}
1003
1004 bool requiresTrailingStorage() const { return OverrideMask != 0; }
1005
1007 setFPContractModeOverride(LangOptions::FPM_On);
1008 }
1009
1011 setFPContractModeOverride(LangOptions::FPM_Fast);
1012 }
1013
1015 setFPContractModeOverride(LangOptions::FPM_Off);
1016 }
1017
1019 setAllowFPReassociateOverride(!Value);
1020 setNoHonorNaNsOverride(!Value);
1021 setNoHonorInfsOverride(!Value);
1022 setNoSignedZeroOverride(!Value);
1023 setAllowReciprocalOverride(!Value);
1024 setAllowApproxFuncOverride(!Value);
1025 setMathErrnoOverride(Value);
1026 if (Value)
1027 /* Precise mode implies fp_contract=on and disables ffast-math */
1029 else
1030 /* Precise mode disabled sets fp_contract=fast and enables ffast-math */
1032 }
1033
1035
1037 return (static_cast<storage_type>(Options.getAsOpaqueInt())
1039 OverrideMask;
1040 }
1042 FPOptionsOverride Opts;
1043 Opts.OverrideMask = I & OverrideMaskBits;
1045 return Opts;
1046 }
1047
1050 FPOptions::getFromOpaqueInt((Base.getAsOpaqueInt() & ~OverrideMask) |
1051 (Options.getAsOpaqueInt() & OverrideMask));
1052 return Result;
1053 }
1054
1056 return applyOverrides(FPOptions(LO));
1057 }
1058
1059 bool operator==(FPOptionsOverride other) const {
1060 return Options == other.Options && OverrideMask == other.OverrideMask;
1061 }
1062 bool operator!=(FPOptionsOverride other) const { return !(*this == other); }
1063
1064#define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
1065 bool has##NAME##Override() const { \
1066 return OverrideMask & FPOptions::NAME##Mask; \
1067 } \
1068 TYPE get##NAME##Override() const { \
1069 assert(has##NAME##Override()); \
1070 return Options.get##NAME(); \
1071 } \
1072 void clear##NAME##Override() { \
1073 /* Clear the actual value so that we don't have spurious differences when \
1074 * testing equality. */ \
1075 Options.set##NAME(TYPE(0)); \
1076 OverrideMask &= ~FPOptions::NAME##Mask; \
1077 } \
1078 void set##NAME##Override(TYPE value) { \
1079 Options.set##NAME(value); \
1080 OverrideMask |= FPOptions::NAME##Mask; \
1081 }
1082#include "clang/Basic/FPOptions.def"
1083 LLVM_DUMP_METHOD void dump();
1084};
1087 if (Value == Base.Value)
1088 return FPOptionsOverride();
1089 return getChangesSlow(Base);
1090}
1093 *this = FPO.applyOverrides(*this);
1094}
1095
1096/// Describes the kind of translation unit being processed.
1098 /// The translation unit is a complete translation unit.
1100
1101 /// The translation unit is a prefix to a translation unit, and is
1102 /// not complete.
1103 TU_Prefix,
1104
1105 /// The translation unit is a clang module.
1107
1108 /// The translation unit is a is a complete translation unit that we might
1109 /// incrementally extend later.
1111};
1112
1113} // namespace clang
1114
1115#endif // LLVM_CLANG_BASIC_LANGOPTIONS_H
IndirectLocalPath & Path
enum clang::sema::@1718::IndirectLocalPathEntry::EntryKind Kind
Defines the clang::CommentOptions interface.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines types useful for describing an Objective-C runtime.
Defines the clang::SanitizerKind enum.
Defines the TargetCXXABI class, which abstracts details of the C++ ABI that we're targeting.
Defines the clang::Visibility enumeration and various utility functions.
The base class of CompilerInvocation.
Helper class for holding the data necessary to invoke the compiler.
Represents difference between two FPOptions values.
Definition: LangOptions.h:978
void setAllowFPContractAcrossStatement()
Definition: LangOptions.h:1010
static FPOptionsOverride getFromOpaqueInt(storage_type I)
Definition: LangOptions.h:1041
bool operator!=(FPOptionsOverride other) const
Definition: LangOptions.h:1062
FPOptionsOverride(FPOptions FPO)
Definition: LangOptions.h:999
LLVM_DUMP_METHOD void dump()
void setFPPreciseEnabled(bool Value)
Definition: LangOptions.h:1018
void setAllowFPContractWithinStatement()
Definition: LangOptions.h:1006
FPOptionsOverride(FPOptions FPO, FPOptions::storage_type Mask)
Definition: LangOptions.h:1001
FPOptions applyOverrides(FPOptions Base)
Definition: LangOptions.h:1048
bool operator==(FPOptionsOverride other) const
Definition: LangOptions.h:1059
llvm::RoundingMode RoundingMode
Definition: LangOptions.h:983
static constexpr storage_type OverrideMaskBits
Bit mask selecting bits of OverrideMask in serialized representation of FPOptionsOverride.
Definition: LangOptions.h:993
storage_type getAsOpaqueInt() const
Definition: LangOptions.h:1036
FPOptions applyOverrides(const LangOptions &LO)
Definition: LangOptions.h:1055
uint64_t storage_type
The type suitable for storing values of FPOptionsOverride.
Definition: LangOptions.h:987
FPOptionsOverride(const LangOptions &LO)
Definition: LangOptions.h:997
bool requiresTrailingStorage() const
Definition: LangOptions.h:1004
void applyChanges(FPOptionsOverride FPO)
Definition: LangOptions.h:1091
bool isFPConstrained() const
Definition: LangOptions.h:906
static constexpr storage_type FirstShift
Definition: LangOptions.h:837
FPOptionsOverride getChangesFrom(const FPOptions &Base) const
Return difference with the given option set.
Definition: LangOptions.h:1085
storage_type getAsOpaqueInt() const
Definition: LangOptions.h:941
static constexpr storage_type TotalWidth
Definition: LangOptions.h:846
LangOptions::FPExceptionModeKind getExceptionMode() const
Definition: LangOptions.h:924
FPOptions(const LangOptions &LO)
Definition: LangOptions.h:863
static constexpr storage_type FirstWidth
Definition: LangOptions.h:837
void setAllowFPContractWithinStatement()
Definition: LangOptions.h:895
static FPOptions defaultWithoutTrailingStorage(const LangOptions &LO)
Return the default value of FPOptions that's used when trailing storage isn't required.
static FPOptions getFromOpaqueInt(storage_type Value)
Definition: LangOptions.h:942
bool allowFPContractAcrossStatement() const
Definition: LangOptions.h:899
uint32_t storage_type
Definition: LangOptions.h:829
bool operator==(FPOptions other) const
Definition: LangOptions.h:935
bool allowFPContractWithinStatement() const
Definition: LangOptions.h:892
LLVM_DUMP_METHOD void dump()
void setAllowFPContractAcrossStatement()
Definition: LangOptions.h:902
static constexpr unsigned StorageBitSize
Definition: LangOptions.h:833
llvm::RoundingMode RoundingMode
Definition: LangOptions.h:831
RoundingMode getRoundingMode() const
Definition: LangOptions.h:912
Bitfields of LangOptions, split out from LangOptions in order to ensure that this large collection of...
Definition: LangOptions.h:70
@ NonLeaf
Sign the return address of functions that spill LR.
@ All
Sign the return address of all functions,.
@ CMK_None
Not compiling a module interface at all.
Definition: LangOptions.h:101
@ CMK_HeaderUnit
Compiling a module header unit.
Definition: LangOptions.h:107
@ CMK_ModuleMap
Compiling a module from a module map.
Definition: LangOptions.h:104
@ CMK_ModuleInterface
Compiling a C++ modules interface unit.
Definition: LangOptions.h:110
ComplexRangeKind
Controls the various implementations for complex multiplication and.
Definition: LangOptions.h:441
@ CX_Full
Implementation of complex division and multiplication using a call to runtime library functions(gener...
Definition: LangOptions.h:447
@ CX_Basic
Implementation of complex division and multiplication using algebraic formulas at source precision.
Definition: LangOptions.h:466
@ CX_Promoted
Implementation of complex division using algebraic formulas at higher precision.
Definition: LangOptions.h:461
@ CX_None
No range rule is enabled.
Definition: LangOptions.h:469
@ CX_Improved
Implementation of complex division offering an improved handling for overflow in intermediate calcula...
Definition: LangOptions.h:452
@ Swift5_0
Interoperability with the Swift 5.0 runtime.
@ ObjectiveC
Interoperability with the ObjectiveC runtime.
@ Standalone
CoreFoundation does not have any language interoperability.
@ Unspecified
No interoperability ABI has been specified.
@ Swift
Interoperability with the latest known version of the Swift runtime.
@ Swift4_2
Interoperability with the Swift 4.2 runtime.
@ Swift4_1
Interoperability with the Swift 4.1 runtime.
llvm::RoundingMode RoundingMode
Definition: LangOptions.h:76
@ PerThread
Per-thread default stream.
@ ForceProtected
Force protected visibility.
@ BKey
Return address signing uses APIB key.
@ AKey
Return address signing uses APIA key.
@ ExtendTo32
Integer arguments are sign or zero extended to 32/64 bits during default argument promotions.
@ Single
Single Threaded Environment.
FPEvalMethodKind
Possible float expression evaluation method choices.
Definition: LangOptions.h:299
@ FEM_Extended
Use extended type for fp arithmetic.
Definition: LangOptions.h:308
@ FEM_Double
Use the type double for fp arithmetic.
Definition: LangOptions.h:306
@ FEM_Indeterminable
The evaluation method cannot be determined or is inconsistent for this target.
Definition: LangOptions.h:302
@ FEM_UnsetOnCommandLine
Used only for FE option processing; this is only used to indicate that the user did not specify an ex...
Definition: LangOptions.h:313
@ FEM_Source
Use the declared type for fp arithmetic.
Definition: LangOptions.h:304
@ Integer
Permit vector bitcasts between integer vectors with different numbers of elements but the same total ...
@ ZeroOrIncomplete
Any trailing array member of undefined or 0 size is a FAM.
@ OneZeroOrIncomplete
Any trailing array member of undefined, 0, or 1 size is a FAM.
@ IncompleteOnly
Any trailing array member of undefined size is a FAM.
OverflowPatternExclusionKind
Exclude certain code patterns from being instrumented by arithmetic overflow sanitizers.
Definition: LangOptions.h:383
@ None
Don't exclude any overflow patterns from sanitizers.
Definition: LangOptions.h:385
@ AddUnsignedOverflowTest
if (a + b < a)
Definition: LangOptions.h:391
@ All
Exclude all overflow patterns (below)
Definition: LangOptions.h:387
@ AddSignedOverflowTest
if (a + b < a)
Definition: LangOptions.h:389
@ PostDecrInWhile
while (count–)
Definition: LangOptions.h:395
ExceptionHandlingKind
Possible exception handling behavior.
Definition: LangOptions.h:319
@ Explicit
map only explicit default visibilities to exported
@ All
map all default visibilities to exported
FPExceptionModeKind
Possible floating point exception behavior.
Definition: LangOptions.h:287
@ FPE_Default
Used internally to represent initial unspecified value.
Definition: LangOptions.h:295
@ FPE_Strict
Strictly preserve the floating-point exception semantics.
Definition: LangOptions.h:293
@ FPE_MayTrap
Transformations do not cause new exceptions but may hide some.
Definition: LangOptions.h:291
@ FPE_Ignore
Assume that floating-point exceptions are masked.
Definition: LangOptions.h:289
@ Protected
Override the IR-gen assigned visibility with protected visibility.
@ Hidden
Override the IR-gen assigned visibility with hidden visibility.
ClangABI
Clang versions with different platform ABI conformance.
Definition: LangOptions.h:170
@ Ver6
Attempt to be ABI-compatible with code generated by Clang 6.0.x (SVN r321711).
@ Ver18
Attempt to be ABI-compatible with code generated by Clang 18.0.x.
@ Ver4
Attempt to be ABI-compatible with code generated by Clang 4.0.x (SVN r291814).
@ Ver14
Attempt to be ABI-compatible with code generated by Clang 14.0.x.
@ Ver11
Attempt to be ABI-compatible with code generated by Clang 11.0.x (git 2e10b7a39b93).
@ Ver19
Attempt to be ABI-compatible with code generated by Clang 19.0.x.
@ Ver15
Attempt to be ABI-compatible with code generated by Clang 15.0.x.
@ Ver17
Attempt to be ABI-compatible with code generated by Clang 17.0.x.
@ Ver7
Attempt to be ABI-compatible with code generated by Clang 7.0.x (SVN r338536).
@ Latest
Conform to the underlying platform's C and C++ ABIs as closely as we can.
@ Ver3_8
Attempt to be ABI-compatible with code generated by Clang 3.8.x (SVN r257626).
@ Ver12
Attempt to be ABI-compatible with code generated by Clang 12.0.x (git 8e464dd76bef).
@ Ver9
Attempt to be ABI-compatible with code generated by Clang 9.0.x (SVN r351319).
RegisterStaticDestructorsKind
Controls which variables have static destructors registered.
Definition: LangOptions.h:473
@ ThreadLocal
Register static destructors only for thread-local variables.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition: LangOptions.h:499
bool isSignReturnAddressWithAKey() const
Check if return address signing uses AKey.
Definition: LangOptions.h:746
void resetNonModularOptions()
Reset all of the options that are not considered when building a module.
Definition: LangOptions.cpp:25
std::vector< std::string > OverflowPatternExclusionValues
Definition: LangOptions.h:599
bool hasWasmExceptions() const
Definition: LangOptions.h:767
std::optional< TargetCXXABI::Kind > CXXABI
C++ ABI to compile with, if specified by the frontend through -fc++-abi=.
Definition: LangOptions.h:587
bool isCompatibleWithMSVC(MSVCMajorVersion MajorVersion) const
Definition: LangOptions.h:672
std::vector< std::string > NoBuiltinFuncs
A list of all -fno-builtin-* function names (e.g., memset).
Definition: LangOptions.h:566
std::string ModuleName
The module currently being compiled as specified by -fmodule-name.
Definition: LangOptions.h:547
std::vector< std::string > XRayNeverInstrumentFiles
Paths to the XRay "never instrument" files specifying which objects (files, functions,...
Definition: LangOptions.h:523
FPExceptionModeKind getDefaultExceptionMode() const
Definition: LangOptions.h:816
bool requiresStrictPrototypes() const
Returns true if functions without prototypes or functions with an identifier list (aka K&R C function...
Definition: LangOptions.h:721
bool isImplicitIntAllowed() const
Returns true if implicit int is supported at all.
Definition: LangOptions.h:738
bool isCompilingModuleImplementation() const
Are we compiling a module implementation?
Definition: LangOptions.h:654
bool isNoBuiltinFunc(StringRef Name) const
Is this a libc/libm function that is no longer recognized as a builtin because a -fno-builtin-* optio...
Definition: LangOptions.cpp:49
clang::ObjCRuntime ObjCRuntime
Definition: LangOptions.h:534
CoreFoundationABI CFRuntime
Definition: LangOptions.h:536
std::string getOpenCLVersionString() const
Return the OpenCL C or C++ for OpenCL language name and version as a string.
Definition: LangOptions.cpp:79
bool hasSjLjExceptions() const
Definition: LangOptions.h:755
unsigned OverflowPatternExclusionMask
Which overflow patterns should be excluded from sanitizer instrumentation.
Definition: LangOptions.h:597
bool IsHeaderFile
Indicates whether the front-end is explicitly told that the input is a header file (i....
Definition: LangOptions.h:591
bool hasDefaultVisibilityExportMapping() const
Definition: LangOptions.h:773
SanitizerSet Sanitize
Set of enabled sanitizers.
Definition: LangOptions.h:505
CommentOptions CommentOpts
Options for parsing comments.
Definition: LangOptions.h:563
bool isExplicitDefaultVisibilityExportMapping() const
Definition: LangOptions.h:778
std::vector< std::string > XRayAlwaysInstrumentFiles
Paths to the XRay "always instrument" files specifying which objects (files, functions,...
Definition: LangOptions.h:517
bool hasAtExit() const
Returns true if the language supports calling the 'atexit' function.
Definition: LangOptions.h:732
bool trackLocalOwningModule() const
Do we need to track the owning module for a local declaration?
Definition: LangOptions.h:659
bool isAllDefaultVisibilityExportMapping() const
Definition: LangOptions.h:783
bool isSubscriptPointerArithmetic() const
Definition: LangOptions.h:667
bool UseTargetPathSeparator
Indicates whether to use target's platform-specific file separator when FILE macro is used and when c...
Definition: LangOptions.h:610
bool isSignedOverflowDefined() const
Definition: LangOptions.h:663
bool hasDefaultGlobalAllocationFunctionVisibility() const
Definition: LangOptions.h:793
bool hasGlobalAllocationFunctionVisibility() const
Definition: LangOptions.h:788
VersionTuple getOpenCLVersionTuple() const
Return the OpenCL C or C++ version as a VersionTuple.
Definition: LangOptions.cpp:56
bool implicitFunctionsAllowed() const
Returns true if implicit function declarations are allowed in the current language mode.
Definition: LangOptions.h:727
bool hasSignReturnAddress() const
Check if return address signing is enabled.
Definition: LangOptions.h:741
static void setLangDefaults(LangOptions &Opts, Language Lang, const llvm::Triple &T, std::vector< std::string > &Includes, LangStandard::Kind LangStd=LangStandard::lang_unspecified)
Set language defaults for the given input language and language standard in the given LangOptions obj...
Definition: LangOptions.cpp:89
bool hasDWARFExceptions() const
Definition: LangOptions.h:763
bool assumeFunctionsAreConvergent() const
Definition: LangOptions.h:697
std::string OMPHostIRFile
Name of the IR file that contains the result of the OpenMP target host code generation.
Definition: LangOptions.h:577
bool allowsNonTrivialObjCLifetimeQualifiers() const
True if any ObjC types may have non-trivial lifetime qualifiers.
Definition: LangOptions.h:693
bool isOverflowPatternExcluded(OverflowPatternExclusionKind Kind) const
Definition: LangOptions.h:676
std::string OverflowHandler
The name of the handler function to be called when -ftrapv is specified.
Definition: LangOptions.h:544
bool hasHiddenGlobalAllocationFunctionVisibility() const
Definition: LangOptions.h:803
std::string RandstructSeed
The seed used by the randomize structure layout feature.
Definition: LangOptions.h:602
std::map< std::string, std::string, std::greater< std::string > > MacroPrefixMap
A prefix map for FILE, BASE_FILE and __builtin_FILE().
Definition: LangOptions.h:569
std::vector< std::string > ProfileListFiles
Paths to special case list files specifying which entities (files, functions) should or should not be...
Definition: LangOptions.h:532
void remapPathPrefix(SmallVectorImpl< char > &Path) const
Remap path prefix according to -fmacro-prefix-path option.
Definition: LangOptions.cpp:73
bool hasProtectedGlobalAllocationFunctionVisibility() const
Definition: LangOptions.h:798
LangStandard::Kind LangStd
The used language standard.
Definition: LangOptions.h:502
RoundingMode getDefaultRoundingMode() const
Definition: LangOptions.h:811
bool isCompilingModule() const
Are we compiling a module?
Definition: LangOptions.h:649
bool isImplicitIntRequired() const
Returns true if implicit int is part of the language requirements.
Definition: LangOptions.h:735
bool hasSEHExceptions() const
Definition: LangOptions.h:759
std::string OpenACCMacroOverride
Definition: LangOptions.h:619
bool isSignReturnAddressScopeAll() const
Check if leaf functions are also signed.
Definition: LangOptions.h:751
bool isSYCL() const
Definition: LangOptions.h:771
std::string ObjCConstantStringClass
Definition: LangOptions.h:538
std::string CUID
The user provided compilation unit ID, if non-empty.
Definition: LangOptions.h:583
unsigned getOpenCLCompatibleVersion() const
Return the OpenCL version that kernel language is compatible with.
Definition: LangOptions.cpp:63
GPUDefaultStreamKind GPUDefaultStream
The default stream kind used for HIP kernel launching.
Definition: LangOptions.h:594
bool threadPrivateMemoryAtomicsAreUndefined() const
Return true if atomicrmw operations targeting allocations in private memory are undefined.
Definition: LangOptions.h:703
std::vector< std::string > XRayAttrListFiles
Paths to the XRay attribute list files, specifying which objects (files, functions,...
Definition: LangOptions.h:528
bool SanitizeCoverage
Is at least one coverage instrumentation type enabled.
Definition: LangOptions.h:507
std::vector< llvm::Triple > OMPTargetTriples
Triples of the OpenMP targets that the host code codegen should take into account in order to generat...
Definition: LangOptions.h:573
std::vector< std::string > NoSanitizeFiles
Paths to files specifying which objects (files, functions, variables) should not be instrumented.
Definition: LangOptions.h:511
std::string CurrentModule
The name of the current module, of which the main source file is a part.
Definition: LangOptions.h:554
std::vector< std::string > ModuleFeatures
The names of any features to enable in module 'requires' decls in addition to the hard-coded list in ...
Definition: LangOptions.h:560
The basic abstraction for the target Objective-C runtime.
Definition: ObjCRuntime.h:28
bool isSubscriptPointerArithmetic() const
Is subscripting pointer arithmetic?
Definition: ObjCRuntime.h:356
The JSON file list parser is used to communicate input to InstallAPI.
@ OpenCL
Definition: LangStandard.h:65
@ CPlusPlus
Definition: LangStandard.h:55
Language
The language for the input, used to select and validate the language standard and possible actions.
Definition: LangStandard.h:23
@ Result
The result type of a method or function.
MSVtorDispMode
In the Microsoft ABI, this controls the placement of virtual displacement members used to implement v...
Definition: LangOptions.h:36
ShaderStage
Shader programs run in specific pipeline stages.
Definition: LangOptions.h:42
TranslationUnitKind
Describes the kind of translation unit being processed.
Definition: LangOptions.h:1096
@ TU_Incremental
The translation unit is a is a complete translation unit that we might incrementally extend later.
Definition: LangOptions.h:1109
@ TU_Complete
The translation unit is a complete translation unit.
Definition: LangOptions.h:1098
@ TU_ClangModule
The translation unit is a clang module.
Definition: LangOptions.h:1105
@ TU_Prefix
The translation unit is a prefix to a translation unit, and is not complete.
Definition: LangOptions.h:1102
const FunctionProtoType * T
PointerAuthenticationMode
Definition: LangOptions.h:61
@ None
The alignment was not explicit in code.
Visibility
Describes the different kinds of visibility that a declaration may have.
Definition: Visibility.h:34
Options for controlling comment parsing.