summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-08-03 17:30:01 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-08-03 17:30:01 +0000
commita6430cfe4830787f366e6b46744d8327d659968c (patch)
tree5d59ed7da12af6ec592ed8c0f4c2cf0c1ec5ac67
parent1e1de05f18b9cb3aae8691d3ded28c97efc3e049 (diff)
downloadbcm5719-llvm-a6430cfe4830787f366e6b46744d8327d659968c.tar.gz
bcm5719-llvm-a6430cfe4830787f366e6b46744d8327d659968c.zip
Introduce getMostRecentDeclaration() and getFirstDeclaration() for RedeclarableTemplateDecl.
llvm-svn: 110124
-rw-r--r--clang/include/clang/AST/DeclTemplate.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/clang/include/clang/AST/DeclTemplate.h b/clang/include/clang/AST/DeclTemplate.h
index 246a06f9633..ff5f9f1314c 100644
--- a/clang/include/clang/AST/DeclTemplate.h
+++ b/clang/include/clang/AST/DeclTemplate.h
@@ -613,6 +613,32 @@ public:
const_cast<RedeclarableTemplateDecl*>(this)->getPreviousDeclaration();
}
+ /// \brief Retrieve the first declaration of this template, or itself
+ /// if this the first one.
+ RedeclarableTemplateDecl *getFirstDeclaration() {
+ return getCanonicalDecl();
+ }
+
+ /// \brief Retrieve the first declaration of this template, or itself
+ /// if this the first one.
+ const RedeclarableTemplateDecl *getFirstDeclaration() const {
+ return
+ const_cast<RedeclarableTemplateDecl*>(this)->getFirstDeclaration();
+ }
+
+ /// \brief Retrieve the most recent declaration of this template, or itself
+ /// if this the most recent one.
+ RedeclarableTemplateDecl *getMostRecentDeclaration() {
+ return getCommonPtr()->Latest;
+ }
+
+ /// \brief Retrieve the most recent declaration of this template, or itself
+ /// if this the most recent one.
+ const RedeclarableTemplateDecl *getMostRecentDeclaration() const {
+ return
+ const_cast<RedeclarableTemplateDecl*>(this)->getMostRecentDeclaration();
+ }
+
/// \brief Determines whether this template was a specialization of a
/// member template.
///
OpenPOWER on IntegriCloud