[clang] dd6f7ee - [Syntax] DeclaratorList is a List
Sam McCall via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 2 18:31:42 PST 2020
Author: Sam McCall
Date: 2020-11-03T03:29:06+01:00
New Revision: dd6f7ee05e90edcca70ab5bb51315b3caba5206c
URL: https://github.com/llvm/llvm-project/commit/dd6f7ee05e90edcca70ab5bb51315b3caba5206c
DIFF: https://github.com/llvm/llvm-project/commit/dd6f7ee05e90edcca70ab5bb51315b3caba5206c.diff
LOG: [Syntax] DeclaratorList is a List
I think this was just an oversight.
Differential Revision: https://reviews.llvm.org/D90541
Added:
Modified:
clang/lib/Tooling/Syntax/Tree.cpp
Removed:
################################################################################
diff --git a/clang/lib/Tooling/Syntax/Tree.cpp b/clang/lib/Tooling/Syntax/Tree.cpp
index f910365c61c1..204c83ea3b8c 100644
--- a/clang/lib/Tooling/Syntax/Tree.cpp
+++ b/clang/lib/Tooling/Syntax/Tree.cpp
@@ -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");
More information about the cfe-commits
mailing list