[cfe-commits] r110124 - /cfe/trunk/include/clang/AST/DeclTemplate.h

Argyrios Kyrtzidis akyrtzi at gmail.com
Tue Aug 3 10:30:01 PDT 2010


Author: akirtzidis
Date: Tue Aug  3 12:30:01 2010
New Revision: 110124

URL: http://llvm.org/viewvc/llvm-project?rev=110124&view=rev
Log:
Introduce getMostRecentDeclaration() and getFirstDeclaration() for RedeclarableTemplateDecl.

Modified:
    cfe/trunk/include/clang/AST/DeclTemplate.h

Modified: cfe/trunk/include/clang/AST/DeclTemplate.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclTemplate.h?rev=110124&r1=110123&r2=110124&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclTemplate.h (original)
+++ cfe/trunk/include/clang/AST/DeclTemplate.h Tue Aug  3 12:30:01 2010
@@ -613,6 +613,32 @@
       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.
   ///





More information about the cfe-commits mailing list