[cfe-commits] r112656 - in /cfe/trunk/include/clang/AST: Decl.h DeclTemplate.h
John McCall
rjmccall at apple.com
Tue Aug 31 15:21:26 PDT 2010
Author: rjmccall
Date: Tue Aug 31 17:21:26 2010
New Revision: 112656
URL: http://llvm.org/viewvc/llvm-project?rev=112656&view=rev
Log:
Add convenience accessors for determining whether template declarations are definitions.
Modified:
cfe/trunk/include/clang/AST/Decl.h
cfe/trunk/include/clang/AST/DeclTemplate.h
Modified: cfe/trunk/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=112656&r1=112655&r2=112656&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Tue Aug 31 17:21:26 2010
@@ -1886,6 +1886,12 @@
return const_cast<TagDecl*>(this)->getCanonicalDecl();
}
+ /// isThisDeclarationADefinition() - Return true if this declaration
+ /// defines the type. Provided for consistency.
+ bool isThisDeclarationADefinition() const {
+ return isDefinition();
+ }
+
/// isDefinition - Return true if this decl has its body specified.
bool isDefinition() const {
return IsDefinition;
Modified: cfe/trunk/include/clang/AST/DeclTemplate.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclTemplate.h?rev=112656&r1=112655&r2=112656&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclTemplate.h (original)
+++ cfe/trunk/include/clang/AST/DeclTemplate.h Tue Aug 31 17:21:26 2010
@@ -815,6 +815,12 @@
return static_cast<FunctionDecl*>(TemplatedDecl);
}
+ /// Returns whether this template declaration defines the primary
+ /// pattern.
+ bool isThisDeclarationADefinition() const {
+ return getTemplatedDecl()->isThisDeclarationADefinition();
+ }
+
/// \brief Return the specialization with the provided arguments if it exists,
/// otherwise return the insertion point.
FunctionDecl *findSpecialization(const TemplateArgument *Args,
@@ -1664,6 +1670,12 @@
return static_cast<CXXRecordDecl *>(TemplatedDecl);
}
+ /// Returns whether this template declaration defines the primary
+ /// class pattern.
+ bool isThisDeclarationADefinition() const {
+ return getTemplatedDecl()->isThisDeclarationADefinition();
+ }
+
/// Create a class template node.
static ClassTemplateDecl *Create(ASTContext &C, DeclContext *DC,
SourceLocation L,
More information about the cfe-commits
mailing list