[clang] 138189e - [Syntax] Tablegen operator<<(NodeKind). NFC
Sam McCall via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 11 07:03:27 PST 2020
Author: Sam McCall
Date: 2020-11-11T16:02:01+01:00
New Revision: 138189ee33ab4359bbda834d8715b16d096c1087
URL: https://github.com/llvm/llvm-project/commit/138189ee33ab4359bbda834d8715b16d096c1087
DIFF: https://github.com/llvm/llvm-project/commit/138189ee33ab4359bbda834d8715b16d096c1087.diff
LOG: [Syntax] Tablegen operator<<(NodeKind). NFC
Differential Revision: https://reviews.llvm.org/D90662
Added:
Modified:
clang/lib/Tooling/Syntax/Nodes.cpp
Removed:
################################################################################
diff --git a/clang/lib/Tooling/Syntax/Nodes.cpp b/clang/lib/Tooling/Syntax/Nodes.cpp
index 0be9f1f03add..e9e216af5754 100644
--- a/clang/lib/Tooling/Syntax/Nodes.cpp
+++ b/clang/lib/Tooling/Syntax/Nodes.cpp
@@ -12,132 +12,10 @@ using namespace clang;
raw_ostream &syntax::operator<<(raw_ostream &OS, NodeKind K) {
switch (K) {
- case NodeKind::Leaf:
- return OS << "Leaf";
- case NodeKind::TranslationUnit:
- return OS << "TranslationUnit";
- case NodeKind::UnknownExpression:
- return OS << "UnknownExpression";
- case NodeKind::ParenExpression:
- return OS << "ParenExpression";
- case NodeKind::ThisExpression:
- return OS << "ThisExpression";
- case NodeKind::IntegerLiteralExpression:
- return OS << "IntegerLiteralExpression";
- case NodeKind::CharacterLiteralExpression:
- return OS << "CharacterLiteralExpression";
- case NodeKind::FloatingLiteralExpression:
- return OS << "FloatingLiteralExpression";
- case NodeKind::StringLiteralExpression:
- return OS << "StringLiteralExpression";
- case NodeKind::BoolLiteralExpression:
- return OS << "BoolLiteralExpression";
- case NodeKind::CxxNullPtrExpression:
- return OS << "CxxNullPtrExpression";
- case NodeKind::IntegerUserDefinedLiteralExpression:
- return OS << "IntegerUserDefinedLiteralExpression";
- case NodeKind::FloatUserDefinedLiteralExpression:
- return OS << "FloatUserDefinedLiteralExpression";
- case NodeKind::CharUserDefinedLiteralExpression:
- return OS << "CharUserDefinedLiteralExpression";
- case NodeKind::StringUserDefinedLiteralExpression:
- return OS << "StringUserDefinedLiteralExpression";
- case NodeKind::PrefixUnaryOperatorExpression:
- return OS << "PrefixUnaryOperatorExpression";
- case NodeKind::PostfixUnaryOperatorExpression:
- return OS << "PostfixUnaryOperatorExpression";
- case NodeKind::BinaryOperatorExpression:
- return OS << "BinaryOperatorExpression";
- case NodeKind::UnqualifiedId:
- return OS << "UnqualifiedId";
- case NodeKind::IdExpression:
- return OS << "IdExpression";
- case NodeKind::CallExpression:
- return OS << "CallExpression";
- case NodeKind::UnknownStatement:
- return OS << "UnknownStatement";
- case NodeKind::DeclarationStatement:
- return OS << "DeclarationStatement";
- case NodeKind::EmptyStatement:
- return OS << "EmptyStatement";
- case NodeKind::SwitchStatement:
- return OS << "SwitchStatement";
- case NodeKind::CaseStatement:
- return OS << "CaseStatement";
- case NodeKind::DefaultStatement:
- return OS << "DefaultStatement";
- case NodeKind::IfStatement:
- return OS << "IfStatement";
- case NodeKind::ForStatement:
- return OS << "ForStatement";
- case NodeKind::WhileStatement:
- return OS << "WhileStatement";
- case NodeKind::ContinueStatement:
- return OS << "ContinueStatement";
- case NodeKind::BreakStatement:
- return OS << "BreakStatement";
- case NodeKind::ReturnStatement:
- return OS << "ReturnStatement";
- case NodeKind::RangeBasedForStatement:
- return OS << "RangeBasedForStatement";
- case NodeKind::ExpressionStatement:
- return OS << "ExpressionStatement";
- case NodeKind::CompoundStatement:
- return OS << "CompoundStatement";
- case NodeKind::UnknownDeclaration:
- return OS << "UnknownDeclaration";
- case NodeKind::EmptyDeclaration:
- return OS << "EmptyDeclaration";
- case NodeKind::StaticAssertDeclaration:
- return OS << "StaticAssertDeclaration";
- case NodeKind::LinkageSpecificationDeclaration:
- return OS << "LinkageSpecificationDeclaration";
- case NodeKind::SimpleDeclaration:
- return OS << "SimpleDeclaration";
- case NodeKind::TemplateDeclaration:
- return OS << "TemplateDeclaration";
- case NodeKind::ExplicitTemplateInstantiation:
- return OS << "ExplicitTemplateInstantiation";
- case NodeKind::NamespaceDefinition:
- return OS << "NamespaceDefinition";
- case NodeKind::NamespaceAliasDefinition:
- return OS << "NamespaceAliasDefinition";
- case NodeKind::UsingNamespaceDirective:
- return OS << "UsingNamespaceDirective";
- case NodeKind::UsingDeclaration:
- return OS << "UsingDeclaration";
- case NodeKind::TypeAliasDeclaration:
- return OS << "TypeAliasDeclaration";
- case NodeKind::SimpleDeclarator:
- return OS << "SimpleDeclarator";
- case NodeKind::ParenDeclarator:
- return OS << "ParenDeclarator";
- case NodeKind::ArraySubscript:
- return OS << "ArraySubscript";
- case NodeKind::TrailingReturnType:
- return OS << "TrailingReturnType";
- case NodeKind::ParametersAndQualifiers:
- return OS << "ParametersAndQualifiers";
- case NodeKind::MemberPointer:
- return OS << "MemberPointer";
- case NodeKind::GlobalNameSpecifier:
- return OS << "GlobalNameSpecifier";
- case NodeKind::DecltypeNameSpecifier:
- return OS << "DecltypeNameSpecifier";
- case NodeKind::IdentifierNameSpecifier:
- return OS << "IdentifierNameSpecifier";
- case NodeKind::SimpleTemplateNameSpecifier:
- return OS << "SimpleTemplateNameSpecifier";
- case NodeKind::NestedNameSpecifier:
- return OS << "NestedNameSpecifier";
- case NodeKind::MemberExpression:
- return OS << "MemberExpression";
- case NodeKind::CallArguments:
- return OS << "CallArguments";
- case NodeKind::ParameterDeclarationList:
- return OS << "ParameterDeclarationList";
- case NodeKind::DeclaratorList:
- return OS << "DeclaratorList";
+#define CONCRETE_NODE(Kind, Parent) \
+ case NodeKind::Kind: \
+ return OS << #Kind;
+#include "clang/Tooling/Syntax/Nodes.inc"
}
llvm_unreachable("unknown node kind");
}
More information about the cfe-commits
mailing list