diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-02-17 08:14:56 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-02-17 08:14:56 +0000 |
commit | 8755836379a3f8e9848b5e770aa60d00e1fbb990 (patch) | |
tree | 150f4a9547b27ed0063617a61d530bc925823cb8 /lib/AST/DeclBase.cpp | |
parent | 770877fa855d1de462392e503ef08252614b0994 (diff) |
Simple little optimization to Decl::getCanonicalDecl(), eliminating some heavyweight machinery and indirection that we don't need
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125737 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r-- | lib/AST/DeclBase.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 76bb2d5ddf..5a117ebbf2 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -169,11 +169,11 @@ bool Decl::isDefinedOutsideFunctionOrMethod() const { namespace { template<typename Class, typename Result> - inline Result *getSpecificCanonicalDecl(Decl *D, Result *(Class::*Get)()) { - return (llvm::cast<Class>(D)->*Get)(); + inline Result *getCanonicalDeclImpl(Decl *D, Result *(Class::*)()) { + return static_cast<Class *>(D)->getCanonicalDecl(); } - inline Decl *getSpecificCanonicalDecl(Decl *D, Decl *(Decl::*)()) { + inline Decl *getCanonicalDeclImpl(Decl *D, Decl *(Decl::*)()) { // No specific implementation. return D; } @@ -184,7 +184,7 @@ Decl *Decl::getCanonicalDecl() { #define ABSTRACT_DECL(Type) #define DECL(Type, Base) \ case Type: \ - return getSpecificCanonicalDecl(this, &Type##Decl::getCanonicalDecl); + return getCanonicalDeclImpl(this, &Type##Decl::getCanonicalDecl); #include "clang/AST/DeclNodes.inc" } |