aboutsummaryrefslogtreecommitdiff
path: root/Lex/IdentifierTable.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-10-05 20:15:24 +0000
committerChris Lattner <sabre@nondot.org>2007-10-05 20:15:24 +0000
commit85994260c41a54cab061a434ed378fc448333a4e (patch)
tree8a8ad239596b4d1884c8a8bad7e33261cfcac5c3 /Lex/IdentifierTable.cpp
parent29238a0bf7cbf5b396efb451a0adb5fe4aa037ca (diff)
Implement DenseMapInfo for Selector, allowing use of DenseMap/DenseSet of
Selector's instead of requiring void* to be used. I converted one use of DenseSet<void*> over to use DenseSet<Selector> but the others should change as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42645 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Lex/IdentifierTable.cpp')
-rw-r--r--Lex/IdentifierTable.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lex/IdentifierTable.cpp b/Lex/IdentifierTable.cpp
index 2ca1225b17..f3a6cf7175 100644
--- a/Lex/IdentifierTable.cpp
+++ b/Lex/IdentifierTable.cpp
@@ -16,6 +16,7 @@
#include "clang/Lex/MacroInfo.h"
#include "clang/Basic/LangOptions.h"
#include "llvm/ADT/FoldingSet.h"
+#include "llvm/ADT/DenseMap.h"
using namespace clang;
//===----------------------------------------------------------------------===//
@@ -215,10 +216,16 @@ void IdentifierTable::PrintStats() const {
// SelectorTable Implementation
//===----------------------------------------------------------------------===//
+unsigned llvm::DenseMapInfo<clang::Selector>::getHashValue(clang::Selector S) {
+ return DenseMapInfo<void*>::getHashValue(S.getAsOpaquePtr());
+}
+
+
/// MultiKeywordSelector - One of these variable length records is kept for each
/// selector containing more than one keyword. We use a folding set
/// to unique aggregate names (keyword selectors in ObjC parlance). Access to
/// this class is provided strictly through Selector.
+namespace clang {
class MultiKeywordSelector : public llvm::FoldingSetNode {
public:
unsigned NumArgs;
@@ -263,6 +270,7 @@ public:
Profile(ID, keyword_begin(), NumArgs);
}
};
+} // end namespace clang.
unsigned Selector::getNumArgs() const {
unsigned IIF = getIdentifierInfoFlag();