summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTDumper.cpp
diff options
context:
space:
mode:
authorFaisal Vali <faisalv@yahoo.com>2018-04-25 02:42:26 +0000
committerFaisal Vali <faisalv@yahoo.com>2018-04-25 02:42:26 +0000
commit936de9d666009ddce7bedc5b073bc06c860d5f5b (patch)
tree440e812f02457e38b03ebed89c36ecfc22a052a3 /clang/lib/AST/ASTDumper.cpp
parente21278d93805689c5e5d6bb1d52a8d907fd7ba5c (diff)
downloadbcm5719-llvm-936de9d666009ddce7bedc5b073bc06c860d5f5b.tar.gz
bcm5719-llvm-936de9d666009ddce7bedc5b073bc06c860d5f5b.zip
[c++2a] [concepts] Add rudimentary parsing support for template concept declarations
This patch is a tweak of changyu's patch: https://reviews.llvm.org/D40381. It differs in that the recognition of the 'concept' token is moved into the machinery that recognizes declaration-specifiers - this allows us to leverage the attribute handling machinery more seamlessly. See the test file to get a sense of the basic parsing that this patch supports. There is much more work to be done before concepts are usable... Thanks Changyu! llvm-svn: 330794
Diffstat (limited to 'clang/lib/AST/ASTDumper.cpp')
-rw-r--r--clang/lib/AST/ASTDumper.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTDumper.cpp b/clang/lib/AST/ASTDumper.cpp
index cf512b9bd3f..b0f0c5d0f57 100644
--- a/clang/lib/AST/ASTDumper.cpp
+++ b/clang/lib/AST/ASTDumper.cpp
@@ -466,6 +466,7 @@ namespace {
bool DumpRefOnly);
template<typename TemplateDecl>
void VisitTemplateDecl(const TemplateDecl *D, bool DumpExplicitInst);
+ void VisitConceptDecl(const ConceptDecl *D);
void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D);
void VisitClassTemplateDecl(const ClassTemplateDecl *D);
void VisitClassTemplateSpecializationDecl(
@@ -1577,6 +1578,12 @@ void ASTDumper::VisitTemplateDecl(const TemplateDecl *D,
!D->isCanonicalDecl());
}
+void ASTDumper::VisitConceptDecl(const ConceptDecl *D) {
+ dumpName(D);
+ dumpTemplateParameters(D->getTemplateParameters());
+ dumpStmt(D->getConstraintExpr());
+}
+
void ASTDumper::VisitFunctionTemplateDecl(const FunctionTemplateDecl *D) {
// FIXME: We don't add a declaration of a function template specialization
// to its context when it's explicitly instantiated, so dump explicit
OpenPOWER on IntegriCloud