[cfe-commits] r156129 - in /cfe/trunk: include/clang/AST/DeclarationName.h lib/AST/DeclarationName.cpp
Douglas Gregor
dgregor at apple.com
Thu May 3 16:28:33 PDT 2012
Author: dgregor
Date: Thu May 3 18:28:32 2012
New Revision: 156129
URL: http://llvm.org/viewvc/llvm-project?rev=156129&view=rev
Log:
Inline DenseMapInfo<clang::DeclarationName>::getHashValue() for a 0.4% speedup on <rdar://problem/11004361>
Modified:
cfe/trunk/include/clang/AST/DeclarationName.h
cfe/trunk/lib/AST/DeclarationName.cpp
Modified: cfe/trunk/include/clang/AST/DeclarationName.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclarationName.h?rev=156129&r1=156128&r2=156129&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclarationName.h (original)
+++ cfe/trunk/include/clang/AST/DeclarationName.h Thu May 3 18:28:32 2012
@@ -570,7 +570,9 @@
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) {
Modified: cfe/trunk/lib/AST/DeclarationName.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclarationName.cpp?rev=156129&r1=156128&r2=156129&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclarationName.cpp (original)
+++ cfe/trunk/lib/AST/DeclarationName.cpp Thu May 3 18:28:32 2012
@@ -481,12 +481,6 @@
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:
More information about the cfe-commits
mailing list