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