[Syntax] DeclaratorList is a List
authorSam McCall <sam.mccall@gmail.com>
Sat, 31 Oct 2020 20:20:27 +0000 (21:20 +0100)
committerSam McCall <sam.mccall@gmail.com>
Tue, 3 Nov 2020 02:29:06 +0000 (03:29 +0100)
I think this was just an oversight.

Differential Revision: https://reviews.llvm.org/D90541

clang/lib/Tooling/Syntax/Tree.cpp

index f910365..204c83e 100644 (file)
@@ -305,6 +305,7 @@ bool syntax::List::classof(const syntax::Node *N) {
   case syntax::NodeKind::NestedNameSpecifier:
   case syntax::NodeKind::CallArguments:
   case syntax::NodeKind::ParameterDeclarationList:
+  case syntax::NodeKind::DeclaratorList:
     return true;
   default:
     return false;
@@ -405,6 +406,7 @@ clang::tok::TokenKind syntax::List::getDelimiterTokenKind() const {
     return clang::tok::coloncolon;
   case NodeKind::CallArguments:
   case NodeKind::ParameterDeclarationList:
+  case NodeKind::DeclaratorList:
     return clang::tok::comma;
   default:
     llvm_unreachable("This is not a subclass of List, thus "
@@ -418,6 +420,7 @@ syntax::List::TerminationKind syntax::List::getTerminationKind() const {
     return TerminationKind::Terminated;
   case NodeKind::CallArguments:
   case NodeKind::ParameterDeclarationList:
+  case NodeKind::DeclaratorList:
     return TerminationKind::Separated;
   default:
     llvm_unreachable("This is not a subclass of List, thus "
@@ -433,6 +436,8 @@ bool syntax::List::canBeEmpty() const {
     return true;
   case NodeKind::ParameterDeclarationList:
     return true;
+  case NodeKind::DeclaratorList:
+    return true;
   default:
     llvm_unreachable("This is not a subclass of List, thus canBeEmpty() "
                      "cannot be called");