: '.');
else
OS.indent(Indent);
- OS << N.ASTNode.getNodeKind().asStringRef() << " ";
+ if (const TypeLoc *TL = N.ASTNode.get<TypeLoc>()) {
+ // TypeLoc is a hierarchy, but has only a single ASTNodeKind.
+ // Synthesize the name from the Type subclass (except for QualifiedTypeLoc).
+ if (TL->getTypeLocClass() == TypeLoc::Qualified)
+ OS << "QualifiedTypeLoc";
+ else
+ OS << TL->getType()->getTypeClassName() << "TypeLoc";
+ } else {
+ OS << N.ASTNode.getNodeKind().asStringRef();
+ }
+ OS << " ";
N.ASTNode.print(OS, PrintPolicy);
OS << "\n";
for (const Node *Child : N.Children)
if (Begin == End)
std::tie(Begin, End) = pointBounds(Begin, FID, AST);
PrintPolicy.TerseOutput = true;
+ PrintPolicy.IncludeNewlines = false;
Nodes = SelectionVisitor::collect(AST, Begin, End, FID);
Root = Nodes.empty() ? nullptr : &Nodes.front();