summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-05-03 23:28:32 +0000
committerDouglas Gregor <dgregor@apple.com>2012-05-03 23:28:32 +0000
commit82047c16486a28537746cfcc0d63745292b9fc54 (patch)
tree88cb6fa9951d3cdde33ba7a2ce26a4fc36989b36
parentebfa27205153c4b81bede598331c4e693253c2c7 (diff)
downloadclang-82047c16486a28537746cfcc0d63745292b9fc54.tar.gz
clang-82047c16486a28537746cfcc0d63745292b9fc54.tar.bz2
clang-82047c16486a28537746cfcc0d63745292b9fc54.tar.xz
Inline DenseMapInfo<clang::DeclarationName>::getHashValue() for a 0.4% speedup on <rdar://problem/11004361>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156129 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/AST/DeclarationName.h4
-rw-r--r--lib/AST/DeclarationName.cpp6
2 files changed, 3 insertions, 7 deletions
diff --git a/include/clang/AST/DeclarationName.h b/include/clang/AST/DeclarationName.h
index 928a85c63b..1548a8953a 100644
--- a/include/clang/AST/DeclarationName.h
+++ b/include/clang/AST/DeclarationName.h
@@ -570,7 +570,9 @@ struct DenseMapInfo<clang::DeclarationName> {
return clang::DeclarationName::getTombstoneMarker();
}
- static unsigned getHashValue(clang::DeclarationName);
+ static unsigned getHashValue(clang::DeclarationName Name) {
+ return DenseMapInfo<void*>::getHashValue(Name.getAsOpaquePtr());
+ }
static inline bool
isEqual(clang::DeclarationName LHS, clang::DeclarationName RHS) {
diff --git a/lib/AST/DeclarationName.cpp b/lib/AST/DeclarationName.cpp
index 324a2cbf85..895cd5193a 100644
--- a/lib/AST/DeclarationName.cpp
+++ b/lib/AST/DeclarationName.cpp
@@ -481,12 +481,6 @@ DeclarationNameTable::getCXXLiteralOperatorName(IdentifierInfo *II) {
return DeclarationName(LiteralName);
}
-unsigned
-llvm::DenseMapInfo<clang::DeclarationName>::
-getHashValue(clang::DeclarationName N) {
- return DenseMapInfo<void*>::getHashValue(N.getAsOpaquePtr());
-}
-
DeclarationNameLoc::DeclarationNameLoc(DeclarationName Name) {
switch (Name.getNameKind()) {
case DeclarationName::Identifier: