summaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/lib/AST/TextNodeDumper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/clang/lib/AST/TextNodeDumper.cpp')
-rw-r--r--contrib/llvm-project/clang/lib/AST/TextNodeDumper.cpp43
1 files changed, 38 insertions, 5 deletions
diff --git a/contrib/llvm-project/clang/lib/AST/TextNodeDumper.cpp b/contrib/llvm-project/clang/lib/AST/TextNodeDumper.cpp
index cba9091b1065..c9b571862c19 100644
--- a/contrib/llvm-project/clang/lib/AST/TextNodeDumper.cpp
+++ b/contrib/llvm-project/clang/lib/AST/TextNodeDumper.cpp
@@ -223,7 +223,6 @@ void TextNodeDumper::Visit(const Decl *D) {
return;
}
- Context = &D->getASTContext();
{
ColorScope Color(OS, ShowColors, DeclKindNameColor);
OS << D->getDeclKindName() << "Decl";
@@ -490,6 +489,9 @@ void TextNodeDumper::visitInlineCommandComment(
case comments::InlineCommandComment::RenderEmphasized:
OS << " RenderEmphasized";
break;
+ case comments::InlineCommandComment::RenderAnchor:
+ OS << " RenderAnchor";
+ break;
}
for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
@@ -637,8 +639,8 @@ static void dumpBasePath(raw_ostream &OS, const CastExpr *Node) {
if (!First)
OS << " -> ";
- const CXXRecordDecl *RD =
- cast<CXXRecordDecl>(Base->getType()->getAs<RecordType>()->getDecl());
+ const auto *RD =
+ cast<CXXRecordDecl>(Base->getType()->castAs<RecordType>()->getDecl());
if (Base->isVirtual())
OS << "virtual ";
@@ -688,7 +690,7 @@ void TextNodeDumper::VisitConstantExpr(const ConstantExpr *Node) {
if (Node->getResultAPValueKind() != APValue::None) {
ColorScope Color(OS, ShowColors, ValueColor);
OS << " ";
- Node->getAPValueResult().printPretty(OS, *Context, Node->getType());
+ Node->getAPValueResult().dump(OS);
}
}
@@ -1199,6 +1201,11 @@ void TextNodeDumper::VisitAutoType(const AutoType *T) {
OS << " decltype(auto)";
if (!T->isDeduced())
OS << " undeduced";
+ if (T->isConstrained()) {
+ dumpDeclRef(T->getTypeConstraintConcept());
+ for (const auto &Arg : T->getTypeConstraintArguments())
+ VisitTemplateArgument(Arg);
+ }
}
void TextNodeDumper::VisitTemplateSpecializationType(
@@ -1339,6 +1346,17 @@ void TextNodeDumper::VisitFunctionDecl(const FunctionDecl *D) {
OS << " <<<NULL params x " << D->getNumParams() << ">>>";
}
+void TextNodeDumper::VisitLifetimeExtendedTemporaryDecl(
+ const LifetimeExtendedTemporaryDecl *D) {
+ OS << " extended by ";
+ dumpBareDeclRef(D->getExtendingDecl());
+ OS << " mangling ";
+ {
+ ColorScope Color(OS, ShowColors, ValueColor);
+ OS << D->getManglingNumber();
+ }
+}
+
void TextNodeDumper::VisitFieldDecl(const FieldDecl *D) {
dumpName(D);
dumpType(D->getType());
@@ -1385,6 +1403,8 @@ void TextNodeDumper::VisitVarDecl(const VarDecl *D) {
break;
}
}
+ if (D->needsDestruction(D->getASTContext()))
+ OS << " destroyed";
if (D->isParameterPack())
OS << " pack";
}
@@ -1537,6 +1557,7 @@ void TextNodeDumper::VisitCXXRecordDecl(const CXXRecordDecl *D) {
FLAG(isGenericLambda, generic);
FLAG(isLambda, lambda);
+ FLAG(isAnonymousStructOrUnion, is_anonymous);
FLAG(canPassInRegisters, pass_in_registers);
FLAG(isEmpty, empty);
FLAG(isAggregate, aggregate);
@@ -1641,6 +1662,7 @@ void TextNodeDumper::VisitCXXRecordDecl(const CXXRecordDecl *D) {
FLAG(hasTrivialDestructor, trivial);
FLAG(hasNonTrivialDestructor, non_trivial);
FLAG(hasUserDeclaredDestructor, user_declared);
+ FLAG(hasConstexprDestructor, constexpr);
FLAG(needsImplicitDestructor, needs_implicit);
FLAG(needsOverloadResolutionForDestructor, needs_overload_resolution);
if (!D->needsOverloadResolutionForDestructor())
@@ -1677,7 +1699,16 @@ void TextNodeDumper::VisitBuiltinTemplateDecl(const BuiltinTemplateDecl *D) {
}
void TextNodeDumper::VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D) {
- if (D->wasDeclaredWithTypename())
+ if (const auto *TC = D->getTypeConstraint()) {
+ OS << " ";
+ dumpBareDeclRef(TC->getNamedConcept());
+ if (TC->getNamedConcept() != TC->getFoundDecl()) {
+ OS << " (";
+ dumpBareDeclRef(TC->getFoundDecl());
+ OS << ")";
+ }
+ Visit(TC->getImmediatelyDeclaredConstraint());
+ } else if (D->wasDeclaredWithTypename())
OS << " typename";
else
OS << " class";
@@ -1912,6 +1943,8 @@ void TextNodeDumper::VisitObjCPropertyDecl(const ObjCPropertyDecl *D) {
OS << " unsafe_unretained";
if (Attrs & ObjCPropertyDecl::OBJC_PR_class)
OS << " class";
+ if (Attrs & ObjCPropertyDecl::OBJC_PR_direct)
+ OS << " direct";
if (Attrs & ObjCPropertyDecl::OBJC_PR_getter)
dumpDeclRef(D->getGetterMethodDecl(), "getter");
if (Attrs & ObjCPropertyDecl::OBJC_PR_setter)