[libcxxabi] Update ItaniumDemangle.h from LLVM#140273
Conversation
76ba29b landed changes in ItaniumDemangle.h on the LLVM side that were not propagated over to the libcxxabi side. This patch fixes that.
|
@llvm/pr-subscribers-libcxxabi Author: Aiden Grossman (boomanaiden154) Changes76ba29b landed changes in ItaniumDemangle.h on the LLVM side that were not propagated over to the libcxxabi side. This patch fixes that. Full diff: https://github.com/llvm/llvm-project/pull/140273.diff 1 Files Affected:
diff --git a/libcxxabi/src/demangle/ItaniumDemangle.h b/libcxxabi/src/demangle/ItaniumDemangle.h
index 6acefeea8484b..4e7f92dd1991a 100644
--- a/libcxxabi/src/demangle/ItaniumDemangle.h
+++ b/libcxxabi/src/demangle/ItaniumDemangle.h
@@ -21,6 +21,7 @@
#include "Utility.h"
#include <algorithm>
#include <cctype>
+#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
@@ -164,18 +165,18 @@ class NodeArray;
// traversed by the printLeft/Right functions to produce a demangled string.
class Node {
public:
- enum Kind : unsigned char {
+ enum Kind : uint8_t {
#define NODE(NodeKind) K##NodeKind,
#include "ItaniumNodes.def"
};
/// Three-way bool to track a cached value. Unknown is possible if this node
/// has an unexpanded parameter pack below it that may affect this cache.
- enum class Cache : unsigned char { Yes, No, Unknown, };
+ enum class Cache : uint8_t { Yes, No, Unknown, };
/// Operator precedence for expression nodes. Used to determine required
/// parens in expression emission.
- enum class Prec {
+ enum class Prec : uint8_t {
Primary,
Postfix,
Unary,
|
You can test this locally with the following command:git-clang-format --diff HEAD~1 HEAD --extensions h -- libcxxabi/src/demangle/ItaniumDemangle.hView the diff from clang-format here.diff --git a/libcxxabi/src/demangle/ItaniumDemangle.h b/libcxxabi/src/demangle/ItaniumDemangle.h
index 4e7f92dd1..cee0dd5d4 100644
--- a/libcxxabi/src/demangle/ItaniumDemangle.h
+++ b/libcxxabi/src/demangle/ItaniumDemangle.h
@@ -172,7 +172,11 @@ public:
/// Three-way bool to track a cached value. Unknown is possible if this node
/// has an unexpanded parameter pack below it that may affect this cache.
- enum class Cache : uint8_t { Yes, No, Unknown, };
+ enum class Cache : uint8_t {
+ Yes,
+ No,
+ Unknown,
+ };
/// Operator precedence for expression nodes. Used to determine required
/// parens in expression emission.
|
|
@boomanaiden154 oh thanks, I didn't realize there was a clone of that file :-/ did you just know to watch for such changes or is there a test suite that catches it? |
You added a dependency on |
|
Oh, but the final version didn't need LLVM_PREFERRED_TYPE so we can remove that dependency (there were some fields that had been converted to unsigned, but in the end I changed the storage types of the enum instead, so we can remove that inclusion - just cleaning up an unneeded dependency on principle |
|
That was fixed in 71d1b4c. Here it's not just cleaning up an unneeded dependency. It's a layering violation to include from |
|
oh good to know :-O |
|
(There's |
@boomanaiden154 was the issue including it in the lib headers? If so I wonder if we can make that trigger a style or bot error in future (if it already was reported I must have missed it because the format bot was already complaining about existing style so I didn't read the entire output :-/ ) |
Not sure what you mean here by lib headers. The issue was that Layering violations in general are somewhat difficult to catch automatically. |
Sorry, the problem is that from my pov ItaniumMangle was in llvm, so I'm trying to understand what the rules for limiting its inclusion of llvm headers. By lib headers, I meant ItaniumMangle is in the Is that correct? |
It's the same across libcxxabi and LLVM (or at least should be), so cannot depend on stuff within LLVM.
You should be fine including things in |
Ah, I hadn't missed a general rule, there are just some cases where files are copied, thanks :D |
76ba29b landed changes in ItaniumDemangle.h on the LLVM side that were not propagated over to the libcxxabi side. This patch fixes that.