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 
17 #include "clang/Basic/CommentOptions.h"
18 #include "clang/Basic/LLVM.h"
19 #include "clang/Basic/ObjCRuntime.h"
20 #include "clang/Basic/Sanitizers.h"
21 #include "clang/Basic/Visibility.h"
22 #include "llvm/ADT/FloatingPointMode.h"
23 #include "llvm/ADT/StringRef.h"
24 #include "llvm/ADT/Triple.h"
25 #include <string>
26 #include <vector>
27 
28 namespace clang {
29 
30 /// Bitfields of LangOptions, split out from LangOptions in order to ensure that
31 /// this large collection of bitfields is a trivial class type.
32 class LangOptionsBase {
33 public:
34   // Define simple language options (with no accessors).
35 #define LANGOPT(Name, Bits, Default, Description) unsigned Name : Bits;
36 #define ENUM_LANGOPT(Name, Type, Bits, Default, Description)
37 #include "clang/Basic/LangOptions.def"
38 
39 protected:
40   // Define language options of enumeration type. These are private, and will
41   // have accessors (below).
42 #define LANGOPT(Name, Bits, Default, Description)
43 #define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
44   unsigned Name : Bits;
45 #include "clang/Basic/LangOptions.def"
46 };
47 
48 /// In the Microsoft ABI, this controls the placement of virtual displacement
49 /// members used to implement virtual inheritance.
50 enum class MSVtorDispMode { Never, ForVBaseOverride, ForVFTable };
51 
52 /// Keeps track of the various options that can be
53 /// enabled, which controls the dialect of C or C++ that is accepted.
54 class LangOptions : public LangOptionsBase {
55 public:
56   using Visibility = clang::Visibility;
57   using RoundingMode = llvm::RoundingMode;
58 
59   enum GCMode { NonGC, GCOnly, HybridGC };
60   enum StackProtectorMode { SSPOff, SSPOn, SSPStrong, SSPReq };
61 
62   // Automatic variables live on the stack, and when trivial they're usually
63   // uninitialized because it's undefined behavior to use them without
64   // initializing them.
65   enum class TrivialAutoVarInitKind { Uninitialized, Zero, Pattern };
66 
67   enum SignedOverflowBehaviorTy {
68     // Default C standard behavior.
69     SOB_Undefined,
70 
71     // -fwrapv
72     SOB_Defined,
73 
74     // -ftrapv
75     SOB_Trapping
76   };
77 
78   // FIXME: Unify with TUKind.
79   enum CompilingModuleKind {
80     /// Not compiling a module interface at all.
81     CMK_None,
82 
83     /// Compiling a module from a module map.
84     CMK_ModuleMap,
85 
86     /// Compiling a module from a list of header files.
87     CMK_HeaderModule,
88 
89     /// Compiling a C++ modules TS module interface unit.
90     CMK_ModuleInterface,
91   };
92 
93   enum PragmaMSPointersToMembersKind {
94     PPTMK_BestCase,
95     PPTMK_FullGeneralitySingleInheritance,
96     PPTMK_FullGeneralityMultipleInheritance,
97     PPTMK_FullGeneralityVirtualInheritance
98   };
99 
100   using MSVtorDispMode = clang::MSVtorDispMode;
101 
102   enum DefaultCallingConvention {
103     DCC_None,
104     DCC_CDecl,
105     DCC_FastCall,
106     DCC_StdCall,
107     DCC_VectorCall,
108     DCC_RegCall
109   };
110 
111   enum AddrSpaceMapMangling { ASMM_Target, ASMM_On, ASMM_Off };
112 
113   // Corresponds to _MSC_VER
114   enum MSVCMajorVersion {
115     MSVC2010 = 1600,
116     MSVC2012 = 1700,
117     MSVC2013 = 1800,
118     MSVC2015 = 1900,
119     MSVC2017 = 1910,
120     MSVC2017_5 = 1912,
121     MSVC2017_7 = 1914,
122     MSVC2019 = 1920,
123   };
124 
125   /// Clang versions with different platform ABI conformance.
126   enum class ClangABI {
127     /// Attempt to be ABI-compatible with code generated by Clang 3.8.x
128     /// (SVN r257626). This causes <1 x long long> to be passed in an
129     /// integer register instead of an SSE register on x64_64.
130     Ver3_8,
131 
132     /// Attempt to be ABI-compatible with code generated by Clang 4.0.x
133     /// (SVN r291814). This causes move operations to be ignored when
134     /// determining whether a class type can be passed or returned directly.
135     Ver4,
136 
137     /// Attempt to be ABI-compatible with code generated by Clang 6.0.x
138     /// (SVN r321711). This causes determination of whether a type is
139     /// standard-layout to ignore collisions between empty base classes
140     /// and between base classes and member subobjects, which affects
141     /// whether we reuse base class tail padding in some ABIs.
142     Ver6,
143 
144     /// Attempt to be ABI-compatible with code generated by Clang 7.0.x
145     /// (SVN r338536). This causes alignof (C++) and _Alignof (C11) to be
146     /// compatible with __alignof (i.e., return the preferred alignment)
147     /// rather than returning the required alignment.
148     Ver7,
149 
150     /// Attempt to be ABI-compatible with code generated by Clang 9.0.x
151     /// (SVN r351319). This causes vectors of __int128 to be passed in memory
152     /// instead of passing in multiple scalar registers on x86_64 on Linux and
153     /// NetBSD.
154     Ver9,
155 
156     /// Attempt to be ABI-compatible with code generated by Clang 11.0.x
157     /// (git  2e10b7a39b93). This causes clang to pass unions with a 256-bit
158     /// vector member on the stack instead of using registers, and to not
159     /// properly mangle substitutions for template names in some cases.
160     Ver11,
161 
162     /// Conform to the underlying platform's C and C++ ABIs as closely
163     /// as we can.
164     Latest
165   };
166 
167   enum class CoreFoundationABI {
168     /// No interoperability ABI has been specified
169     Unspecified,
170     /// CoreFoundation does not have any language interoperability
171     Standalone,
172     /// Interoperability with the ObjectiveC runtime
173     ObjectiveC,
174     /// Interoperability with the latest known version of the Swift runtime
175     Swift,
176     /// Interoperability with the Swift 5.0 runtime
177     Swift5_0,
178     /// Interoperability with the Swift 4.2 runtime
179     Swift4_2,
180     /// Interoperability with the Swift 4.1 runtime
181     Swift4_1,
182   };
183 
184   enum FPModeKind {
185     // Disable the floating point pragma
186     FPM_Off,
187 
188     // Enable the floating point pragma
189     FPM_On,
190 
191     // Aggressively fuse FP ops (E.g. FMA) disregarding pragmas.
192     FPM_Fast,
193 
194     // Aggressively fuse FP ops and honor pragmas.
195     FPM_FastHonorPragmas
196   };
197 
198   /// Alias for RoundingMode::NearestTiesToEven.
199   static constexpr unsigned FPR_ToNearest =
200       static_cast<unsigned>(llvm::RoundingMode::NearestTiesToEven);
201 
202   /// Possible floating point exception behavior.
203   enum FPExceptionModeKind {
204     /// Assume that floating-point exceptions are masked.
205     FPE_Ignore,
206     /// Transformations do not cause new exceptions but may hide some.
207     FPE_MayTrap,
208     /// Strictly preserve the floating-point exception semantics.
209     FPE_Strict
210   };
211 
212   enum class LaxVectorConversionKind {
213     /// Permit no implicit vector bitcasts.
214     None,
215     /// Permit vector bitcasts between integer vectors with different numbers
216     /// of elements but the same total bit-width.
217     Integer,
218     /// Permit vector bitcasts between all vectors with the same total
219     /// bit-width.
220     All,
221   };
222 
223   enum class SignReturnAddressScopeKind {
224     /// No signing for any function.
225     None,
226     /// Sign the return address of functions that spill LR.
227     NonLeaf,
228     /// Sign the return address of all functions,
229     All
230   };
231 
232   enum class SignReturnAddressKeyKind {
233     /// Return address signing uses APIA key.
234     AKey,
235     /// Return address signing uses APIB key.
236     BKey
237   };
238 
239   enum class ThreadModelKind {
240     /// POSIX Threads.
241     POSIX,
242     /// Single Threaded Environment.
243     Single
244   };
245 
246 public:
247   /// Set of enabled sanitizers.
248   SanitizerSet Sanitize;
249 
250   /// Paths to blacklist files specifying which objects
251   /// (files, functions, variables) should not be instrumented.
252   std::vector<std::string> SanitizerBlacklistFiles;
253 
254   /// Paths to the XRay "always instrument" files specifying which
255   /// objects (files, functions, variables) should be imbued with the XRay
256   /// "always instrument" attribute.
257   /// WARNING: This is a deprecated field and will go away in the future.
258   std::vector<std::string> XRayAlwaysInstrumentFiles;
259 
260   /// Paths to the XRay "never instrument" files specifying which
261   /// objects (files, functions, variables) should be imbued with the XRay
262   /// "never instrument" attribute.
263   /// WARNING: This is a deprecated field and will go away in the future.
264   std::vector<std::string> XRayNeverInstrumentFiles;
265 
266   /// Paths to the XRay attribute list files, specifying which objects
267   /// (files, functions, variables) should be imbued with the appropriate XRay
268   /// attribute(s).
269   std::vector<std::string> XRayAttrListFiles;
270 
271   clang::ObjCRuntime ObjCRuntime;
272 
273   CoreFoundationABI CFRuntime = CoreFoundationABI::Unspecified;
274 
275   std::string ObjCConstantStringClass;
276 
277   /// The name of the handler function to be called when -ftrapv is
278   /// specified.
279   ///
280   /// If none is specified, abort (GCC-compatible behaviour).
281   std::string OverflowHandler;
282 
283   /// The module currently being compiled as specified by -fmodule-name.
284   std::string ModuleName;
285 
286   /// The name of the current module, of which the main source file
287   /// is a part. If CompilingModule is set, we are compiling the interface
288   /// of this module, otherwise we are compiling an implementation file of
289   /// it. This starts as ModuleName in case -fmodule-name is provided and
290   /// changes during compilation to reflect the current module.
291   std::string CurrentModule;
292 
293   /// The names of any features to enable in module 'requires' decls
294   /// in addition to the hard-coded list in Module.cpp and the target features.
295   ///
296   /// This list is sorted.
297   std::vector<std::string> ModuleFeatures;
298 
299   /// Options for parsing comments.
300   CommentOptions CommentOpts;
301 
302   /// A list of all -fno-builtin-* function names (e.g., memset).
303   std::vector<std::string> NoBuiltinFuncs;
304 
305   /// Triples of the OpenMP targets that the host code codegen should
306   /// take into account in order to generate accurate offloading descriptors.
307   std::vector<llvm::Triple> OMPTargetTriples;
308 
309   /// Name of the IR file that contains the result of the OpenMP target
310   /// host code generation.
311   std::string OMPHostIRFile;
312 
313   /// Indicates whether the front-end is explicitly told that the
314   /// input is a header file (i.e. -x c-header).
315   bool IsHeaderFile = false;
316 
317   LangOptions();
318 
319   // Define accessors/mutators for language options of enumeration type.
320 #define LANGOPT(Name, Bits, Default, Description)
321 #define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
322   Type get##Name() const { return static_cast<Type>(Name); } \
323   void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
324 #include "clang/Basic/LangOptions.def"
325 
326   /// Are we compiling a module interface (.cppm or module map)?
isCompilingModule()327   bool isCompilingModule() const {
328     return getCompilingModule() != CMK_None;
329   }
330 
331   /// Do we need to track the owning module for a local declaration?
trackLocalOwningModule()332   bool trackLocalOwningModule() const {
333     return isCompilingModule() || ModulesLocalVisibility;
334   }
335 
isSignedOverflowDefined()336   bool isSignedOverflowDefined() const {
337     return getSignedOverflowBehavior() == SOB_Defined;
338   }
339 
isSubscriptPointerArithmetic()340   bool isSubscriptPointerArithmetic() const {
341     return ObjCRuntime.isSubscriptPointerArithmetic() &&
342            !ObjCSubscriptingLegacyRuntime;
343   }
344 
isCompatibleWithMSVC(MSVCMajorVersion MajorVersion)345   bool isCompatibleWithMSVC(MSVCMajorVersion MajorVersion) const {
346     return MSCompatibilityVersion >= MajorVersion * 100000U;
347   }
348 
349   /// Reset all of the options that are not considered when building a
350   /// module.
351   void resetNonModularOptions();
352 
353   /// Is this a libc/libm function that is no longer recognized as a
354   /// builtin because a -fno-builtin-* option has been specified?
355   bool isNoBuiltinFunc(StringRef Name) const;
356 
357   /// True if any ObjC types may have non-trivial lifetime qualifiers.
allowsNonTrivialObjCLifetimeQualifiers()358   bool allowsNonTrivialObjCLifetimeQualifiers() const {
359     return ObjCAutoRefCount || ObjCWeak;
360   }
361 
assumeFunctionsAreConvergent()362   bool assumeFunctionsAreConvergent() const {
363     return ConvergentFunctions;
364   }
365 
366   /// Return the OpenCL C or C++ version as a VersionTuple.
367   VersionTuple getOpenCLVersionTuple() const;
368 
369   /// Check if return address signing is enabled.
hasSignReturnAddress()370   bool hasSignReturnAddress() const {
371     return getSignReturnAddressScope() != SignReturnAddressScopeKind::None;
372   }
373 
374   /// Check if return address signing uses AKey.
isSignReturnAddressWithAKey()375   bool isSignReturnAddressWithAKey() const {
376     return getSignReturnAddressKey() == SignReturnAddressKeyKind::AKey;
377   }
378 
379   /// Check if leaf functions are also signed.
isSignReturnAddressScopeAll()380   bool isSignReturnAddressScopeAll() const {
381     return getSignReturnAddressScope() == SignReturnAddressScopeKind::All;
382   }
383 };
384 
385 /// Floating point control options
386 class FPOptionsOverride;
387 class FPOptions {
388 public:
389   // We start by defining the layout.
390   using storage_type = uint16_t;
391 
392   using RoundingMode = llvm::RoundingMode;
393 
394   static constexpr unsigned StorageBitSize = 8 * sizeof(storage_type);
395 
396   // Define a fake option named "First" so that we have a PREVIOUS even for the
397   // real first option.
398   static constexpr storage_type FirstShift = 0, FirstWidth = 0;
399 #define OPTION(NAME, TYPE, WIDTH, PREVIOUS)                                    \
400   static constexpr storage_type NAME##Shift =                                  \
401       PREVIOUS##Shift + PREVIOUS##Width;                                       \
402   static constexpr storage_type NAME##Width = WIDTH;                           \
403   static constexpr storage_type NAME##Mask = ((1 << NAME##Width) - 1)          \
404                                              << NAME##Shift;
405 #include "clang/Basic/FPOptions.def"
406 
407   static constexpr storage_type TotalWidth = 0
408 #define OPTION(NAME, TYPE, WIDTH, PREVIOUS) +WIDTH
409 #include "clang/Basic/FPOptions.def"
410       ;
411   static_assert(TotalWidth <= StorageBitSize, "Too short type for FPOptions");
412 
413 private:
414   storage_type Value;
415 
416 public:
FPOptions()417   FPOptions() : Value(0) {
418     setFPContractMode(LangOptions::FPM_Off);
419     setRoundingMode(static_cast<RoundingMode>(LangOptions::FPR_ToNearest));
420     setFPExceptionMode(LangOptions::FPE_Ignore);
421   }
FPOptions(const LangOptions & LO)422   explicit FPOptions(const LangOptions &LO) {
423     Value = 0;
424     // The language fp contract option FPM_FastHonorPragmas has the same effect
425     // as FPM_Fast in frontend. For simplicity, use FPM_Fast uniformly in
426     // frontend.
427     auto LangOptContractMode = LO.getDefaultFPContractMode();
428     if (LangOptContractMode == LangOptions::FPM_FastHonorPragmas)
429       LangOptContractMode = LangOptions::FPM_Fast;
430     setFPContractMode(LangOptContractMode);
431     setRoundingMode(LO.getFPRoundingMode());
432     setFPExceptionMode(LO.getFPExceptionMode());
433     setAllowFPReassociate(LO.AllowFPReassoc);
434     setNoHonorNaNs(LO.NoHonorNaNs);
435     setNoHonorInfs(LO.NoHonorInfs);
436     setNoSignedZero(LO.NoSignedZero);
437     setAllowReciprocal(LO.AllowRecip);
438     setAllowApproxFunc(LO.ApproxFunc);
439     if (getFPContractMode() == LangOptions::FPM_On &&
440         getRoundingMode() == llvm::RoundingMode::Dynamic &&
441         getFPExceptionMode() == LangOptions::FPE_Strict)
442       // If the FP settings are set to the "strict" model, then
443       // FENV access is set to true. (ffp-model=strict)
444       setAllowFEnvAccess(true);
445     else
446       setAllowFEnvAccess(LangOptions::FPM_Off);
447   }
448 
allowFPContractWithinStatement()449   bool allowFPContractWithinStatement() const {
450     return getFPContractMode() == LangOptions::FPM_On;
451   }
setAllowFPContractWithinStatement()452   void setAllowFPContractWithinStatement() {
453     setFPContractMode(LangOptions::FPM_On);
454   }
455 
allowFPContractAcrossStatement()456   bool allowFPContractAcrossStatement() const {
457     return getFPContractMode() == LangOptions::FPM_Fast;
458   }
setAllowFPContractAcrossStatement()459   void setAllowFPContractAcrossStatement() {
460     setFPContractMode(LangOptions::FPM_Fast);
461   }
462 
isFPConstrained()463   bool isFPConstrained() const {
464     return getRoundingMode() != llvm::RoundingMode::NearestTiesToEven ||
465            getFPExceptionMode() != LangOptions::FPE_Ignore ||
466            getAllowFEnvAccess();
467   }
468 
469   bool operator==(FPOptions other) const { return Value == other.Value; }
470 
471   /// Return the default value of FPOptions that's used when trailing
472   /// storage isn't required.
473   static FPOptions defaultWithoutTrailingStorage(const LangOptions &LO);
474 
getAsOpaqueInt()475   storage_type getAsOpaqueInt() const { return Value; }
getFromOpaqueInt(storage_type Value)476   static FPOptions getFromOpaqueInt(storage_type Value) {
477     FPOptions Opts;
478     Opts.Value = Value;
479     return Opts;
480   }
481 
482   // We can define most of the accessors automatically:
483 #define OPTION(NAME, TYPE, WIDTH, PREVIOUS)                                    \
484   TYPE get##NAME() const {                                                     \
485     return static_cast<TYPE>((Value & NAME##Mask) >> NAME##Shift);             \
486   }                                                                            \
487   void set##NAME(TYPE value) {                                                 \
488     Value = (Value & ~NAME##Mask) | (storage_type(value) << NAME##Shift);      \
489   }
490 #include "clang/Basic/FPOptions.def"
491   LLVM_DUMP_METHOD void dump();
492 };
493 
494 /// Represents difference between two FPOptions values.
495 ///
496 /// The effect of language constructs changing the set of floating point options
497 /// is usually a change of some FP properties while leaving others intact. This
498 /// class describes such changes by keeping information about what FP options
499 /// are overridden.
500 ///
501 /// The integral set of FP options, described by the class FPOptions, may be
502 /// represented as a default FP option set, defined by language standard and
503 /// command line options, with the overrides introduced by pragmas.
504 ///
505 /// The is implemented as a value of the new FPOptions plus a mask showing which
506 /// fields are actually set in it.
507 class FPOptionsOverride {
508   FPOptions Options = FPOptions::getFromOpaqueInt(0);
509   FPOptions::storage_type OverrideMask = 0;
510 
511 public:
512   using RoundingMode = llvm::RoundingMode;
513 
514   /// The type suitable for storing values of FPOptionsOverride. Must be twice
515   /// as wide as bit size of FPOption.
516   using storage_type = uint32_t;
517   static_assert(sizeof(storage_type) >= 2 * sizeof(FPOptions::storage_type),
518                 "Too short type for FPOptionsOverride");
519 
520   /// Bit mask selecting bits of OverrideMask in serialized representation of
521   /// FPOptionsOverride.
522   static constexpr storage_type OverrideMaskBits =
523       (static_cast<storage_type>(1) << FPOptions::StorageBitSize) - 1;
524 
FPOptionsOverride()525   FPOptionsOverride() {}
FPOptionsOverride(const LangOptions & LO)526   FPOptionsOverride(const LangOptions &LO)
527       : Options(LO), OverrideMask(OverrideMaskBits) {}
FPOptionsOverride(FPOptions FPO)528   FPOptionsOverride(FPOptions FPO)
529       : Options(FPO), OverrideMask(OverrideMaskBits) {}
530 
requiresTrailingStorage()531   bool requiresTrailingStorage() const { return OverrideMask != 0; }
532 
setAllowFPContractWithinStatement()533   void setAllowFPContractWithinStatement() {
534     setFPContractModeOverride(LangOptions::FPM_On);
535   }
536 
setAllowFPContractAcrossStatement()537   void setAllowFPContractAcrossStatement() {
538     setFPContractModeOverride(LangOptions::FPM_Fast);
539   }
540 
setDisallowFPContract()541   void setDisallowFPContract() {
542     setFPContractModeOverride(LangOptions::FPM_Off);
543   }
544 
setFPPreciseEnabled(bool Value)545   void setFPPreciseEnabled(bool Value) {
546     setAllowFPReassociateOverride(!Value);
547     setNoHonorNaNsOverride(!Value);
548     setNoHonorInfsOverride(!Value);
549     setNoSignedZeroOverride(!Value);
550     setAllowReciprocalOverride(!Value);
551     setAllowApproxFuncOverride(!Value);
552     if (Value)
553       /* Precise mode implies fp_contract=on and disables ffast-math */
554       setAllowFPContractWithinStatement();
555     else
556       /* Precise mode disabled sets fp_contract=fast and enables ffast-math */
557       setAllowFPContractAcrossStatement();
558   }
559 
getAsOpaqueInt()560   storage_type getAsOpaqueInt() const {
561     return (static_cast<storage_type>(Options.getAsOpaqueInt())
562             << FPOptions::StorageBitSize) |
563            OverrideMask;
564   }
getFromOpaqueInt(storage_type I)565   static FPOptionsOverride getFromOpaqueInt(storage_type I) {
566     FPOptionsOverride Opts;
567     Opts.OverrideMask = I & OverrideMaskBits;
568     Opts.Options = FPOptions::getFromOpaqueInt(I >> FPOptions::StorageBitSize);
569     return Opts;
570   }
571 
applyOverrides(FPOptions Base)572   FPOptions applyOverrides(FPOptions Base) {
573     FPOptions Result =
574         FPOptions::getFromOpaqueInt((Base.getAsOpaqueInt() & ~OverrideMask) |
575                                      (Options.getAsOpaqueInt() & OverrideMask));
576     return Result;
577   }
578 
applyOverrides(const LangOptions & LO)579   FPOptions applyOverrides(const LangOptions &LO) {
580     return applyOverrides(FPOptions(LO));
581   }
582 
583   bool operator==(FPOptionsOverride other) const {
584     return Options == other.Options && OverrideMask == other.OverrideMask;
585   }
586   bool operator!=(FPOptionsOverride other) const { return !(*this == other); }
587 
588 #define OPTION(NAME, TYPE, WIDTH, PREVIOUS)                                    \
589   bool has##NAME##Override() const {                                           \
590     return OverrideMask & FPOptions::NAME##Mask;                               \
591   }                                                                            \
592   TYPE get##NAME##Override() const {                                           \
593     assert(has##NAME##Override());                                             \
594     return Options.get##NAME();                                                \
595   }                                                                            \
596   void clear##NAME##Override() {                                               \
597     /* Clear the actual value so that we don't have spurious differences when  \
598      * testing equality. */                                                    \
599     Options.set##NAME(TYPE(0));                                                \
600     OverrideMask &= ~FPOptions::NAME##Mask;                                    \
601   }                                                                            \
602   void set##NAME##Override(TYPE value) {                                       \
603     Options.set##NAME(value);                                                  \
604     OverrideMask |= FPOptions::NAME##Mask;                                     \
605   }
606 #include "clang/Basic/FPOptions.def"
607   LLVM_DUMP_METHOD void dump();
608 };
609 
610 /// Describes the kind of translation unit being processed.
611 enum TranslationUnitKind {
612   /// The translation unit is a complete translation unit.
613   TU_Complete,
614 
615   /// The translation unit is a prefix to a translation unit, and is
616   /// not complete.
617   TU_Prefix,
618 
619   /// The translation unit is a module.
620   TU_Module
621 };
622 
623 } // namespace clang
624 
625 #endif // LLVM_CLANG_BASIC_LANGOPTIONS_H
626