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