From: Douglas Gregor Date: Thu, 3 May 2012 23:28:32 +0000 (+0000) Subject: Inline DenseMapInfo::getHashValue() for a 0.4% speedup on... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=82047c16486a28537746cfcc0d63745292b9fc54;p=clang Inline DenseMapInfo::getHashValue() for a 0.4% speedup on git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156129 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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 { return clang::DeclarationName::getTombstoneMarker(); } - static unsigned getHashValue(clang::DeclarationName); + static unsigned getHashValue(clang::DeclarationName Name) { + return DenseMapInfo::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:: -getHashValue(clang::DeclarationName N) { - return DenseMapInfo::getHashValue(N.getAsOpaquePtr()); -} - DeclarationNameLoc::DeclarationNameLoc(DeclarationName Name) { switch (Name.getNameKind()) { case DeclarationName::Identifier: