[clang] 1c0a0df - [Concepts] Include the found concept decl when dumping the ConceptSpecializationExpr
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 4 06:58:45 PDT 2020
Author: Haojian Wu
Date: 2020-08-04T15:58:12+02:00
New Revision: 1c0a0dfa0236514fd1fbb1bccd8ad29f9d64e915
URL: https://github.com/llvm/llvm-project/commit/1c0a0dfa0236514fd1fbb1bccd8ad29f9d64e915
DIFF: https://github.com/llvm/llvm-project/commit/1c0a0dfa0236514fd1fbb1bccd8ad29f9d64e915.diff
LOG: [Concepts] Include the found concept decl when dumping the ConceptSpecializationExpr
Differential Revision: https://reviews.llvm.org/D85124
Added:
Modified:
clang/include/clang/AST/TextNodeDumper.h
clang/lib/AST/TextNodeDumper.cpp
clang/test/AST/ast-dump-concepts.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/AST/TextNodeDumper.h b/clang/include/clang/AST/TextNodeDumper.h
index 8e8084aec3c1..f68a5dbfc2a0 100644
--- a/clang/include/clang/AST/TextNodeDumper.h
+++ b/clang/include/clang/AST/TextNodeDumper.h
@@ -295,6 +295,7 @@ class TextNodeDumper
void VisitObjCIvarRefExpr(const ObjCIvarRefExpr *Node);
void VisitObjCBoolLiteralExpr(const ObjCBoolLiteralExpr *Node);
void VisitOMPIteratorExpr(const OMPIteratorExpr *Node);
+ void VisitConceptSpecializationExpr(const ConceptSpecializationExpr *Node);
void VisitRValueReferenceType(const ReferenceType *T);
void VisitArrayType(const ArrayType *T);
diff --git a/clang/lib/AST/TextNodeDumper.cpp b/clang/lib/AST/TextNodeDumper.cpp
index 5b6c6085e02c..3d47d5cb66d2 100644
--- a/clang/lib/AST/TextNodeDumper.cpp
+++ b/clang/lib/AST/TextNodeDumper.cpp
@@ -1340,6 +1340,12 @@ void TextNodeDumper::VisitOMPIteratorExpr(const OMPIteratorExpr *Node) {
}
}
+void TextNodeDumper::VisitConceptSpecializationExpr(
+ const ConceptSpecializationExpr *Node) {
+ OS << " ";
+ dumpBareDeclRef(Node->getFoundDecl());
+}
+
void TextNodeDumper::VisitRValueReferenceType(const ReferenceType *T) {
if (T->isSpelledAsLValue())
OS << " written as lvalue reference";
diff --git a/clang/test/AST/ast-dump-concepts.cpp b/clang/test/AST/ast-dump-concepts.cpp
index 7050ee0fb449..630a953976fc 100644
--- a/clang/test/AST/ast-dump-concepts.cpp
+++ b/clang/test/AST/ast-dump-concepts.cpp
@@ -15,7 +15,7 @@ concept binary_concept = true;
template <typename T>
struct Foo {
// CHECK: TemplateTypeParmDecl {{.*}} referenced Concept {{.*}} 'binary_concept'
- // CHECK-NEXT: |-ConceptSpecializationExpr {{.*}} <col:13, col:31> 'bool'
+ // CHECK-NEXT: |-ConceptSpecializationExpr {{.*}} <col:13, col:31> 'bool' Concept {{.*}} 'binary_concept'
// CHECK-NEXT: `-TemplateArgument {{.*}} type 'int'
template <binary_concept<int> R>
Foo(R);
More information about the cfe-commits
mailing list