Skip to content

Commit 980a6fa

Browse files
committed
More changes to make things better, for a given value of better
1 parent 868f0a9 commit 980a6fa

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

clang/include/clang/Basic/DiagnosticCategories.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace clang {
1313
namespace diag {
14-
enum {
14+
enum DiagCategory {
1515
#define GET_CATEGORY_TABLE
1616
#define CATEGORY(X, ENUM) ENUM,
1717
#include "clang/Basic/DiagnosticGroups.inc"

clang/lib/Basic/DiagnosticIDs.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "llvm/ADT/STLExtras.h"
1919
#include "llvm/ADT/SmallVector.h"
2020
#include "llvm/ADT/StringTable.h"
21+
#include "llvm/Support/Compiler.h"
2122
#include "llvm/Support/ErrorHandling.h"
2223
#include "llvm/Support/Path.h"
2324
#include <map>
@@ -79,6 +80,7 @@ struct StaticDiagInfoRec {
7980
uint16_t Class : 3;
8081
LLVM_PREFERRED_TYPE(DiagnosticIDs::SFINAEResponse)
8182
uint16_t SFINAE : 2;
83+
LLVM_PREFERRED_TYPE(diag::DiagCategory)
8284
uint16_t Category : 6;
8385
LLVM_PREFERRED_TYPE(bool)
8486
uint16_t WarnNoWerror : 1;
@@ -87,7 +89,9 @@ struct StaticDiagInfoRec {
8789
LLVM_PREFERRED_TYPE(bool)
8890
uint16_t WarnShowInSystemMacro : 1;
8991

92+
LLVM_PREFERRED_TYPE(diag::Group)
9093
uint16_t OptionGroupIndex : 15;
94+
9195
LLVM_PREFERRED_TYPE(bool)
9296
uint16_t Deferrable : 1;
9397

llvm/include/llvm/Bitstream/BitCodes.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ namespace llvm {
3232
/// 2. It could be an encoding specification ("this operand encoded like so").
3333
///
3434
class BitCodeAbbrevOp {
35-
uint64_t Val; // A literal value or data for an encoding.
36-
LLVM_PREFERRED_TYPE(bool)
37-
uint64_t IsLiteral : 1; // Indicate whether this is a literal value or not.
38-
uint64_t Enc : 3; // The encoding to use.
3935
public:
4036
enum Encoding {
4137
Fixed = 1, // A fixed width field, Val specifies number of bits.
@@ -45,6 +41,14 @@ class BitCodeAbbrevOp {
4541
Blob = 5 // 32-bit aligned array of 8-bit characters.
4642
};
4743

44+
protected:
45+
uint64_t Val; // A literal value or data for an encoding.
46+
LLVM_PREFERRED_TYPE(bool)
47+
uint64_t IsLiteral : 1; // Indicate whether this is a literal value or not.
48+
LLVM_PREFERRED_TYPE(Encoding)
49+
uint64_t Enc : 3; // The encoding to use.
50+
51+
public:
4852
static bool isValidEncoding(uint64_t E) {
4953
return E >= 1 && E <= 5;
5054
}

llvm/include/llvm/Demangle/ItaniumDemangle.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,18 +165,18 @@ class NodeArray;
165165
// traversed by the printLeft/Right functions to produce a demangled string.
166166
class Node {
167167
public:
168-
enum Kind : unsigned {
168+
enum Kind : uint8_t {
169169
#define NODE(NodeKind) K##NodeKind,
170170
#include "ItaniumNodes.def"
171171
};
172172

173173
/// Three-way bool to track a cached value. Unknown is possible if this node
174174
/// has an unexpanded parameter pack below it that may affect this cache.
175-
enum class Cache : unsigned { Yes, No, Unknown, };
175+
enum class Cache : uint8_t { Yes, No, Unknown, };
176176

177177
/// Operator precedence for expression nodes. Used to determine required
178178
/// parens in expression emission.
179-
enum class Prec : unsigned {
179+
enum class Prec : uint8_t {
180180
Primary,
181181
Postfix,
182182
Unary,
@@ -2996,8 +2996,7 @@ template <typename Derived, typename Alloc> struct AbstractManglingParser {
29962996
};
29972997
char Enc[2]; // Encoding
29982998
OIKind Kind; // Kind of operator
2999-
LLVM_PREFERRED_TYPE(bool)
3000-
unsigned Flag : 1; // Entry-specific flag
2999+
bool Flag : 1; // Entry-specific flag
30013000
Node::Prec Prec : 7; // Precedence
30023001
const char *Name; // Spelling
30033002

0 commit comments

Comments
 (0)