Skip to content

Commit bf57105

Browse files
committed
[clang][NFC] Annotate LangOptions.h with preferred_type
This helps debuggers to display values in bit-fields in a more helpful way.
1 parent 1ed3760 commit bf57105

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

clang/include/clang/Basic/LangOptions.h

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,6 @@
3030

3131
namespace clang {
3232

33-
/// Bitfields of LangOptions, split out from LangOptions in order to ensure that
34-
/// this large collection of bitfields is a trivial class type.
35-
class LangOptionsBase {
36-
friend class CompilerInvocation;
37-
friend class CompilerInvocationBase;
38-
39-
public:
40-
// Define simple language options (with no accessors).
41-
#define LANGOPT(Name, Bits, Default, Description) unsigned Name : Bits;
42-
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description)
43-
#include "clang/Basic/LangOptions.def"
44-
45-
protected:
46-
// Define language options of enumeration type. These are private, and will
47-
// have accessors (below).
48-
#define LANGOPT(Name, Bits, Default, Description)
49-
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
50-
unsigned Name : Bits;
51-
#include "clang/Basic/LangOptions.def"
52-
};
53-
5433
/// In the Microsoft ABI, this controls the placement of virtual displacement
5534
/// members used to implement virtual inheritance.
5635
enum class MSVtorDispMode { Never, ForVBaseOverride, ForVFTable };
@@ -78,9 +57,12 @@ enum class ShaderStage {
7857
Invalid,
7958
};
8059

81-
/// Keeps track of the various options that can be
82-
/// enabled, which controls the dialect of C or C++ that is accepted.
83-
class LangOptions : public LangOptionsBase {
60+
/// Bitfields of LangOptions, split out from LangOptions in order to ensure that
61+
/// this large collection of bitfields is a trivial class type.
62+
class LangOptionsBase {
63+
friend class CompilerInvocation;
64+
friend class CompilerInvocationBase;
65+
8466
public:
8567
using Visibility = clang::Visibility;
8668
using RoundingMode = llvm::RoundingMode;
@@ -416,6 +398,24 @@ class LangOptions : public LangOptionsBase {
416398

417399
enum ComplexRangeKind { CX_Full, CX_Limited, CX_Fortran, CX_None };
418400

401+
// Define simple language options (with no accessors).
402+
#define LANGOPT(Name, Bits, Default, Description) unsigned Name : Bits;
403+
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description)
404+
#include "clang/Basic/LangOptions.def"
405+
406+
protected:
407+
// Define language options of enumeration type. These are private, and will
408+
// have accessors (below).
409+
#define LANGOPT(Name, Bits, Default, Description)
410+
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
411+
LLVM_PREFERRED_TYPE(Type) \
412+
unsigned Name : Bits;
413+
#include "clang/Basic/LangOptions.def"
414+
};
415+
416+
/// Keeps track of the various options that can be
417+
/// enabled, which controls the dialect of C or C++ that is accepted.
418+
class LangOptions : public LangOptionsBase {
419419
public:
420420
/// The used language standard.
421421
LangStandard::Kind LangStd;

0 commit comments

Comments
 (0)