diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-18 00:34:07 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-18 00:34:07 +0000 |
commit | b57a4fe73b8227c0dba651818b8495dfca61e530 (patch) | |
tree | 56854fb0f97e67a7dc7ef19ba5fedb56155a29a9 /include/clang/AST/DeclBase.h | |
parent | 0df134715d75c62422502af0f5610885a5a4f472 (diff) |
Move the functionality of ASTContext::getCanonicalDecl(), into a virtual method Decl::getCanonicalDecl().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76273 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST/DeclBase.h')
-rw-r--r-- | include/clang/AST/DeclBase.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index 2d056c479b..5350706ae0 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -312,12 +312,14 @@ public: // be defined inside or outside a function etc). bool isDefinedOutsideFunctionOrMethod() const; - /// \brief When there are multiple re-declarations (e.g. for functions), - /// this will return the primary one which all of them point to. - virtual Decl *getPrimaryDecl() const { return const_cast<Decl*>(this); } + /// \brief Retrieves the "canonical" declaration of the given declaration. + virtual Decl *getCanonicalDecl() { return this; } + const Decl *getCanonicalDecl() const { + return const_cast<Decl*>(this)->getCanonicalDecl(); + } /// \brief Whether this particular Decl is a primary one. - bool isPrimaryDecl() const { return getPrimaryDecl() == this; } + bool isCanonicalDecl() const { return getCanonicalDecl() == this; } /// getBody - If this Decl represents a declaration for a body of code, /// such as a function or method definition, this method returns the |