diff options
| author | John McCall <rjmccall@apple.com> | 2010-08-31 22:21:26 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2010-08-31 22:21:26 +0000 |
| commit | c265ad253e02bbde359fe0fc24b42b0b19e55b1b (patch) | |
| tree | 301e1a4f9f06e75db2e3ea8ca1c3fad339b86fdd | |
| parent | f11309e1943782d323f195c06824a486982e3340 (diff) | |
| download | llvm-c265ad253e02bbde359fe0fc24b42b0b19e55b1b.zip llvm-c265ad253e02bbde359fe0fc24b42b0b19e55b1b.tar.gz llvm-c265ad253e02bbde359fe0fc24b42b0b19e55b1b.tar.bz2 | |
Add convenience accessors for determining whether template declarations are definitions.
llvm-svn: 112656
| -rw-r--r-- | clang/include/clang/AST/Decl.h | 6 | ||||
| -rw-r--r-- | clang/include/clang/AST/DeclTemplate.h | 12 |
2 files changed, 18 insertions, 0 deletions
diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h index 4fdcf68..7fb6978 100644 --- a/clang/include/clang/AST/Decl.h +++ b/clang/include/clang/AST/Decl.h @@ -1886,6 +1886,12 @@ public: 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; diff --git a/clang/include/clang/AST/DeclTemplate.h b/clang/include/clang/AST/DeclTemplate.h index 76d474a..482f734 100644 --- a/clang/include/clang/AST/DeclTemplate.h +++ b/clang/include/clang/AST/DeclTemplate.h @@ -815,6 +815,12 @@ public: 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 @@ public: 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, |
