From db8fac140ea522bfd5153adb407c60f605f3277b Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 11 Jan 2019 19:16:01 +0000 Subject: [PATCH] Implement Attr dumping in terms of visitors Remove now-vestigial dumpType and dumpBareDeclRef methods. The old tablegen generated code used to expect them to be present, but the new generated code has no such requirement. Reviewers: aaron.ballman Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D55492 llvm-svn: 350958 --- clang/include/clang/AST/AttrVisitor.h | 76 +++++++++++++++++++++++++++ clang/include/clang/AST/CMakeLists.txt | 9 +++- clang/include/clang/AST/TextNodeDumper.h | 9 +++- clang/lib/AST/ASTDumper.cpp | 27 +++------- clang/lib/AST/TextNodeDumper.cpp | 23 ++++++++ clang/utils/TableGen/ClangAttrEmitter.cpp | 87 ++++++++++++++++++++----------- clang/utils/TableGen/TableGen.cpp | 16 ++++-- clang/utils/TableGen/TableGenBackends.h | 5 +- 8 files changed, 195 insertions(+), 57 deletions(-) create mode 100644 clang/include/clang/AST/AttrVisitor.h diff --git a/clang/include/clang/AST/AttrVisitor.h b/clang/include/clang/AST/AttrVisitor.h new file mode 100644 index 0000000..867f9e7 --- /dev/null +++ b/clang/include/clang/AST/AttrVisitor.h @@ -0,0 +1,76 @@ +//===- AttrVisitor.h - Visitor for Attr subclasses --------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines the AttrVisitor interface. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_AST_ATTRVISITOR_H +#define LLVM_CLANG_AST_ATTRVISITOR_H + +#include "clang/AST/Attr.h" + +namespace clang { + +namespace attrvisitor { + +/// A simple visitor class that helps create attribute visitors. +template