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