clang  17.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 
18 #include "clang/Basic/LLVM.h"
21 #include "clang/Basic/Sanitizers.h"
23 #include "clang/Basic/Visibility.h"
24 #include "llvm/ADT/FloatingPointMode.h"
25 #include "llvm/ADT/StringRef.h"
26 #include "llvm/ADT/Triple.h"
27 #include <optional>
28 #include <string>
29 #include <vector>
30 
31 namespace clang {
32 
33 /// Bitfields of LangOptions, split out from LangOptions in order to ensure that
34 /// this large collection of bitfields is a trivial class type.
36  friend class CompilerInvocation;
37 
38 public:
39  // Define simple language options (with no accessors).
40 #define LANGOPT(Name, Bits, Default, Description) unsigned Name : Bits;
41 #define ENUM_LANGOPT(Name, Type, Bits, Default, Description)
42 #include "clang/Basic/LangOptions.def"
43 
44 protected:
45  // Define language options of enumeration type. These are private, and will
46  // have accessors (below).
47 #define LANGOPT(Name, Bits, Default, Description)
48 #define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
49  unsigned Name : Bits;
50 #include "clang/Basic/LangOptions.def"
51 };
52 
53 /// In the Microsoft ABI, this controls the placement of virtual displacement
54 /// members used to implement virtual inheritance.
56 
57 /// Shader programs run in specific pipeline stages.
58 /// The order of these values matters, and must be kept in sync with the
59 /// Triple Environment enum in llvm::Triple. The ordering is enforced in
60 /// static_asserts in Triple.cpp and in clang/Basic/HLSLRuntime.h.
61 enum class ShaderStage {
62  Pixel = 0,
63  Vertex,
64  Geometry,
65  Hull,
66  Domain,
67  Compute,
68  Library,
71  AnyHit,
72  ClosestHit,
73  Miss,
74  Callable,
75  Mesh,
77  Invalid,
78 };
79 
80 /// Keeps track of the various options that can be
81 /// enabled, which controls the dialect of C or C++ that is accepted.
82 class LangOptions : public LangOptionsBase {
83 public:
85  using RoundingMode = llvm::RoundingMode;
86 
89 
90  // Automatic variables live on the stack, and when trivial they're usually
91  // uninitialized because it's undefined behavior to use them without
92  // initializing them.
94 
96  // Default C standard behavior.
98 
99  // -fwrapv
101 
102  // -ftrapv
104  };
105 
106  // FIXME: Unify with TUKind.
108  /// Not compiling a module interface at all.
110 
111  /// Compiling a module from a module map.
113 
114  /// Compiling a module header unit.
116 
117  /// Compiling a C++ modules interface unit.
119  };
120 
126  };
127 
129 
137  };
138 
140 
141  // Corresponds to _MSC_VER
143  MSVC2010 = 1600,
144  MSVC2012 = 1700,
145  MSVC2013 = 1800,
146  MSVC2015 = 1900,
147  MSVC2017 = 1910,
148  MSVC2017_5 = 1912,
149  MSVC2017_7 = 1914,
150  MSVC2019 = 1920,
151  MSVC2019_5 = 1925,
152  MSVC2019_8 = 1928,
153  };
154 
159  // The "default" SYCL version to be used when none is specified on the
160  // frontend command line.
162  };
163 
164  enum HLSLLangStd {
166  HLSL_2015 = 2015,
167  HLSL_2016 = 2016,
168  HLSL_2017 = 2017,
169  HLSL_2018 = 2018,
170  HLSL_2021 = 2021,
171  HLSL_202x = 2029,
172  };
173 
174  /// Clang versions with different platform ABI conformance.
175  enum class ClangABI {
176  /// Attempt to be ABI-compatible with code generated by Clang 3.8.x
177  /// (SVN r257626). This causes <1 x long long> to be passed in an
178  /// integer register instead of an SSE register on x64_64.
179  Ver3_8,
180 
181  /// Attempt to be ABI-compatible with code generated by Clang 4.0.x
182  /// (SVN r291814). This causes move operations to be ignored when
183  /// determining whether a class type can be passed or returned directly.
184  Ver4,
185 
186  /// Attempt to be ABI-compatible with code generated by Clang 6.0.x
187  /// (SVN r321711). This causes determination of whether a type is
188  /// standard-layout to ignore collisions between empty base classes
189  /// and between base classes and member subobjects, which affects
190  /// whether we reuse base class tail padding in some ABIs.
191  Ver6,
192 
193  /// Attempt to be ABI-compatible with code generated by Clang 7.0.x
194  /// (SVN r338536). This causes alignof (C++) and _Alignof (C11) to be
195  /// compatible with __alignof (i.e., return the preferred alignment)
196  /// rather than returning the required alignment.
197  Ver7,
198 
199  /// Attempt to be ABI-compatible with code generated by Clang 9.0.x
200  /// (SVN r351319). This causes vectors of __int128 to be passed in memory
201  /// instead of passing in multiple scalar registers on x86_64 on Linux and
202  /// NetBSD.
203  Ver9,
204 
205  /// Attempt to be ABI-compatible with code generated by Clang 11.0.x
206  /// (git 2e10b7a39b93). This causes clang to pass unions with a 256-bit
207  /// vector member on the stack instead of using registers, to not properly
208  /// mangle substitutions for template names in some cases, and to mangle
209  /// declaration template arguments without a cast to the parameter type
210  /// even when that can lead to mangling collisions.
211  Ver11,
212 
213  /// Attempt to be ABI-compatible with code generated by Clang 12.0.x
214  /// (git 8e464dd76bef). This causes clang to mangle lambdas within
215  /// global-scope inline variables incorrectly.
216  Ver12,
217 
218  /// Attempt to be ABI-compatible with code generated by Clang 14.0.x.
219  /// This causes clang to:
220  /// - mangle dependent nested names incorrectly.
221  /// - make trivial only those defaulted copy constructors with a
222  /// parameter-type-list equivalent to the parameter-type-list of an
223  /// implicit declaration.
224  Ver14,
225 
226  /// Attempt to be ABI-compatible with code generated by Clang 15.0.x.
227  /// This causes clang to:
228  /// - Reverse the implementation for DR692, DR1395 and DR1432.
229  /// - pack non-POD members of packed structs.
230  /// - consider classes with defaulted special member functions non-pod.
231  Ver15,
232 
233  /// Conform to the underlying platform's C and C++ ABIs as closely
234  /// as we can.
235  Latest
236  };
237 
238  enum class CoreFoundationABI {
239  /// No interoperability ABI has been specified
240  Unspecified,
241  /// CoreFoundation does not have any language interoperability
242  Standalone,
243  /// Interoperability with the ObjectiveC runtime
244  ObjectiveC,
245  /// Interoperability with the latest known version of the Swift runtime
246  Swift,
247  /// Interoperability with the Swift 5.0 runtime
248  Swift5_0,
249  /// Interoperability with the Swift 4.2 runtime
250  Swift4_2,
251  /// Interoperability with the Swift 4.1 runtime
252  Swift4_1,
253  };
254 
255  enum FPModeKind {
256  // Disable the floating point pragma
258 
259  // Enable the floating point pragma
261 
262  // Aggressively fuse FP ops (E.g. FMA) disregarding pragmas.
264 
265  // Aggressively fuse FP ops and honor pragmas.
267  };
268 
269  /// Possible floating point exception behavior.
271  /// Assume that floating-point exceptions are masked.
273  /// Transformations do not cause new exceptions but may hide some.
275  /// Strictly preserve the floating-point exception semantics.
277  /// Used internally to represent initial unspecified value.
279  };
280 
281  /// Possible float expression evaluation method choices.
283  /// The evaluation method cannot be determined or is inconsistent for this
284  /// target.
286  /// Use the declared type for fp arithmetic.
288  /// Use the type double for fp arithmetic.
290  /// Use extended type for fp arithmetic.
292  /// Used only for FE option processing; this is only used to indicate that
293  /// the user did not specify an explicit evaluation method on the command
294  /// line and so the target should be queried for its default evaluation
295  /// method instead.
297  };
298 
300 
301  /// Possible exception handling behavior.
303 
305  /// Permit no implicit vector bitcasts.
306  None,
307  /// Permit vector bitcasts between integer vectors with different numbers
308  /// of elements but the same total bit-width.
309  Integer,
310  /// Permit vector bitcasts between all vectors with the same total
311  /// bit-width.
312  All,
313  };
314 
315  enum class AltivecSrcCompatKind {
316  // All vector compares produce scalars except vector pixel and vector bool.
317  // The types vector pixel and vector bool return vector results.
318  Mixed,
319  // All vector compares produce vector results as in GCC.
320  GCC,
321  // All vector compares produce scalars as in XL.
322  XL,
323  // Default clang behaviour.
324  Default = Mixed,
325  };
326 
328  /// No signing for any function.
329  None,
330  /// Sign the return address of functions that spill LR.
331  NonLeaf,
332  /// Sign the return address of all functions,
333  All
334  };
335 
337  /// Return address signing uses APIA key.
338  AKey,
339  /// Return address signing uses APIB key.
340  BKey
341  };
342 
343  enum class ThreadModelKind {
344  /// POSIX Threads.
345  POSIX,
346  /// Single Threaded Environment.
347  Single
348  };
349 
350  enum class ExtendArgsKind {
351  /// Integer arguments are sign or zero extended to 32/64 bits
352  /// during default argument promotions.
353  ExtendTo32,
354  ExtendTo64
355  };
356 
357  enum class GPUDefaultStreamKind {
358  /// Legacy default stream
359  Legacy,
360  /// Per-thread default stream
361  PerThread,
362  };
363 
365  None,
366  /// map only explicit default visibilities to exported
367  Explicit,
368  /// map all default visibilities to exported
369  All,
370  };
371 
373  /// Any trailing array member is a FAM.
374  Default = 0,
375  /// Any trailing array member of undefined, 0, or 1 size is a FAM.
377  /// Any trailing array member of undefined or 0 size is a FAM.
378  ZeroOrIncomplete = 2,
379  /// Any trailing array member of undefined size is a FAM.
380  IncompleteOnly = 3,
381  };
382 
383 public:
384  /// The used language standard.
386 
387  /// Set of enabled sanitizers.
389  /// Is at least one coverage instrumentation type enabled.
390  bool SanitizeCoverage = false;
391 
392  /// Paths to files specifying which objects
393  /// (files, functions, variables) should not be instrumented.
394  std::vector<std::string> NoSanitizeFiles;
395 
396  /// Paths to the XRay "always instrument" files specifying which
397  /// objects (files, functions, variables) should be imbued with the XRay
398  /// "always instrument" attribute.
399  /// WARNING: This is a deprecated field and will go away in the future.
400  std::vector<std::string> XRayAlwaysInstrumentFiles;
401 
402  /// Paths to the XRay "never instrument" files specifying which
403  /// objects (files, functions, variables) should be imbued with the XRay
404  /// "never instrument" attribute.
405  /// WARNING: This is a deprecated field and will go away in the future.
406  std::vector<std::string> XRayNeverInstrumentFiles;
407 
408  /// Paths to the XRay attribute list files, specifying which objects
409  /// (files, functions, variables) should be imbued with the appropriate XRay
410  /// attribute(s).
411  std::vector<std::string> XRayAttrListFiles;
412 
413  /// Paths to special case list files specifying which entities
414  /// (files, functions) should or should not be instrumented.
415  std::vector<std::string> ProfileListFiles;
416 
418 
420 
422 
423  /// The name of the handler function to be called when -ftrapv is
424  /// specified.
425  ///
426  /// If none is specified, abort (GCC-compatible behaviour).
428 
429  /// The module currently being compiled as specified by -fmodule-name.
431 
432  /// The name of the current module, of which the main source file
433  /// is a part. If CompilingModule is set, we are compiling the interface
434  /// of this module, otherwise we are compiling an implementation file of
435  /// it. This starts as ModuleName in case -fmodule-name is provided and
436  /// changes during compilation to reflect the current module.
438 
439  /// The names of any features to enable in module 'requires' decls
440  /// in addition to the hard-coded list in Module.cpp and the target features.
441  ///
442  /// This list is sorted.
443  std::vector<std::string> ModuleFeatures;
444 
445  /// Options for parsing comments.
447 
448  /// A list of all -fno-builtin-* function names (e.g., memset).
449  std::vector<std::string> NoBuiltinFuncs;
450 
451  /// A prefix map for __FILE__, __BASE_FILE__ and __builtin_FILE().
452  std::map<std::string, std::string, std::greater<std::string>> MacroPrefixMap;
453 
454  /// Triples of the OpenMP targets that the host code codegen should
455  /// take into account in order to generate accurate offloading descriptors.
456  std::vector<llvm::Triple> OMPTargetTriples;
457 
458  /// Name of the IR file that contains the result of the OpenMP target
459  /// host code generation.
461 
462  /// The user provided compilation unit ID, if non-empty. This is used to
463  /// externalize static variables which is needed to support accessing static
464  /// device variables in host code for single source offloading languages
465  /// like CUDA/HIP.
467 
468  /// C++ ABI to compile with, if specified by the frontend through -fc++-abi=.
469  /// This overrides the default ABI used by the target.
470  std::optional<TargetCXXABI::Kind> CXXABI;
471 
472  /// Indicates whether the front-end is explicitly told that the
473  /// input is a header file (i.e. -x c-header).
474  bool IsHeaderFile = false;
475 
476  /// The default stream kind used for HIP kernel launching.
478 
479  /// The seed used by the randomize structure layout feature.
481 
482  /// Indicates whether the __FILE__ macro should use the target's
483  /// platform-specific file separator or whether it should use the build
484  /// environment's platform-specific file separator.
485  ///
486  /// The plaform-specific path separator is the backslash(\) for Windows and
487  /// forward slash (/) elsewhere.
489 
490  LangOptions();
491 
492  /// Set language defaults for the given input language and
493  /// language standard in the given LangOptions object.
494  ///
495  /// \param Opts - The LangOptions object to set up.
496  /// \param Lang - The input language.
497  /// \param T - The target triple.
498  /// \param Includes - If the language requires extra headers to be implicitly
499  /// included, they will be appended to this list.
500  /// \param LangStd - The input language standard.
501  static void
502  setLangDefaults(LangOptions &Opts, Language Lang, const llvm::Triple &T,
503  std::vector<std::string> &Includes,
505 
506  // Define accessors/mutators for language options of enumeration type.
507 #define LANGOPT(Name, Bits, Default, Description)
508 #define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
509  Type get##Name() const { return static_cast<Type>(Name); } \
510  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
511 #include "clang/Basic/LangOptions.def"
512 
513  /// Are we compiling a module?
514  bool isCompilingModule() const {
515  return getCompilingModule() != CMK_None;
516  }
517 
518  /// Are we compiling a standard c++ module interface?
520  return getCompilingModule() == CMK_ModuleInterface;
521  }
522 
523  /// Are we compiling a module implementation?
525  return !isCompilingModule() && !ModuleName.empty();
526  }
527 
528  /// Do we need to track the owning module for a local declaration?
529  bool trackLocalOwningModule() const {
530  return isCompilingModule() || ModulesLocalVisibility;
531  }
532 
533  bool isSignedOverflowDefined() const {
534  return getSignedOverflowBehavior() == SOB_Defined;
535  }
536 
539  !ObjCSubscriptingLegacyRuntime;
540  }
541 
542  bool isCompatibleWithMSVC(MSVCMajorVersion MajorVersion) const {
543  return MSCompatibilityVersion >= MajorVersion * 100000U;
544  }
545 
546  /// Reset all of the options that are not considered when building a
547  /// module.
548  void resetNonModularOptions();
549 
550  /// Is this a libc/libm function that is no longer recognized as a
551  /// builtin because a -fno-builtin-* option has been specified?
552  bool isNoBuiltinFunc(StringRef Name) const;
553 
554  /// True if any ObjC types may have non-trivial lifetime qualifiers.
556  return ObjCAutoRefCount || ObjCWeak;
557  }
558 
560  return ConvergentFunctions;
561  }
562 
563  /// Return the OpenCL C or C++ version as a VersionTuple.
564  VersionTuple getOpenCLVersionTuple() const;
565 
566  /// Return the OpenCL version that kernel language is compatible with
567  unsigned getOpenCLCompatibleVersion() const;
568 
569  /// Return the OpenCL C or C++ for OpenCL language name and version
570  /// as a string.
572 
573  /// Returns true if functions without prototypes or functions with an
574  /// identifier list (aka K&R C functions) are not allowed.
576  return CPlusPlus || C2x || DisableKNRFunctions;
577  }
578 
579  /// Returns true if implicit function declarations are allowed in the current
580  /// language mode.
582  return !requiresStrictPrototypes() && !OpenCL;
583  }
584 
585  /// Returns true if implicit int is part of the language requirements.
586  bool isImplicitIntRequired() const { return !CPlusPlus && !C99; }
587 
588  /// Returns true if implicit int is supported at all.
589  bool isImplicitIntAllowed() const { return !CPlusPlus && !C2x; }
590 
591  /// Check if return address signing is enabled.
592  bool hasSignReturnAddress() const {
593  return getSignReturnAddressScope() != SignReturnAddressScopeKind::None;
594  }
595 
596  /// Check if return address signing uses AKey.
598  return getSignReturnAddressKey() == SignReturnAddressKeyKind::AKey;
599  }
600 
601  /// Check if leaf functions are also signed.
603  return getSignReturnAddressScope() == SignReturnAddressScopeKind::All;
604  }
605 
606  bool hasSjLjExceptions() const {
607  return getExceptionHandling() == ExceptionHandlingKind::SjLj;
608  }
609 
610  bool hasSEHExceptions() const {
611  return getExceptionHandling() == ExceptionHandlingKind::WinEH;
612  }
613 
614  bool hasDWARFExceptions() const {
615  return getExceptionHandling() == ExceptionHandlingKind::DwarfCFI;
616  }
617 
618  bool hasWasmExceptions() const {
619  return getExceptionHandling() == ExceptionHandlingKind::Wasm;
620  }
621 
622  bool isSYCL() const { return SYCLIsDevice || SYCLIsHost; }
623 
625  return getDefaultVisibilityExportMapping() !=
627  }
628 
630  return getDefaultVisibilityExportMapping() ==
632  }
633 
635  return getDefaultVisibilityExportMapping() ==
637  }
638 
639  /// Remap path prefix according to -fmacro-prefix-path option.
640  void remapPathPrefix(SmallVectorImpl<char> &Path) const;
641 
643  return RoundingMath ? RoundingMode::Dynamic
644  : RoundingMode::NearestTiesToEven;
645  }
646 
648  FPExceptionModeKind EM = getFPExceptionMode();
649  if (EM == FPExceptionModeKind::FPE_Default)
650  return FPExceptionModeKind::FPE_Ignore;
651  return EM;
652  }
653 };
654 
655 /// Floating point control options
656 class FPOptionsOverride;
657 class FPOptions {
658 public:
659  // We start by defining the layout.
660  using storage_type = uint32_t;
661 
662  using RoundingMode = llvm::RoundingMode;
663 
664  static constexpr unsigned StorageBitSize = 8 * sizeof(storage_type);
665 
666  // Define a fake option named "First" so that we have a PREVIOUS even for the
667  // real first option.
668  static constexpr storage_type FirstShift = 0, FirstWidth = 0;
669 #define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
670  static constexpr storage_type NAME##Shift = \
671  PREVIOUS##Shift + PREVIOUS##Width; \
672  static constexpr storage_type NAME##Width = WIDTH; \
673  static constexpr storage_type NAME##Mask = ((1 << NAME##Width) - 1) \
674  << NAME##Shift;
675 #include "clang/Basic/FPOptions.def"
676 
677  static constexpr storage_type TotalWidth = 0
678 #define OPTION(NAME, TYPE, WIDTH, PREVIOUS) +WIDTH
679 #include "clang/Basic/FPOptions.def"
680  ;
681  static_assert(TotalWidth <= StorageBitSize, "Too short type for FPOptions");
682 
683 private:
685 
686  FPOptionsOverride getChangesSlow(const FPOptions &Base) const;
687 
688 public:
689  FPOptions() : Value(0) {
690  setFPContractMode(LangOptions::FPM_Off);
691  setConstRoundingMode(RoundingMode::Dynamic);
692  setSpecifiedExceptionMode(LangOptions::FPE_Default);
693  }
694  explicit FPOptions(const LangOptions &LO) {
695  Value = 0;
696  // The language fp contract option FPM_FastHonorPragmas has the same effect
697  // as FPM_Fast in frontend. For simplicity, use FPM_Fast uniformly in
698  // frontend.
699  auto LangOptContractMode = LO.getDefaultFPContractMode();
700  if (LangOptContractMode == LangOptions::FPM_FastHonorPragmas)
701  LangOptContractMode = LangOptions::FPM_Fast;
702  setFPContractMode(LangOptContractMode);
703  setRoundingMath(LO.RoundingMath);
704  setConstRoundingMode(LangOptions::RoundingMode::Dynamic);
705  setSpecifiedExceptionMode(LO.getFPExceptionMode());
706  setAllowFPReassociate(LO.AllowFPReassoc);
707  setNoHonorNaNs(LO.NoHonorNaNs);
708  setNoHonorInfs(LO.NoHonorInfs);
709  setNoSignedZero(LO.NoSignedZero);
710  setAllowReciprocal(LO.AllowRecip);
711  setAllowApproxFunc(LO.ApproxFunc);
712  if (getFPContractMode() == LangOptions::FPM_On &&
713  getRoundingMode() == llvm::RoundingMode::Dynamic &&
715  // If the FP settings are set to the "strict" model, then
716  // FENV access is set to true. (ffp-model=strict)
717  setAllowFEnvAccess(true);
718  else
719  setAllowFEnvAccess(LangOptions::FPM_Off);
720  }
721 
723  return getFPContractMode() == LangOptions::FPM_On;
724  }
726  setFPContractMode(LangOptions::FPM_On);
727  }
728 
730  return getFPContractMode() == LangOptions::FPM_Fast;
731  }
733  setFPContractMode(LangOptions::FPM_Fast);
734  }
735 
736  bool isFPConstrained() const {
737  return getRoundingMode() != llvm::RoundingMode::NearestTiesToEven ||
739  getAllowFEnvAccess();
740  }
741 
743  RoundingMode RM = getConstRoundingMode();
744  if (RM == RoundingMode::Dynamic) {
745  // C2x: 7.6.2p3 If the FE_DYNAMIC mode is specified and FENV_ACCESS is
746  // "off", the translator may assume that the default rounding mode is in
747  // effect.
748  if (!getAllowFEnvAccess() && !getRoundingMath())
749  RM = RoundingMode::NearestTiesToEven;
750  }
751  return RM;
752  }
753 
755  LangOptions::FPExceptionModeKind EM = getSpecifiedExceptionMode();
756  if (EM == LangOptions::FPExceptionModeKind::FPE_Default) {
757  if (getAllowFEnvAccess())
758  return LangOptions::FPExceptionModeKind::FPE_Strict;
759  else
760  return LangOptions::FPExceptionModeKind::FPE_Ignore;
761  }
762  return EM;
763  }
764 
765  bool operator==(FPOptions other) const { return Value == other.Value; }
766 
767  /// Return the default value of FPOptions that's used when trailing
768  /// storage isn't required.
770 
771  storage_type getAsOpaqueInt() const { return Value; }
773  FPOptions Opts;
774  Opts.Value = Value;
775  return Opts;
776  }
777 
778  /// Return difference with the given option set.
780 
781  // We can define most of the accessors automatically:
782 #define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
783  TYPE get##NAME() const { \
784  return static_cast<TYPE>((Value & NAME##Mask) >> NAME##Shift); \
785  } \
786  void set##NAME(TYPE value) { \
787  Value = (Value & ~NAME##Mask) | (storage_type(value) << NAME##Shift); \
788  }
789 #include "clang/Basic/FPOptions.def"
790  LLVM_DUMP_METHOD void dump();
791 };
792 
793 /// Represents difference between two FPOptions values.
794 ///
795 /// The effect of language constructs changing the set of floating point options
796 /// is usually a change of some FP properties while leaving others intact. This
797 /// class describes such changes by keeping information about what FP options
798 /// are overridden.
799 ///
800 /// The integral set of FP options, described by the class FPOptions, may be
801 /// represented as a default FP option set, defined by language standard and
802 /// command line options, with the overrides introduced by pragmas.
803 ///
804 /// The is implemented as a value of the new FPOptions plus a mask showing which
805 /// fields are actually set in it.
808  FPOptions::storage_type OverrideMask = 0;
809 
810 public:
811  using RoundingMode = llvm::RoundingMode;
812 
813  /// The type suitable for storing values of FPOptionsOverride. Must be twice
814  /// as wide as bit size of FPOption.
816  static_assert(sizeof(storage_type) >= 2 * sizeof(FPOptions::storage_type),
817  "Too short type for FPOptionsOverride");
818 
819  /// Bit mask selecting bits of OverrideMask in serialized representation of
820  /// FPOptionsOverride.
821  static constexpr storage_type OverrideMaskBits =
822  (static_cast<storage_type>(1) << FPOptions::StorageBitSize) - 1;
823 
826  : Options(LO), OverrideMask(OverrideMaskBits) {}
828  : Options(FPO), OverrideMask(OverrideMaskBits) {}
830  : Options(FPO), OverrideMask(Mask) {}
831 
832  bool requiresTrailingStorage() const { return OverrideMask != 0; }
833 
835  setFPContractModeOverride(LangOptions::FPM_On);
836  }
837 
839  setFPContractModeOverride(LangOptions::FPM_Fast);
840  }
841 
843  setFPContractModeOverride(LangOptions::FPM_Off);
844  }
845 
847  setAllowFPReassociateOverride(!Value);
848  setNoHonorNaNsOverride(!Value);
849  setNoHonorInfsOverride(!Value);
850  setNoSignedZeroOverride(!Value);
851  setAllowReciprocalOverride(!Value);
852  setAllowApproxFuncOverride(!Value);
853  if (Value)
854  /* Precise mode implies fp_contract=on and disables ffast-math */
856  else
857  /* Precise mode disabled sets fp_contract=fast and enables ffast-math */
859  }
860 
862  return (static_cast<storage_type>(Options.getAsOpaqueInt())
864  OverrideMask;
865  }
867  FPOptionsOverride Opts;
868  Opts.OverrideMask = I & OverrideMaskBits;
870  return Opts;
871  }
872 
874  FPOptions Result =
875  FPOptions::getFromOpaqueInt((Base.getAsOpaqueInt() & ~OverrideMask) |
876  (Options.getAsOpaqueInt() & OverrideMask));
877  return Result;
878  }
879 
881  return applyOverrides(FPOptions(LO));
882  }
883 
884  bool operator==(FPOptionsOverride other) const {
885  return Options == other.Options && OverrideMask == other.OverrideMask;
886  }
887  bool operator!=(FPOptionsOverride other) const { return !(*this == other); }
888 
889 #define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
890  bool has##NAME##Override() const { \
891  return OverrideMask & FPOptions::NAME##Mask; \
892  } \
893  TYPE get##NAME##Override() const { \
894  assert(has##NAME##Override()); \
895  return Options.get##NAME(); \
896  } \
897  void clear##NAME##Override() { \
898  /* Clear the actual value so that we don't have spurious differences when \
899  * testing equality. */ \
900  Options.set##NAME(TYPE(0)); \
901  OverrideMask &= ~FPOptions::NAME##Mask; \
902  } \
903  void set##NAME##Override(TYPE value) { \
904  Options.set##NAME(value); \
905  OverrideMask |= FPOptions::NAME##Mask; \
906  }
907 #include "clang/Basic/FPOptions.def"
908  LLVM_DUMP_METHOD void dump();
909 };
910 
912  if (Value == Base.Value)
913  return FPOptionsOverride();
914  return getChangesSlow(Base);
915 }
916 
917 /// Describes the kind of translation unit being processed.
918 enum TranslationUnitKind {
919  /// The translation unit is a complete translation unit.
920  TU_Complete,
921 
922  /// The translation unit is a prefix to a translation unit, and is
923  /// not complete.
924  TU_Prefix,
925 
926  /// The translation unit is a module.
927  TU_Module,
928 
929  /// The translation unit is a is a complete translation unit that we might
930  /// incrementally extend later.
932 };
933 
934 } // namespace clang
935 
936 #endif // LLVM_CLANG_BASIC_LANGOPTIONS_H
clang::OpenCL
@ OpenCL
Definition: LangStandard.h:62
clang::LangOptions::LaxVectorConversionKind
LaxVectorConversionKind
Definition: LangOptions.h:304
clang::LangOptions::SignReturnAddressScopeKind
SignReturnAddressScopeKind
Definition: LangOptions.h:327
clang::LangOptions::DCC_FastCall
@ DCC_FastCall
Definition: LangOptions.h:133
clang::LangOptions::PPTMK_FullGeneralitySingleInheritance
@ PPTMK_FullGeneralitySingleInheritance
Definition: LangOptions.h:123
clang::FPOptionsOverride::operator==
bool operator==(FPOptionsOverride other) const
Definition: LangOptions.h:884
clang::LangOptions::ExcessPrecisionKind
ExcessPrecisionKind
Definition: LangOptions.h:299
clang::LangOptions::CurrentModule
std::string CurrentModule
The name of the current module, of which the main source file is a part.
Definition: LangOptions.h:437
clang::FPOptionsOverride::setAllowFPContractAcrossStatement
void setAllowFPContractAcrossStatement()
Definition: LangOptions.h:838
clang::ShaderStage::Pixel
@ Pixel
clang::LangOptions::isExplicitDefaultVisibilityExportMapping
bool isExplicitDefaultVisibilityExportMapping() const
Definition: LangOptions.h:629
clang::LangOptions::isSignedOverflowDefined
bool isSignedOverflowDefined() const
Definition: LangOptions.h:533
clang::LangOptions::hasSEHExceptions
bool hasSEHExceptions() const
Definition: LangOptions.h:610
clang::LangOptions::ExceptionHandlingKind::DwarfCFI
@ DwarfCFI
clang::LangOptions::CMK_ModuleInterface
@ CMK_ModuleInterface
Compiling a C++ modules interface unit.
Definition: LangOptions.h:118
clang::LangOptions::HLSL_2021
@ HLSL_2021
Definition: LangOptions.h:170
Visibility.h
clang::LangOptions::ExceptionHandlingKind::None
@ None
clang::LangOptions::XRayAlwaysInstrumentFiles
std::vector< std::string > XRayAlwaysInstrumentFiles
Paths to the XRay "always instrument" files specifying which objects (files, functions,...
Definition: LangOptions.h:400
clang::FPOptions::isFPConstrained
bool isFPConstrained() const
Definition: LangOptions.h:736
clang::LangOptions::HLSL_Unset
@ HLSL_Unset
Definition: LangOptions.h:165
clang::LangOptions::StrictFlexArraysLevelKind::OneZeroOrIncomplete
@ OneZeroOrIncomplete
Any trailing array member of undefined, 0, or 1 size is a FAM.
clang::LangOptions::TrivialAutoVarInitKind::Zero
@ Zero
ObjCRuntime.h
clang::LangOptions::getOpenCLCompatibleVersion
unsigned getOpenCLCompatibleVersion() const
Return the OpenCL version that kernel language is compatible with.
Definition: LangOptions.cpp:55
clang::LangOptions::CoreFoundationABI::Swift
@ Swift
Interoperability with the latest known version of the Swift runtime.
clang::LangOptions::StackProtectorMode
StackProtectorMode
Definition: LangOptions.h:88
clang::LangOptions::isSignReturnAddressScopeAll
bool isSignReturnAddressScopeAll() const
Check if leaf functions are also signed.
Definition: LangOptions.h:602
clang::LangOptions::SYCLMajorVersion
SYCLMajorVersion
Definition: LangOptions.h:155
clang::FPOptionsOverride::requiresTrailingStorage
bool requiresTrailingStorage() const
Definition: LangOptions.h:832
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:23
clang::LangOptions::HLSLLangStd
HLSLLangStd
Definition: LangOptions.h:164
clang::LangOptions::ClangABI::Latest
@ Latest
Conform to the underlying platform's C and C++ ABIs as closely as we can.
clang::LangOptions::AltivecSrcCompatKind::GCC
@ GCC
clang::LangOptions::ExceptionHandlingKind::Wasm
@ Wasm
clang::LangOptions::SSPStrong
@ SSPStrong
Definition: LangOptions.h:88
clang::LangOptions::HLSL_2018
@ HLSL_2018
Definition: LangOptions.h:169
clang::ShaderStage::Library
@ Library
clang::LangOptions::ASMM_On
@ ASMM_On
Definition: LangOptions.h:139
clang::FPOptions::FirstShift
static constexpr storage_type FirstShift
Definition: LangOptions.h:668
clang::LangOptions::isCompilingModule
bool isCompilingModule() const
Are we compiling a module?
Definition: LangOptions.h:514
clang::LangOptions::OverflowHandler
std::string OverflowHandler
The name of the handler function to be called when -ftrapv is specified.
Definition: LangOptions.h:427
clang::LangOptions::ClangABI::Ver11
@ Ver11
Attempt to be ABI-compatible with code generated by Clang 11.0.x (git 2e10b7a39b93).
clang::LangOptions::ASMM_Off
@ ASMM_Off
Definition: LangOptions.h:139
clang::LangOptions::assumeFunctionsAreConvergent
bool assumeFunctionsAreConvergent() const
Definition: LangOptions.h:559
clang::LangOptions::FPE_MayTrap
@ FPE_MayTrap
Transformations do not cause new exceptions but may hide some.
Definition: LangOptions.h:274
clang::FPOptions::operator==
bool operator==(FPOptions other) const
Definition: LangOptions.h:765
clang::LangOptions::CoreFoundationABI::Unspecified
@ Unspecified
No interoperability ABI has been specified.
clang::LangOptions::MSVC2010
@ MSVC2010
Definition: LangOptions.h:143
clang::LangOptions::CFRuntime
CoreFoundationABI CFRuntime
Definition: LangOptions.h:419
clang::LangOptions::SSPReq
@ SSPReq
Definition: LangOptions.h:88
clang::FPOptionsOverride::OverrideMaskBits
static constexpr storage_type OverrideMaskBits
Bit mask selecting bits of OverrideMask in serialized representation of FPOptionsOverride.
Definition: LangOptions.h:821
clang::LangOptions::ObjCConstantStringClass
std::string ObjCConstantStringClass
Definition: LangOptions.h:421
clang::LangOptions::allowsNonTrivialObjCLifetimeQualifiers
bool allowsNonTrivialObjCLifetimeQualifiers() const
True if any ObjC types may have non-trivial lifetime qualifiers.
Definition: LangOptions.h:555
clang::LangOptions::FPM_On
@ FPM_On
Definition: LangOptions.h:260
clang::LangOptions::SignReturnAddressScopeKind::NonLeaf
@ NonLeaf
Sign the return address of functions that spill LR.
clang::C99
@ C99
Definition: LangStandard.h:49
clang::LangOptions::SignReturnAddressScopeKind::None
@ None
No signing for any function.
clang::LangOptions::getDefaultRoundingMode
RoundingMode getDefaultRoundingMode() const
Definition: LangOptions.h:642
clang::FPOptions::FPOptions
FPOptions(const LangOptions &LO)
Definition: LangOptions.h:694
clang::LangOptions::CMK_ModuleMap
@ CMK_ModuleMap
Compiling a module from a module map.
Definition: LangOptions.h:112
clang::ShaderStage::Domain
@ Domain
clang::FPOptionsOverride::FPOptionsOverride
FPOptionsOverride()
Definition: LangOptions.h:824
clang::LangOptions::XRayAttrListFiles
std::vector< std::string > XRayAttrListFiles
Paths to the XRay attribute list files, specifying which objects (files, functions,...
Definition: LangOptions.h:411
clang::LangOptions::CoreFoundationABI::Swift4_1
@ Swift4_1
Interoperability with the Swift 4.1 runtime.
clang::LangOptions::implicitFunctionsAllowed
bool implicitFunctionsAllowed() const
Returns true if implicit function declarations are allowed in the current language mode.
Definition: LangOptions.h:581
clang::LangOptions::GCOnly
@ GCOnly
Definition: LangOptions.h:87
clang::LangOptions::isCompilingModuleInterface
bool isCompilingModuleInterface() const
Are we compiling a standard c++ module interface?
Definition: LangOptions.h:519
clang::LangOptions::DCC_None
@ DCC_None
Definition: LangOptions.h:131
clang::LangOptions::GCMode
GCMode
Definition: LangOptions.h:87
clang::FPOptions::setAllowFPContractWithinStatement
void setAllowFPContractWithinStatement()
Definition: LangOptions.h:725
clang::LangOptions::getOpenCLVersionString
std::string getOpenCLVersionString() const
Return the OpenCL C or C++ for OpenCL language name and version as a string.
Definition: LangOptions.cpp:71
clang::LangOptions::hasDWARFExceptions
bool hasDWARFExceptions() const
Definition: LangOptions.h:614
clang::FPOptionsOverride::setFPPreciseEnabled
void setFPPreciseEnabled(bool Value)
Definition: LangOptions.h:846
clang::LangOptions::MacroPrefixMap
std::map< std::string, std::string, std::greater< std::string > > MacroPrefixMap
A prefix map for FILE, BASE_FILE and __builtin_FILE().
Definition: LangOptions.h:452
clang::MSVtorDispMode::ForVFTable
@ ForVFTable
clang::MSVtorDispMode
MSVtorDispMode
In the Microsoft ABI, this controls the placement of virtual displacement members used to implement v...
Definition: LangOptions.h:55
clang::FPOptions::RoundingMode
llvm::RoundingMode RoundingMode
Definition: LangOptions.h:662
clang::ShaderStage::Vertex
@ Vertex
clang::LangOptions::DefaultCallingConvention
DefaultCallingConvention
Definition: LangOptions.h:130
clang::LangOptions::SignReturnAddressKeyKind::AKey
@ AKey
Return address signing uses APIA key.
clang::LangOptions::HLSL_2017
@ HLSL_2017
Definition: LangOptions.h:168
clang::TU_Prefix
@ TU_Prefix
The translation unit is a prefix to a translation unit, and is not complete.
Definition: LangOptions.h:923
clang::LangOptions::CompilingModuleKind
CompilingModuleKind
Definition: LangOptions.h:107
clang::LangStandard::Kind
Kind
Definition: LangStandard.h:69
clang::LangOptions::TrivialAutoVarInitKind
TrivialAutoVarInitKind
Definition: LangOptions.h:93
clang::LangOptions::DefaultVisiblityExportMapping::All
@ All
map all default visibilities to exported
U
clang::LangOptions::PPTMK_FullGeneralityVirtualInheritance
@ PPTMK_FullGeneralityVirtualInheritance
Definition: LangOptions.h:125
clang::FPOptionsOverride::FPOptionsOverride
FPOptionsOverride(const LangOptions &LO)
Definition: LangOptions.h:825
clang::LangOptions::SanitizeCoverage
bool SanitizeCoverage
Is at least one coverage instrumentation type enabled.
Definition: LangOptions.h:390
clang::TU_Module
@ TU_Module
The translation unit is a module.
Definition: LangOptions.h:926
clang::LangOptions::SSPOff
@ SSPOff
Definition: LangOptions.h:88
clang::FPOptions::getAsOpaqueInt
storage_type getAsOpaqueInt() const
Definition: LangOptions.h:771
clang::LangOptions::SOB_Trapping
@ SOB_Trapping
Definition: LangOptions.h:103
clang::LangOptions::isCompilingModuleImplementation
bool isCompilingModuleImplementation() const
Are we compiling a module implementation?
Definition: LangOptions.h:524
clang::LangOptions::ClangABI::Ver12
@ Ver12
Attempt to be ABI-compatible with code generated by Clang 12.0.x (git 8e464dd76bef).
clang::LangOptions::LaxVectorConversionKind::Integer
@ Integer
Permit vector bitcasts between integer vectors with different numbers of elements but the same total ...
clang::LangOptions::isCompatibleWithMSVC
bool isCompatibleWithMSVC(MSVCMajorVersion MajorVersion) const
Definition: LangOptions.h:542
clang::FPOptions::getRoundingMode
RoundingMode getRoundingMode() const
Definition: LangOptions.h:742
clang::LangOptions::AltivecSrcCompatKind
AltivecSrcCompatKind
Definition: LangOptions.h:315
clang::FPOptionsOverride::applyOverrides
FPOptions applyOverrides(const LangOptions &LO)
Definition: LangOptions.h:880
clang::SanitizerSet
Definition: Sanitizers.h:153
clang::LangOptions::ObjCRuntime
clang::ObjCRuntime ObjCRuntime
Definition: LangOptions.h:417
clang::LangOptions::OMPTargetTriples
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:456
clang::LangOptions::CMK_None
@ CMK_None
Not compiling a module interface at all.
Definition: LangOptions.h:109
clang::LangOptions::CoreFoundationABI::ObjectiveC
@ ObjectiveC
Interoperability with the ObjectiveC runtime.
clang::LangOptions::MSVCMajorVersion
MSVCMajorVersion
Definition: LangOptions.h:142
clang::LangOptions::isImplicitIntRequired
bool isImplicitIntRequired() const
Returns true if implicit int is part of the language requirements.
Definition: LangOptions.h:586
hlsl::uint64_t
unsigned long uint64_t
Definition: hlsl_basic_types.h:25
clang::LangOptions::hasWasmExceptions
bool hasWasmExceptions() const
Definition: LangOptions.h:618
clang::LangOptions::MSVC2019
@ MSVC2019
Definition: LangOptions.h:150
clang::LangOptionsBase
Bitfields of LangOptions, split out from LangOptions in order to ensure that this large collection of...
Definition: LangOptions.h:35
clang::FPOptionsOverride
Represents difference between two FPOptions values.
Definition: LangOptions.h:806
clang::FPOptions::getExceptionMode
LangOptions::FPExceptionModeKind getExceptionMode() const
Definition: LangOptions.h:754
clang::LangOptions::FPExceptionModeKind
FPExceptionModeKind
Possible floating point exception behavior.
Definition: LangOptions.h:270
clang::TU_Incremental
@ TU_Incremental
The translation unit is a is a complete translation unit that we might incrementally extend later.
Definition: LangOptions.h:930
clang::CPlusPlus
@ CPlusPlus
Definition: LangStandard.h:53
clang::LangOptions::ThreadModelKind::POSIX
@ POSIX
POSIX Threads.
clang::FPOptions::allowFPContractWithinStatement
bool allowFPContractWithinStatement() const
Definition: LangOptions.h:722
clang::LangOptions::FPEvalMethodKind
FPEvalMethodKind
Possible float expression evaluation method choices.
Definition: LangOptions.h:282
clang::FPOptionsOverride::applyOverrides
FPOptions applyOverrides(FPOptions Base)
Definition: LangOptions.h:873
clang::LangOptions::HLSL_2015
@ HLSL_2015
Definition: LangOptions.h:166
clang::LangOptions::ExtendArgsKind
ExtendArgsKind
Definition: LangOptions.h:350
clang::LangOptions::FPP_None
@ FPP_None
Definition: LangOptions.h:299
clang::FPOptions
Definition: LangOptions.h:657
clang::LangOptions::ModuleFeatures
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:443
clang::LangOptions::NoBuiltinFuncs
std::vector< std::string > NoBuiltinFuncs
A list of all -fno-builtin-* function names (e.g., memset).
Definition: LangOptions.h:449
clang::LangOptions::CoreFoundationABI
CoreFoundationABI
Definition: LangOptions.h:238
clang::LangOptions::TrivialAutoVarInitKind::Uninitialized
@ Uninitialized
clang::ShaderStage::AnyHit
@ AnyHit
clang::LangOptions::SYCL_Default
@ SYCL_Default
Definition: LangOptions.h:161
clang::LangOptions::hasSjLjExceptions
bool hasSjLjExceptions() const
Definition: LangOptions.h:606
clang::LangOptions::SYCL_2017
@ SYCL_2017
Definition: LangOptions.h:157
clang::LangOptions::CoreFoundationABI::Swift5_0
@ Swift5_0
Interoperability with the Swift 5.0 runtime.
clang::LangOptions::HybridGC
@ HybridGC
Definition: LangOptions.h:87
clang::FPOptionsOverride::FPOptionsOverride
FPOptionsOverride(FPOptions FPO)
Definition: LangOptions.h:827
clang::LangOptions::DCC_VectorCall
@ DCC_VectorCall
Definition: LangOptions.h:135
clang::LangOptions::DefaultVisiblityExportMapping::None
@ None
clang::LangOptions::IsHeaderFile
bool IsHeaderFile
Indicates whether the front-end is explicitly told that the input is a header file (i....
Definition: LangOptions.h:474
Base
clang::LangOptions::ExtendArgsKind::ExtendTo32
@ ExtendTo32
Integer arguments are sign or zero extended to 32/64 bits during default argument promotions.
clang::LangOptions::ClangABI::Ver4
@ Ver4
Attempt to be ABI-compatible with code generated by Clang 4.0.x (SVN r291814).
clang::LangOptions::getDefaultExceptionMode
FPExceptionModeKind getDefaultExceptionMode() const
Definition: LangOptions.h:647
clang::FPOptions::defaultWithoutTrailingStorage
static FPOptions defaultWithoutTrailingStorage(const LangOptions &LO)
Return the default value of FPOptions that's used when trailing storage isn't required.
Definition: LangOptions.cpp:202
clang::LangOptions::ExtendArgsKind::ExtendTo64
@ ExtendTo64
clang::ShaderStage::Invalid
@ Invalid
clang::LangOptions::isNoBuiltinFunc
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:41
clang::LangOptions::ClangABI
ClangABI
Clang versions with different platform ABI conformance.
Definition: LangOptions.h:175
clang::LangOptions::SYCL_None
@ SYCL_None
Definition: LangOptions.h:156
clang::LangOptions::isAllDefaultVisibilityExportMapping
bool isAllDefaultVisibilityExportMapping() const
Definition: LangOptions.h:634
clang::ShaderStage::Geometry
@ Geometry
TargetCXXABI.h
clang::Visibility
Visibility
Describes the different kinds of visibility that a declaration may have.
Definition: Visibility.h:33
clang::MSVtorDispMode::Never
@ Never
clang::ShaderStage::RayGeneration
@ RayGeneration
clang::LangOptions::DCC_CDecl
@ DCC_CDecl
Definition: LangOptions.h:132
clang::LangOptions::FPP_Standard
@ FPP_Standard
Definition: LangOptions.h:299
clang::LangOptions::Sanitize
SanitizerSet Sanitize
Set of enabled sanitizers.
Definition: LangOptions.h:388
clang::LangOptions::GPUDefaultStreamKind
GPUDefaultStreamKind
Definition: LangOptions.h:357
clang::LangOptions::FEM_UnsetOnCommandLine
@ 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:296
clang::LangOptions::FPModeKind
FPModeKind
Definition: LangOptions.h:255
clang::LangOptions::XRayNeverInstrumentFiles
std::vector< std::string > XRayNeverInstrumentFiles
Paths to the XRay "never instrument" files specifying which objects (files, functions,...
Definition: LangOptions.h:406
clang::LangOptions::FEM_Indeterminable
@ FEM_Indeterminable
The evaluation method cannot be determined or is inconsistent for this target.
Definition: LangOptions.h:285
clang::LangOptions::CXXABI
std::optional< TargetCXXABI::Kind > CXXABI
C++ ABI to compile with, if specified by the frontend through -fc++-abi=.
Definition: LangOptions.h:470
clang::LangOptions::SOB_Undefined
@ SOB_Undefined
Definition: LangOptions.h:97
clang::FPOptionsOverride::operator!=
bool operator!=(FPOptionsOverride other) const
Definition: LangOptions.h:887
clang::LangOptions::HLSL_202x
@ HLSL_202x
Definition: LangOptions.h:171
clang::LangOptions::LangOptions
LangOptions()
Definition: LangOptions.cpp:19
clang::LangOptions::UseTargetPathSeparator
bool UseTargetPathSeparator
Indicates whether the FILE macro should use the target's platform-specific file separator or whether ...
Definition: LangOptions.h:488
clang::LangOptions::hasDefaultVisibilityExportMapping
bool hasDefaultVisibilityExportMapping() const
Definition: LangOptions.h:624
clang::LangOptions::getOpenCLVersionTuple
VersionTuple getOpenCLVersionTuple() const
Return the OpenCL C or C++ version as a VersionTuple.
Definition: LangOptions.cpp:48
clang::FPOptions::getChangesFrom
FPOptionsOverride getChangesFrom(const FPOptions &Base) const
Return difference with the given option set.
Definition: LangOptions.h:910
clang::LangOptions::FPP_Fast
@ FPP_Fast
Definition: LangOptions.h:299
clang::LangOptions::FEM_Source
@ FEM_Source
Use the declared type for fp arithmetic.
Definition: LangOptions.h:287
clang::MSVtorDispMode::ForVBaseOverride
@ ForVBaseOverride
clang::ShaderStage::Amplification
@ Amplification
clang::LangOptions::ExceptionHandlingKind
ExceptionHandlingKind
Possible exception handling behavior.
Definition: LangOptions.h:302
clang::Language
Language
The language for the input, used to select and validate the language standard and possible actions.
Definition: LangStandard.h:23
clang::LangOptions::NoSanitizeFiles
std::vector< std::string > NoSanitizeFiles
Paths to files specifying which objects (files, functions, variables) should not be instrumented.
Definition: LangOptions.h:394
clang::LangOptions::StrictFlexArraysLevelKind
StrictFlexArraysLevelKind
Definition: LangOptions.h:372
clang::LangOptions::DefaultVisiblityExportMapping::Explicit
@ Explicit
map only explicit default visibilities to exported
clang::CommentOptions
Options for controlling comment parsing.
Definition: CommentOptions.h:23
LangStandard.h
clang::LangOptions::NonGC
@ NonGC
Definition: LangOptions.h:87
clang::LangOptions::ExceptionHandlingKind::SjLj
@ SjLj
clang::ShaderStage::ClosestHit
@ ClosestHit
clang::LangOptions::SignedOverflowBehaviorTy
SignedOverflowBehaviorTy
Definition: LangOptions.h:95
clang::LangOptions::ThreadModelKind
ThreadModelKind
Definition: LangOptions.h:343
clang::LangOptions::StrictFlexArraysLevelKind::Default
@ Default
Any trailing array member is a FAM.
clang::C2x
@ C2x
Definition: LangStandard.h:52
clang::LangOptions::LaxVectorConversionKind::All
@ All
Permit vector bitcasts between all vectors with the same total bit-width.
clang::LangOptions::ASMM_Target
@ ASMM_Target
Definition: LangOptions.h:139
clang::LangOptions::AltivecSrcCompatKind::Default
@ Default
clang::LangOptions::setLangDefaults
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:81
clang::LangOptions::SYCL_2020
@ SYCL_2020
Definition: LangOptions.h:158
clang::LangOptions::ClangABI::Ver3_8
@ Ver3_8
Attempt to be ABI-compatible with code generated by Clang 3.8.x (SVN r257626).
Value
Value
Definition: UninitializedValues.cpp:102
clang::LangOptions::GPUDefaultStream
GPUDefaultStreamKind GPUDefaultStream
The default stream kind used for HIP kernel launching.
Definition: LangOptions.h:477
clang::LangOptions::DCC_RegCall
@ DCC_RegCall
Definition: LangOptions.h:136
clang::LangOptions::SSPOn
@ SSPOn
Definition: LangOptions.h:88
LLVM.h
clang::LangOptions::AltivecSrcCompatKind::XL
@ XL
clang::LangOptions::ThreadModelKind::Single
@ Single
Single Threaded Environment.
clang::LangOptions::MSVC2017
@ MSVC2017
Definition: LangOptions.h:147
clang::LangOptions::FPM_FastHonorPragmas
@ FPM_FastHonorPragmas
Definition: LangOptions.h:266
clang::FPOptions::TotalWidth
static constexpr storage_type TotalWidth
Definition: LangOptions.h:677
clang::LangOptions::TrivialAutoVarInitKind::Pattern
@ Pattern
clang::LangOptions::isImplicitIntAllowed
bool isImplicitIntAllowed() const
Returns true if implicit int is supported at all.
Definition: LangOptions.h:589
clang::LangStandard::lang_unspecified
@ lang_unspecified
Definition: LangStandard.h:73
clang::LangOptions::hasSignReturnAddress
bool hasSignReturnAddress() const
Check if return address signing is enabled.
Definition: LangOptions.h:592
clang::LangOptions::CUID
std::string CUID
The user provided compilation unit ID, if non-empty.
Definition: LangOptions.h:466
clang::ObjCRuntime
The basic abstraction for the target Objective-C runtime.
Definition: ObjCRuntime.h:28
clang::LangOptions::isSubscriptPointerArithmetic
bool isSubscriptPointerArithmetic() const
Definition: LangOptions.h:537
clang::LangOptions::LangStd
LangStandard::Kind LangStd
The used language standard.
Definition: LangOptions.h:385
clang::FPOptionsOverride::dump
LLVM_DUMP_METHOD void dump()
Definition: LangOptions.cpp:223
clang::LangOptions::isSYCL
bool isSYCL() const
Definition: LangOptions.h:622
clang::LangOptions
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition: LangOptions.h:82
clang::LangOptions::LaxVectorConversionKind::None
@ None
Permit no implicit vector bitcasts.
clang::FPOptions::storage_type
uint32_t storage_type
Definition: LangOptions.h:660
clang::LangOptions::ProfileListFiles
std::vector< std::string > ProfileListFiles
Paths to special case list files specifying which entities (files, functions) should or should not be...
Definition: LangOptions.h:415
clang::LangOptions::AltivecSrcCompatKind::Mixed
@ Mixed
clang::TranslationUnitKind
TranslationUnitKind
Describes the kind of translation unit being processed.
Definition: LangOptions.h:917
Sanitizers.h
clang::FPOptions::FPOptions
FPOptions()
Definition: LangOptions.h:689
clang::LangOptions::ClangABI::Ver9
@ Ver9
Attempt to be ABI-compatible with code generated by Clang 9.0.x (SVN r351319).
clang::FPOptionsOverride::getFromOpaqueInt
static FPOptionsOverride getFromOpaqueInt(storage_type I)
Definition: LangOptions.h:866
clang::LangOptions::SignReturnAddressKeyKind
SignReturnAddressKeyKind
Definition: LangOptions.h:336
clang::LangOptions::ClangABI::Ver15
@ Ver15
Attempt to be ABI-compatible with code generated by Clang 15.0.x.
clang::LangOptions::StrictFlexArraysLevelKind::IncompleteOnly
@ IncompleteOnly
Any trailing array member of undefined size is a FAM.
clang::LangOptions::StrictFlexArraysLevelKind::ZeroOrIncomplete
@ ZeroOrIncomplete
Any trailing array member of undefined or 0 size is a FAM.
clang::LangOptions::PragmaMSPointersToMembersKind
PragmaMSPointersToMembersKind
Definition: LangOptions.h:121
clang::LangOptions::FEM_Double
@ FEM_Double
Use the type double for fp arithmetic.
Definition: LangOptions.h:289
clang::LangOptions::GPUDefaultStreamKind::PerThread
@ PerThread
Per-thread default stream.
clang::LangOptions::DCC_StdCall
@ DCC_StdCall
Definition: LangOptions.h:134
clang::LangOptions::ExceptionHandlingKind::WinEH
@ WinEH
clang
Definition: CalledOnceCheck.h:17
clang::LangOptions::RandstructSeed
std::string RandstructSeed
The seed used by the randomize structure layout feature.
Definition: LangOptions.h:480
clang::LangOptions::MSVC2015
@ MSVC2015
Definition: LangOptions.h:146
clang::LangOptions::OMPHostIRFile
std::string OMPHostIRFile
Name of the IR file that contains the result of the OpenMP target host code generation.
Definition: LangOptions.h:460
clang::LangOptions::PPTMK_BestCase
@ PPTMK_BestCase
Definition: LangOptions.h:122
clang::LangOptions::MSVC2019_8
@ MSVC2019_8
Definition: LangOptions.h:152
clang::LangOptions::HLSL_2016
@ HLSL_2016
Definition: LangOptions.h:167
clang::ShaderStage::Intersection
@ Intersection
clang::LangOptions::isSignReturnAddressWithAKey
bool isSignReturnAddressWithAKey() const
Check if return address signing uses AKey.
Definition: LangOptions.h:597
clang::LangOptions::CoreFoundationABI::Standalone
@ Standalone
CoreFoundation does not have any language interoperability.
clang::FPOptionsOverride::getAsOpaqueInt
storage_type getAsOpaqueInt() const
Definition: LangOptions.h:861
clang::LangOptions::GPUDefaultStreamKind::Legacy
@ Legacy
Legacy default stream.
clang::LangOptions::SignReturnAddressKeyKind::BKey
@ BKey
Return address signing uses APIB key.
clang::FPOptionsOverride::setDisallowFPContract
void setDisallowFPContract()
Definition: LangOptions.h:842
clang::CompilerInvocation
Helper class for holding the data necessary to invoke the compiler.
Definition: CompilerInvocation.h:193
clang::LangOptions::resetNonModularOptions
void resetNonModularOptions()
Reset all of the options that are not considered when building a module.
Definition: LangOptions.cpp:25
clang::LangOptions::FPE_Ignore
@ FPE_Ignore
Assume that floating-point exceptions are masked.
Definition: LangOptions.h:272
CommentOptions.h
clang::FPOptionsOverride::FPOptionsOverride
FPOptionsOverride(FPOptions FPO, FPOptions::storage_type Mask)
Definition: LangOptions.h:829
clang::LangOptions::trackLocalOwningModule
bool trackLocalOwningModule() const
Do we need to track the owning module for a local declaration?
Definition: LangOptions.h:529
clang::LangOptions::FPE_Strict
@ FPE_Strict
Strictly preserve the floating-point exception semantics.
Definition: LangOptions.h:276
clang::FPOptions::getFromOpaqueInt
static FPOptions getFromOpaqueInt(storage_type Value)
Definition: LangOptions.h:772
clang::LangOptions::MSVC2017_5
@ MSVC2017_5
Definition: LangOptions.h:148
clang::FPOptionsOverride::storage_type
uint64_t storage_type
The type suitable for storing values of FPOptionsOverride.
Definition: LangOptions.h:815
clang::TU_Complete
@ TU_Complete
The translation unit is a complete translation unit.
Definition: LangOptions.h:919
clang::ShaderStage::Compute
@ Compute
clang::ShaderStage::Mesh
@ Mesh
clang::LangOptions::CommentOpts
CommentOptions CommentOpts
Options for parsing comments.
Definition: LangOptions.h:446
clang::LangOptions::FPM_Off
@ FPM_Off
Definition: LangOptions.h:257
clang::LangOptions::remapPathPrefix
void remapPathPrefix(SmallVectorImpl< char > &Path) const
Remap path prefix according to -fmacro-prefix-path option.
Definition: LangOptions.cpp:65
clang::LangOptions::FEM_Extended
@ FEM_Extended
Use extended type for fp arithmetic.
Definition: LangOptions.h:291
clang::LangOptions::ClangABI::Ver14
@ Ver14
Attempt to be ABI-compatible with code generated by Clang 14.0.x.
clang::LangOptions::SignReturnAddressScopeKind::All
@ All
Sign the return address of all functions,.
llvm::SmallVectorImpl< char >
clang::LangOptions::PPTMK_FullGeneralityMultipleInheritance
@ PPTMK_FullGeneralityMultipleInheritance
Definition: LangOptions.h:124
clang::ShaderStage
ShaderStage
Shader programs run in specific pipeline stages.
Definition: LangOptions.h:61
clang::LangOptions::FPE_Default
@ FPE_Default
Used internally to represent initial unspecified value.
Definition: LangOptions.h:278
clang::LangOptions::ClangABI::Ver7
@ Ver7
Attempt to be ABI-compatible with code generated by Clang 7.0.x (SVN r338536).
clang::FPOptions::allowFPContractAcrossStatement
bool allowFPContractAcrossStatement() const
Definition: LangOptions.h:729
clang::FPOptionsOverride::setAllowFPContractWithinStatement
void setAllowFPContractWithinStatement()
Definition: LangOptions.h:834
clang::ShaderStage::Hull
@ Hull
clang::LangOptions::MSVC2019_5
@ MSVC2019_5
Definition: LangOptions.h:151
clang::FPOptions::dump
LLVM_DUMP_METHOD void dump()
Definition: LangOptions.cpp:216
clang::FPOptions::FirstWidth
static constexpr storage_type FirstWidth
Definition: LangOptions.h:668
clang::FPOptions::StorageBitSize
static constexpr unsigned StorageBitSize
Definition: LangOptions.h:664
clang::LangOptions::SOB_Defined
@ SOB_Defined
Definition: LangOptions.h:100
clang::LangOptions::MSVC2013
@ MSVC2013
Definition: LangOptions.h:145
clang::LangOptions::DefaultVisiblityExportMapping
DefaultVisiblityExportMapping
Definition: LangOptions.h:364
clang::ObjCRuntime::isSubscriptPointerArithmetic
bool isSubscriptPointerArithmetic() const
Is subscripting pointer arithmetic?
Definition: ObjCRuntime.h:340
clang::LangOptions::ModuleName
std::string ModuleName
The module currently being compiled as specified by -fmodule-name.
Definition: LangOptions.h:430
clang::LangOptions::FPM_Fast
@ FPM_Fast
Definition: LangOptions.h:263
clang::LangOptions::ClangABI::Ver6
@ Ver6
Attempt to be ABI-compatible with code generated by Clang 6.0.x (SVN r321711).
clang::LangOptions::requiresStrictPrototypes
bool requiresStrictPrototypes() const
Returns true if functions without prototypes or functions with an identifier list (aka K&R C function...
Definition: LangOptions.h:575
clang::ShaderStage::Callable
@ Callable
clang::ShaderStage::Miss
@ Miss
clang::FPOptions::setAllowFPContractAcrossStatement
void setAllowFPContractAcrossStatement()
Definition: LangOptions.h:732
clang::LangOptions::CMK_HeaderUnit
@ CMK_HeaderUnit
Compiling a module header unit.
Definition: LangOptions.h:115
clang::LangOptions::AddrSpaceMapMangling
AddrSpaceMapMangling
Definition: LangOptions.h:139
clang::LangOptions::RoundingMode
llvm::RoundingMode RoundingMode
Definition: LangOptions.h:85
clang::LangOptions::MSVC2017_7
@ MSVC2017_7
Definition: LangOptions.h:149
clang::LangOptions::CoreFoundationABI::Swift4_2
@ Swift4_2
Interoperability with the Swift 4.2 runtime.
clang::LangOptions::MSVC2012
@ MSVC2012
Definition: LangOptions.h:144
clang::FPOptionsOverride::RoundingMode
llvm::RoundingMode RoundingMode
Definition: LangOptions.h:811