diff --git a/clang/include/clang/Basic/LangOptions.h b/clang/include/clang/Basic/LangOptions.h index c1cc5548ef10c..862952d336ef3 100644 --- a/clang/include/clang/Basic/LangOptions.h +++ b/clang/include/clang/Basic/LangOptions.h @@ -30,27 +30,6 @@ namespace clang { -/// Bitfields of LangOptions, split out from LangOptions in order to ensure that -/// this large collection of bitfields is a trivial class type. -class LangOptionsBase { - friend class CompilerInvocation; - friend class CompilerInvocationBase; - -public: - // Define simple language options (with no accessors). -#define LANGOPT(Name, Bits, Default, Description) unsigned Name : Bits; -#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) -#include "clang/Basic/LangOptions.def" - -protected: - // Define language options of enumeration type. These are private, and will - // have accessors (below). -#define LANGOPT(Name, Bits, Default, Description) -#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \ - unsigned Name : Bits; -#include "clang/Basic/LangOptions.def" -}; - /// In the Microsoft ABI, this controls the placement of virtual displacement /// members used to implement virtual inheritance. enum class MSVtorDispMode { Never, ForVBaseOverride, ForVFTable }; @@ -78,9 +57,12 @@ enum class ShaderStage { Invalid, }; -/// Keeps track of the various options that can be -/// enabled, which controls the dialect of C or C++ that is accepted. -class LangOptions : public LangOptionsBase { +/// Bitfields of LangOptions, split out from LangOptions in order to ensure that +/// this large collection of bitfields is a trivial class type. +class LangOptionsBase { + friend class CompilerInvocation; + friend class CompilerInvocationBase; + public: using Visibility = clang::Visibility; using RoundingMode = llvm::RoundingMode; @@ -416,6 +398,24 @@ class LangOptions : public LangOptionsBase { enum ComplexRangeKind { CX_Full, CX_Limited, CX_Fortran, CX_None }; + // Define simple language options (with no accessors). +#define LANGOPT(Name, Bits, Default, Description) unsigned Name : Bits; +#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) +#include "clang/Basic/LangOptions.def" + +protected: + // Define language options of enumeration type. These are private, and will + // have accessors (below). +#define LANGOPT(Name, Bits, Default, Description) +#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \ + LLVM_PREFERRED_TYPE(Type) \ + unsigned Name : Bits; +#include "clang/Basic/LangOptions.def" +}; + +/// Keeps track of the various options that can be +/// enabled, which controls the dialect of C or C++ that is accepted. +class LangOptions : public LangOptionsBase { public: /// The used language standard. LangStandard::Kind LangStd;