diff options
Diffstat (limited to 'include/clang/Basic/LangOptions.h')
-rw-r--r-- | include/clang/Basic/LangOptions.h | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/include/clang/Basic/LangOptions.h b/include/clang/Basic/LangOptions.h index 688047f..ce4ff06 100644 --- a/include/clang/Basic/LangOptions.h +++ b/include/clang/Basic/LangOptions.h @@ -15,13 +15,33 @@ #define LLVM_CLANG_LANGOPTIONS_H #include <string> +#include "clang/Basic/LLVM.h" #include "clang/Basic/Visibility.h" +#include "llvm/ADT/IntrusiveRefCntPtr.h" 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 { +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" +}; + /// LangOptions - This class keeps track of the various options that can be /// enabled, which controls the dialect of C that is accepted. -class LangOptions { +class LangOptions : public RefCountedBase<LangOptions>, public LangOptionsBase { public: typedef clang::Visibility Visibility; @@ -34,19 +54,6 @@ public: SOB_Trapping // -ftrapv }; - // 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" - -private: - // 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" - public: std::string ObjCConstantStringClass; @@ -54,6 +61,9 @@ public: /// If none is specified, abort (GCC-compatible behaviour). std::string OverflowHandler; + /// \brief The name of the current module. + std::string CurrentModule; + LangOptions(); // Define accessors/mutators for language options of enumeration type. |