Skip to content

Commit

Permalink
Inline DenseMapInfo<clang::DeclarationName>::getHashValue() for a 0.4…
Browse files Browse the repository at this point in the history
…% speedup on <rdar://problem/11004361>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156129 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
DougGregor committed May 3, 2012
1 parent ebfa272 commit 82047c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 3 additions & 1 deletion include/clang/AST/DeclarationName.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 0 additions & 6 deletions lib/AST/DeclarationName.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 82047c1

Please sign in to comment.