llvmorg-github-actions[bot] wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clangd

Author: Fangrui Song (MaskRay)

<details>
<summary>Changes</summary>

#<!-- -->200595 changed DenseMap to no longer create tombstone buckets, so
DenseMapInfo&lt;T&gt;::getTombstoneKey() is never called. Remove dead
definitions and dead tombstone branches.


---

Patch is 48.62 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/200634.diff


52 Files Affected:

- (modified) 
clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.h 
(-8) 
- (modified) clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp (-8) 
- (modified) clang-tools-extra/clangd/Config.h (-3) 
- (modified) clang-tools-extra/clangd/Headers.h (-4) 
- (modified) clang-tools-extra/clangd/Protocol.h (-5) 
- (modified) clang-tools-extra/clangd/SystemIncludeExtractor.cpp (-5) 
- (modified) clang-tools-extra/clangd/index/Ref.h (-4) 
- (modified) clang-tools-extra/clangd/index/SymbolID.h (-4) 
- (modified) clang-tools-extra/clangd/index/dex/Token.h (-4) 
- (modified) clang-tools-extra/clangd/index/dex/Trigram.h (+1-4) 
- (modified) 
clang-tools-extra/include-cleaner/include/clang-include-cleaner/Types.h (-7) 
- (modified) clang/include/clang/AST/APValue.h (-1) 
- (modified) clang/include/clang/AST/ASTContext.h (-11) 
- (modified) clang/include/clang/AST/ASTTypeTraits.h (-13) 
- (modified) clang/include/clang/AST/BaseSubobject.h (-6) 
- (modified) clang/include/clang/AST/CharUnits.h (-7) 
- (modified) clang/include/clang/AST/DeclID.h (-8) 
- (modified) clang/include/clang/AST/DeclarationName.h (-10) 
- (modified) clang/include/clang/AST/GlobalDecl.h (-5) 
- (modified) clang/include/clang/AST/NestedNameSpecifier.h (-9) 
- (modified) clang/include/clang/AST/Redeclarable.h (-6) 
- (modified) clang/include/clang/AST/TypeOrdering.h (-10) 
- (modified) clang/include/clang/Analysis/Analyses/LifetimeSafety/Utils.h (-4) 
- (modified) clang/include/clang/Analysis/CallGraph.h (-6) 
- (modified) 
clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h (-1) 
- (modified) clang/include/clang/Analysis/FlowSensitive/Formula.h (-1) 
- (modified) clang/include/clang/Analysis/ProgramPoint.h (-7) 
- (modified) clang/include/clang/Analysis/RetainSummaryManager.h (-5) 
- (modified) clang/include/clang/Basic/DirectoryEntry.h (+3-12) 
- (modified) clang/include/clang/Basic/FileEntry.h (+3-11) 
- (modified) clang/include/clang/Basic/IdentifierTable.h (-8) 
- (modified) clang/include/clang/Basic/Module.h (-4) 
- (modified) clang/include/clang/Basic/SourceLocation.h (-13) 
- (modified) clang/include/clang/Basic/TokenKinds.h (-3) 
- (modified) clang/include/clang/DependencyScanning/DependencyGraph.h (-3) 
- (modified) clang/include/clang/Sema/ScopeInfo.h (-4) 
- (modified) clang/include/clang/Sema/SemaCUDA.h (-4) 
- (modified) clang/include/clang/Sema/Weak.h (-3) 
- (modified) clang/include/clang/Serialization/ASTBitCodes.h (-8) 
- (modified) clang/include/clang/Tooling/Inclusions/StandardLibrary.h (-8) 
- (modified) clang/lib/APINotes/APINotesFormat.h (-18) 
- (modified) clang/lib/AST/APValue.cpp (-7) 
- (modified) clang/lib/AST/ExprConstant.cpp (-3) 
- (modified) clang/lib/AST/ItaniumCXXABI.cpp (+1-14) 
- (modified) clang/lib/CodeGen/CGDebugInfo.cpp (+1-1) 
- (modified) clang/lib/CodeGen/CGObjCMacConstantLiteralUtil.h (+6-18) 
- (modified) clang/lib/CodeGen/CodeGenTBAA.h (-10) 
- (modified) clang/lib/Sema/SemaStmt.cpp (+1-6) 
- (modified) clang/lib/StaticAnalyzer/Core/CallEvent.cpp (-5) 
- (modified) clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp (-3) 
- (modified) clang/tools/libclang/CXCursor.cpp (-3) 
- (modified) clang/tools/libclang/Indexing.cpp (-3) 


``````````diff
diff --git 
a/clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.h 
b/clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.h
index ecf43468eea20..e3ed12de4fd3e 100644
--- 
a/clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.h
+++ 
b/clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.h
@@ -87,14 +87,8 @@ struct DenseMapInfo<
     return {DenseMapInfo<clang::SourceLocation>::getEmptyKey(), "EMPTY"};
   }
 
-  static ClassDefId getTombstoneKey() {
-    return {DenseMapInfo<clang::SourceLocation>::getTombstoneKey(),
-            "TOMBSTONE"};
-  }
-
   static unsigned getHashValue(const ClassDefId &Val) {
     assert(Val != getEmptyKey() && "Cannot hash the empty key!");
-    assert(Val != getTombstoneKey() && "Cannot hash the tombstone key!");
 
     const std::hash<ClassDefId::second_type> SecondHash;
     return Val.first.getHashValue() + SecondHash(Val.second);
@@ -103,8 +97,6 @@ struct DenseMapInfo<
   static bool isEqual(const ClassDefId &LHS, const ClassDefId &RHS) {
     if (RHS == getEmptyKey())
       return LHS == getEmptyKey();
-    if (RHS == getTombstoneKey())
-      return LHS == getTombstoneKey();
     return LHS == RHS;
   }
 };
diff --git a/clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp 
b/clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp
index 0e4a6f49116da..c4b800d2c9e19 100644
--- a/clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp
+++ b/clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp
@@ -34,14 +34,8 @@ struct 
DenseMapInfo<clang::tidy::RenamerClangTidyCheck::NamingCheckId> {
     return {DenseMapInfo<clang::SourceLocation>::getEmptyKey(), "EMPTY"};
   }
 
-  static NamingCheckId getTombstoneKey() {
-    return {DenseMapInfo<clang::SourceLocation>::getTombstoneKey(),
-            "TOMBSTONE"};
-  }
-
   static unsigned getHashValue(NamingCheckId Val) {
     assert(Val != getEmptyKey() && "Cannot hash the empty key!");
-    assert(Val != getTombstoneKey() && "Cannot hash the tombstone key!");
 
     return DenseMapInfo<clang::SourceLocation>::getHashValue(Val.first) +
            DenseMapInfo<StringRef>::getHashValue(Val.second);
@@ -50,8 +44,6 @@ struct 
DenseMapInfo<clang::tidy::RenamerClangTidyCheck::NamingCheckId> {
   static bool isEqual(const NamingCheckId &LHS, const NamingCheckId &RHS) {
     if (RHS == getEmptyKey())
       return LHS == getEmptyKey();
-    if (RHS == getTombstoneKey())
-      return LHS == getTombstoneKey();
     return LHS == RHS;
   }
 };
diff --git a/clang-tools-extra/clangd/Config.h 
b/clang-tools-extra/clangd/Config.h
index 56d7ac453deeb..450ca6ea93ddc 100644
--- a/clang-tools-extra/clangd/Config.h
+++ b/clang-tools-extra/clangd/Config.h
@@ -232,9 +232,6 @@ template <> struct 
DenseMapInfo<clang::clangd::Config::ExternalIndexSpec> {
   static inline ExternalIndexSpec getEmptyKey() {
     return {ExternalIndexSpec::File, "", ""};
   }
-  static inline ExternalIndexSpec getTombstoneKey() {
-    return {ExternalIndexSpec::File, "TOMB", "STONE"};
-  }
   static unsigned getHashValue(const ExternalIndexSpec &Val) {
     return llvm::hash_combine(Val.Kind, Val.Location, Val.MountPoint);
   }
diff --git a/clang-tools-extra/clangd/Headers.h 
b/clang-tools-extra/clangd/Headers.h
index b91179da253e9..05536529b22b9 100644
--- a/clang-tools-extra/clangd/Headers.h
+++ b/clang-tools-extra/clangd/Headers.h
@@ -277,10 +277,6 @@ template <> struct 
DenseMapInfo<clang::clangd::IncludeStructure::HeaderID> {
     return static_cast<clang::clangd::IncludeStructure::HeaderID>(-1);
   }
 
-  static inline clang::clangd::IncludeStructure::HeaderID getTombstoneKey() {
-    return static_cast<clang::clangd::IncludeStructure::HeaderID>(-2);
-  }
-
   static unsigned
   getHashValue(const clang::clangd::IncludeStructure::HeaderID &Tag) {
     return hash_value(static_cast<unsigned>(Tag));
diff --git a/clang-tools-extra/clangd/Protocol.h 
b/clang-tools-extra/clangd/Protocol.h
index 9c1bb9d9bb059..67aea52ef43d4 100644
--- a/clang-tools-extra/clangd/Protocol.h
+++ b/clang-tools-extra/clangd/Protocol.h
@@ -2113,11 +2113,6 @@ template <> struct DenseMapInfo<clang::clangd::Range> {
     static Range R{Tomb, Tomb};
     return R;
   }
-  static inline Range getTombstoneKey() {
-    static clang::clangd::Position Tomb{-2, -2};
-    static Range R{Tomb, Tomb};
-    return R;
-  }
   static unsigned getHashValue(const Range &Val) {
     return llvm::hash_combine(Val.start.line, Val.start.character, 
Val.end.line,
                               Val.end.character);
diff --git a/clang-tools-extra/clangd/SystemIncludeExtractor.cpp 
b/clang-tools-extra/clangd/SystemIncludeExtractor.cpp
index e781f355aa3e1..8809426f8130a 100644
--- a/clang-tools-extra/clangd/SystemIncludeExtractor.cpp
+++ b/clang-tools-extra/clangd/SystemIncludeExtractor.cpp
@@ -222,11 +222,6 @@ template <> struct DenseMapInfo<DriverArgs> {
     Driver.Driver = "EMPTY_KEY";
     return Driver;
   }
-  static DriverArgs getTombstoneKey() {
-    auto Driver = DriverArgs::getEmpty();
-    Driver.Driver = "TOMBSTONE_KEY";
-    return Driver;
-  }
   static unsigned getHashValue(const DriverArgs &Val) {
     unsigned FixedFieldsHash = llvm::hash_value(std::tuple{
         Val.Driver,
diff --git a/clang-tools-extra/clangd/index/Ref.h 
b/clang-tools-extra/clangd/index/Ref.h
index 1241cb8361384..aa7c88443e909 100644
--- a/clang-tools-extra/clangd/index/Ref.h
+++ b/clang-tools-extra/clangd/index/Ref.h
@@ -175,10 +175,6 @@ template <> struct 
DenseMapInfo<clang::clangd::RefSlab::Builder::Entry> {
     static Entry E{clang::clangd::SymbolID(""), {}};
     return E;
   }
-  static inline Entry getTombstoneKey() {
-    static Entry E{clang::clangd::SymbolID("TOMBSTONE"), {}};
-    return E;
-  }
   static unsigned getHashValue(const Entry &Val) {
     return llvm::hash_combine(
         Val.Symbol, 
reinterpret_cast<uintptr_t>(Val.Reference.Location.FileURI),
diff --git a/clang-tools-extra/clangd/index/SymbolID.h 
b/clang-tools-extra/clangd/index/SymbolID.h
index e8aa462e96c17..929004aa70a25 100644
--- a/clang-tools-extra/clangd/index/SymbolID.h
+++ b/clang-tools-extra/clangd/index/SymbolID.h
@@ -85,10 +85,6 @@ template <> struct DenseMapInfo<clang::clangd::SymbolID> {
     static clang::clangd::SymbolID EmptyKey("EMPTYKEY");
     return EmptyKey;
   }
-  static inline clang::clangd::SymbolID getTombstoneKey() {
-    static clang::clangd::SymbolID TombstoneKey("TOMBSTONEKEY");
-    return TombstoneKey;
-  }
   static unsigned getHashValue(const clang::clangd::SymbolID &Sym) {
     return hash_value(Sym);
   }
diff --git a/clang-tools-extra/clangd/index/dex/Token.h 
b/clang-tools-extra/clangd/index/dex/Token.h
index c1ff0ad978a8d..f69d8f1f117ef 100644
--- a/clang-tools-extra/clangd/index/dex/Token.h
+++ b/clang-tools-extra/clangd/index/dex/Token.h
@@ -119,10 +119,6 @@ template <> struct DenseMapInfo<clang::clangd::dex::Token> 
{
     return {clang::clangd::dex::Token::Kind::Sentinel, "EmptyKey"};
   }
 
-  static inline clang::clangd::dex::Token getTombstoneKey() {
-    return {clang::clangd::dex::Token::Kind::Sentinel, "TombstoneKey"};
-  }
-
   static unsigned getHashValue(const clang::clangd::dex::Token &Tag) {
     return hash_value(Tag);
   }
diff --git a/clang-tools-extra/clangd/index/dex/Trigram.h 
b/clang-tools-extra/clangd/index/dex/Trigram.h
index 3fe975e76fe88..f523404cd82e0 100644
--- a/clang-tools-extra/clangd/index/dex/Trigram.h
+++ b/clang-tools-extra/clangd/index/dex/Trigram.h
@@ -38,7 +38,7 @@ namespace dex {
 class Trigram {
   std::array<char, 4> Data; // Last element is length.
   // Steal some invalid bit patterns for DenseMap sentinels.
-  enum class Sentinel { Tombstone = 4, Empty = 5 };
+  enum class Sentinel { Empty = 5 };
   Trigram(Sentinel S) : Data{0, 0, 0, static_cast<char>(S)} {}
   uint32_t id() const { return llvm::bit_cast<uint32_t>(Data); }
 
@@ -93,9 +93,6 @@ template <> struct DenseMapInfo<clang::clangd::dex::Trigram> {
   static inline Trigram getEmptyKey() {
     return Trigram(Trigram::Sentinel::Empty);
   }
-  static inline Trigram getTombstoneKey() {
-    return Trigram(Trigram::Sentinel::Tombstone);
-  }
   static unsigned getHashValue(Trigram V) {
     // Finalize step from MurmurHash3.
     uint32_t X = V.id();
diff --git 
a/clang-tools-extra/include-cleaner/include/clang-include-cleaner/Types.h 
b/clang-tools-extra/include-cleaner/include/clang-include-cleaner/Types.h
index 660d8eb227cca..99d65266bf53d 100644
--- a/clang-tools-extra/include-cleaner/include/clang-include-cleaner/Types.h
+++ b/clang-tools-extra/include-cleaner/include/clang-include-cleaner/Types.h
@@ -222,9 +222,6 @@ template <> struct 
DenseMapInfo<clang::include_cleaner::Symbol> {
   static Outer getEmptyKey() {
     return {Outer::SentinelTag{}, Base::getEmptyKey()};
   }
-  static Outer getTombstoneKey() {
-    return {Outer::SentinelTag{}, Base::getTombstoneKey()};
-  }
   static unsigned getHashValue(const Outer &Val) {
     return Base::getHashValue(Val.Storage);
   }
@@ -237,7 +234,6 @@ template <> struct 
DenseMapInfo<clang::include_cleaner::Macro> {
   using Base = DenseMapInfo<decltype(Outer::Definition)>;
 
   static Outer getEmptyKey() { return {nullptr, Base::getEmptyKey()}; }
-  static Outer getTombstoneKey() { return {nullptr, Base::getTombstoneKey()}; }
   static unsigned getHashValue(const Outer &Val) {
     return Base::getHashValue(Val.Definition);
   }
@@ -252,9 +248,6 @@ template <> struct 
DenseMapInfo<clang::include_cleaner::Header> {
   static Outer getEmptyKey() {
     return {Outer::SentinelTag{}, Base::getEmptyKey()};
   }
-  static Outer getTombstoneKey() {
-    return {Outer::SentinelTag{}, Base::getTombstoneKey()};
-  }
   static unsigned getHashValue(const Outer &Val) {
     return Base::getHashValue(Val.Storage);
   }
diff --git a/clang/include/clang/AST/APValue.h 
b/clang/include/clang/AST/APValue.h
index 3961e4e7fdfe0..22f0ad18caee4 100644
--- a/clang/include/clang/AST/APValue.h
+++ b/clang/include/clang/AST/APValue.h
@@ -839,7 +839,6 @@ class APValue {
 namespace llvm {
 template<> struct DenseMapInfo<clang::APValue::LValueBase> {
   static clang::APValue::LValueBase getEmptyKey();
-  static clang::APValue::LValueBase getTombstoneKey();
   static unsigned getHashValue(const clang::APValue::LValueBase &Base);
   static bool isEqual(const clang::APValue::LValueBase &LHS,
                       const clang::APValue::LValueBase &RHS);
diff --git a/clang/include/clang/AST/ASTContext.h 
b/clang/include/clang/AST/ASTContext.h
index c952b8d46974c..134e1f1422e52 100644
--- a/clang/include/clang/AST/ASTContext.h
+++ b/clang/include/clang/AST/ASTContext.h
@@ -73,9 +73,6 @@ template <> struct DenseMapInfo<ScalableVecTyKey> {
   static inline ScalableVecTyKey getEmptyKey() {
     return {DenseMapInfo<clang::QualType>::getEmptyKey(), ~0U, ~0U};
   }
-  static inline ScalableVecTyKey getTombstoneKey() {
-    return {DenseMapInfo<clang::QualType>::getTombstoneKey(), ~0U, ~0U};
-  }
   static unsigned getHashValue(const ScalableVecTyKey &Val) {
     return hash_combine(DenseMapInfo<clang::QualType>::getHashValue(Val.EltTy),
                         Val.NumElts, Val.NumFields);
@@ -4009,14 +4006,6 @@ typename clang::LazyGenerationalUpdatePtr<Owner, T, 
Update>::ValueType
 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();
   }
diff --git a/clang/include/clang/AST/ASTTypeTraits.h 
b/clang/include/clang/AST/ASTTypeTraits.h
index e0925551ef1a2..e8a18725645c0 100644
--- a/clang/include/clang/AST/ASTTypeTraits.h
+++ b/clang/include/clang/AST/ASTTypeTraits.h
@@ -110,11 +110,6 @@ class ASTNodeKind {
   struct DenseMapInfo {
     // ASTNodeKind() is a good empty key because it is represented as a 0.
     static inline ASTNodeKind getEmptyKey() { return ASTNodeKind(); }
-    // NKI_NumberOfKinds is not a valid value, so it is good for a
-    // tombstone key.
-    static inline ASTNodeKind getTombstoneKey() {
-      return ASTNodeKind(NKI_NumberOfKinds);
-    }
     static unsigned getHashValue(const ASTNodeKind &Val) { return Val.KindId; }
     static bool isEqual(const ASTNodeKind &LHS, const ASTNodeKind &RHS) {
       return LHS.KindId == RHS.KindId;
@@ -379,11 +374,6 @@ class DynTypedNode {
       Node.NodeKind = ASTNodeKind::DenseMapInfo::getEmptyKey();
       return Node;
     }
-    static inline DynTypedNode getTombstoneKey() {
-      DynTypedNode Node;
-      Node.NodeKind = ASTNodeKind::DenseMapInfo::getTombstoneKey();
-      return Node;
-    }
     static unsigned getHashValue(const DynTypedNode &Val) {
       // FIXME: Add hashing support for the remaining types.
       if (ASTNodeKind::getFromNodeKind<TypeLoc>().isBaseOf(Val.NodeKind)) {
@@ -405,11 +395,8 @@ class DynTypedNode {
     }
     static bool isEqual(const DynTypedNode &LHS, const DynTypedNode &RHS) {
       auto Empty = ASTNodeKind::DenseMapInfo::getEmptyKey();
-      auto TombStone = ASTNodeKind::DenseMapInfo::getTombstoneKey();
       return (ASTNodeKind::DenseMapInfo::isEqual(LHS.NodeKind, Empty) &&
               ASTNodeKind::DenseMapInfo::isEqual(RHS.NodeKind, Empty)) ||
-             (ASTNodeKind::DenseMapInfo::isEqual(LHS.NodeKind, TombStone) &&
-              ASTNodeKind::DenseMapInfo::isEqual(RHS.NodeKind, TombStone)) ||
              LHS == RHS;
     }
   };
diff --git a/clang/include/clang/AST/BaseSubobject.h 
b/clang/include/clang/AST/BaseSubobject.h
index 15600f02fcefb..f98c323a0b110 100644
--- a/clang/include/clang/AST/BaseSubobject.h
+++ b/clang/include/clang/AST/BaseSubobject.h
@@ -61,12 +61,6 @@ template<> struct DenseMapInfo<clang::BaseSubobject> {
       clang::CharUnits::fromQuantity(DenseMapInfo<int64_t>::getEmptyKey()));
   }
 
-  static clang::BaseSubobject getTombstoneKey() {
-    return clang::BaseSubobject(
-      DenseMapInfo<const clang::CXXRecordDecl *>::getTombstoneKey(),
-      
clang::CharUnits::fromQuantity(DenseMapInfo<int64_t>::getTombstoneKey()));
-  }
-
   static unsigned getHashValue(const clang::BaseSubobject &Base) {
     using PairTy = std::pair<const clang::CXXRecordDecl *, clang::CharUnits>;
 
diff --git a/clang/include/clang/AST/CharUnits.h 
b/clang/include/clang/AST/CharUnits.h
index e570bfae69524..e6e6b93e0c192 100644
--- a/clang/include/clang/AST/CharUnits.h
+++ b/clang/include/clang/AST/CharUnits.h
@@ -237,13 +237,6 @@ template<> struct DenseMapInfo<clang::CharUnits> {
     return clang::CharUnits::fromQuantity(Quantity);
   }
 
-  static clang::CharUnits getTombstoneKey() {
-    clang::CharUnits::QuantityType Quantity =
-      DenseMapInfo<clang::CharUnits::QuantityType>::getTombstoneKey();
-
-    return clang::CharUnits::fromQuantity(Quantity);
-  }
-
   static unsigned getHashValue(const clang::CharUnits &CU) {
     clang::CharUnits::QuantityType Quantity = CU.getQuantity();
     return 
DenseMapInfo<clang::CharUnits::QuantityType>::getHashValue(Quantity);
diff --git a/clang/include/clang/AST/DeclID.h b/clang/include/clang/AST/DeclID.h
index 47ae05b2747ae..8a173e3d96349 100644
--- a/clang/include/clang/AST/DeclID.h
+++ b/clang/include/clang/AST/DeclID.h
@@ -252,10 +252,6 @@ template <> struct DenseMapInfo<clang::GlobalDeclID> {
     return GlobalDeclID(DenseMapInfo<DeclID>::getEmptyKey());
   }
 
-  static GlobalDeclID getTombstoneKey() {
-    return GlobalDeclID(DenseMapInfo<DeclID>::getTombstoneKey());
-  }
-
   static unsigned getHashValue(const GlobalDeclID &Key) {
     return DenseMapInfo<DeclID>::getHashValue(Key.getRawValue());
   }
@@ -273,10 +269,6 @@ template <> struct DenseMapInfo<clang::LocalDeclID> {
     return LocalDeclID(DenseMapInfo<DeclID>::getEmptyKey());
   }
 
-  static LocalDeclID getTombstoneKey() {
-    return LocalDeclID(DenseMapInfo<DeclID>::getTombstoneKey());
-  }
-
   static unsigned getHashValue(const LocalDeclID &Key) {
     return DenseMapInfo<DeclID>::getHashValue(Key.getRawValue());
   }
diff --git a/clang/include/clang/AST/DeclarationName.h 
b/clang/include/clang/AST/DeclarationName.h
index 56d66e1b5e110..2cd7efcae5088 100644
--- a/clang/include/clang/AST/DeclarationName.h
+++ b/clang/include/clang/AST/DeclarationName.h
@@ -558,12 +558,6 @@ class DeclarationName {
     return Name;
   }
 
-  static DeclarationName getTombstoneMarker() {
-    DeclarationName Name;
-    Name.Ptr = uintptr_t(-2);
-    return Name;
-  }
-
   static int compare(DeclarationName LHS, DeclarationName RHS);
 
   void print(raw_ostream &OS, const PrintingPolicy &Policy) const;
@@ -934,10 +928,6 @@ struct DenseMapInfo<clang::DeclarationName> {
     return clang::DeclarationName::getEmptyMarker();
   }
 
-  static inline clang::DeclarationName getTombstoneKey() {
-    return clang::DeclarationName::getTombstoneMarker();
-  }
-
   static unsigned getHashValue(clang::DeclarationName Name) {
     return DenseMapInfo<void*>::getHashValue(Name.getAsOpaquePtr());
   }
diff --git a/clang/include/clang/AST/GlobalDecl.h 
b/clang/include/clang/AST/GlobalDecl.h
index 97caff0198cb0..b9a06afc271ca 100644
--- a/clang/include/clang/AST/GlobalDecl.h
+++ b/clang/include/clang/AST/GlobalDecl.h
@@ -219,11 +219,6 @@ namespace llvm {
       return clang::GlobalDecl();
     }
 
-    static inline clang::GlobalDecl getTombstoneKey() {
-      return clang::GlobalDecl::
-        getFromOpaquePtr(reinterpret_cast<void*>(-1));
-    }
-
     static unsigned getHashValue(clang::GlobalDecl GD) {
       return DenseMapInfo<void*>::getHashValue(GD.getAsOpaquePtr());
     }
diff --git a/clang/include/clang/AST/NestedNameSpecifier.h 
b/clang/include/clang/AST/NestedNameSpecifier.h
index f198a8bca9078..ac1439c70ce7b 100644
--- a/clang/include/clang/AST/NestedNameSpecifier.h
+++ b/clang/include/clang/AST/NestedNameSpecifier.h
@@ -255,10 +255,6 @@ namespace llvm {
 template <> struct DenseMapInfo<clang::NestedNameSpecifier> {
   static clang::NestedNameSpecifier getEmptyKey() { return std::nullopt; }
 
-  static clang::NestedNameSpecifier getTombstoneKey() {
-    return clang::NestedNameSpecifier::getInvalid();
-  }
-
   static unsigned getHashValue(const clang::NestedNameSpecifier &V) {
     return hash_combine(V.getAsVoidPointer());
   }
@@ -273,11 +269,6 @@ template <> struct 
DenseMapInfo<clang::NestedNameSpecifierLoc> {
                                          SecondInfo::getEmptyKey());
   }
 
-  static clang::NestedNameSpecifierLoc getTombstoneKey() {
-    return clang::NestedNameSpecifierLoc(FirstInfo::getTombstoneKey(),
-                                         SecondInfo::getTombstoneKey());
-  }
-
   static unsigned getHashValue(const clang::NestedNameSpecifierLoc &PairVal) {
     return hash_combine(
         FirstInfo::getHashValue(PairVal.getNestedNameSpecifier()),
diff --git a/clang/include/clang/AST/Redeclarable.h 
b/clang/include/clang/AST/Redeclarable.h
index 68516c66aaf65..6a3f485a5f5da 100644
--- a/clang/include/clang/AST/Redeclarable.h
+++ b/clang/include/clang/AST/Redeclarable.h
@@ -391,12 +391,6 @@ struct DenseMapInfo<clang::CanonicalDeclPtr<decl_type>> {
     return P;
   }
 
-  static CanonicalDeclPtr getTombstoneKey() {
-    CanonicalDeclPtr P;
-    P.Ptr = BaseInfo::getTombstoneKey();
-    return P;
-  }
-
   static unsigned getHashValue(const CanonicalDeclPtr &P) {
     return BaseInfo::getHashValue(P);
   }
diff --git a/clang/include/clang/AST/TypeOrdering.h 
b/clang/include/clang/AST/TypeOrdering.h
index 8037f98cc9651..0626cb97217f2 100644
--- a/clang/include/clang/AST/TypeOrdering.h
+++ b/clang/include/clang/AST/TypeOrdering.h
@@ -38,11 +38,6 @@ namespace llvm {
   template<> struct DenseMapInfo<clang::QualType> {
     static inline clang::QualType getEmptyKey() { return clang::QualType(); }
 
-    static inline clang::QualType getTombstoneKey() {
-      using clang::QualType;
-      return QualType::getFromOpaquePtr(reinterpret_cast<clang::Type *>(-1));
-    }
-
     static unsigned getHashValue(clang::QualType Val) {
       return (unsigned)((uintptr_t)Val.getAsOpaquePtr()) ^
             ((unsigned)((uintptr_t)Val.getAsOpaquePtr() >> 9));
@@ -58,11 +53,6 @@ namespace llvm {
       return clang::CanQualType();
     }
 
-    static inline clang::CanQualType getTombstoneKey() {
...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/200634
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to