-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[Clang][NFC] Remove duplicated specialization of llvm::DenseMapInfo<llvm::FoldingSetNodeID>
#159718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-clang Author: Corentin Jabot (cor3ntin) ChangesIn preparation of #141776 Full diff: https://github.com/llvm/llvm-project/pull/159718.diff 3 Files Affected:
diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h
index b8f6de69bbb98..1bb9de70008b7 100644
--- a/clang/include/clang/AST/ASTContext.h
+++ b/clang/include/clang/AST/ASTContext.h
@@ -3843,4 +3843,25 @@ typename clang::LazyGenerationalUpdatePtr<Owner, T, Update>::ValueType
return Value;
}
+template <> struct llvm::DenseMapInfo<llvm::FoldingSetNodeID> {
+ static FoldingSetNodeID getEmptyKey() { return FoldingSetNodeID{}; }
+
+ static FoldingSetNodeID getTombstoneKey() {
+ FoldingSetNodeID ID;
+ for (size_t i = 0; i < sizeof(ID) / sizeof(unsigned); ++i) {
+ ID.AddInteger(std::numeric_limits<unsigned>::max());
+ }
+ return ID;
+ }
+
+ static unsigned getHashValue(const FoldingSetNodeID &Val) {
+ return Val.ComputeHash();
+ }
+
+ static bool isEqual(const FoldingSetNodeID &LHS,
+ const FoldingSetNodeID &RHS) {
+ return LHS == RHS;
+ }
+};
+
#endif // LLVM_CLANG_AST_ASTCONTEXT_H
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 5240054c2f36b..e49ff9080571e 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -114,27 +114,6 @@ enum FloatingRank {
Ibm128Rank
};
-template <> struct llvm::DenseMapInfo<llvm::FoldingSetNodeID> {
- static FoldingSetNodeID getEmptyKey() { return FoldingSetNodeID{}; }
-
- static FoldingSetNodeID getTombstoneKey() {
- FoldingSetNodeID id;
- for (size_t i = 0; i < sizeof(id) / sizeof(unsigned); ++i) {
- id.AddInteger(std::numeric_limits<unsigned>::max());
- }
- return id;
- }
-
- static unsigned getHashValue(const FoldingSetNodeID &Val) {
- return Val.ComputeHash();
- }
-
- static bool isEqual(const FoldingSetNodeID &LHS,
- const FoldingSetNodeID &RHS) {
- return LHS == RHS;
- }
-};
-
/// \returns The locations that are relevant when searching for Doc comments
/// related to \p D.
static SmallVector<SourceLocation, 2>
diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp
index f114173a42c21..d238b7916a330 100644
--- a/clang/lib/Sema/SemaConcept.cpp
+++ b/clang/lib/Sema/SemaConcept.cpp
@@ -1864,33 +1864,6 @@ NormalizedConstraint::getFoldExpandedConstraint() const {
// ------------------------ Subsumption -----------------------------------
//
//
-
-template <> struct llvm::DenseMapInfo<llvm::FoldingSetNodeID> {
-
- static FoldingSetNodeID getEmptyKey() {
- FoldingSetNodeID ID;
- ID.AddInteger(std::numeric_limits<unsigned>::max());
- return ID;
- }
-
- static FoldingSetNodeID getTombstoneKey() {
- FoldingSetNodeID ID;
- for (unsigned I = 0; I < sizeof(ID) / sizeof(unsigned); ++I) {
- ID.AddInteger(std::numeric_limits<unsigned>::max());
- }
- return ID;
- }
-
- static unsigned getHashValue(const FoldingSetNodeID &Val) {
- return Val.ComputeHash();
- }
-
- static bool isEqual(const FoldingSetNodeID &LHS,
- const FoldingSetNodeID &RHS) {
- return LHS == RHS;
- }
-};
-
SubsumptionChecker::SubsumptionChecker(Sema &SemaRef,
SubsumptionCallable Callable)
: SemaRef(SemaRef), Callable(Callable), NextID(1) {}
|
clang/include/clang/AST/ASTContext.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (size_t i = 0; i < sizeof(ID) / sizeof(unsigned); ++i) { | |
for (size_t I = 0; I != sizeof(ID) / sizeof(unsigned); ++I) { |
…llvm::FoldingSetNodeID>` In preparation of llvm#141776
de3b12c
to
13e53f8
Compare
FoldingSetNodeID ID; | ||
for (size_t I = 0; I < sizeof(ID) / sizeof(unsigned); ++I) { | ||
ID.AddInteger(std::numeric_limits<unsigned>::max()); | ||
} | ||
return ID; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was about to say ID can probably be static (constexpr if possible?)...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/27/builds/16285 Here is the relevant piece of the build log for the reference
|
In preparation of #141776