forked from OSchip/llvm-project
7fc8f415ea
Summary: SelectionTree is a RecursiveASTVisitor which processes getSourceRange() for every node. This is a lot of surface area with the AST, as getSourceRange() is specialized for *many* node types. And the resulting SelectionTree depends on the source ranges of many visited nodes, and the order of traversal. Put together, this means we really need a traversal log to debug when we get an unexpected SelectionTree. I've built this ad-hoc a few times, now it's time to check it in. Example output: ``` D[14:07:44.184] Computing selection for </usr/local/google/home/sammccall/test.cc:1:7, col:8> D[14:07:44.184] push: VarDecl const auto x = 42 D[14:07:44.184] claimRange: </usr/local/google/home/sammccall/test.cc:1:12, col:13> D[14:07:44.184] push: NestedNameSpecifierLoc (empty NestedNameSpecifierLoc) D[14:07:44.184] pop: NestedNameSpecifierLoc (empty NestedNameSpecifierLoc) D[14:07:44.184] push: QualifiedTypeLoc const auto D[14:07:44.184] pop: QualifiedTypeLoc const auto D[14:07:44.184] claimRange: </usr/local/google/home/sammccall/test.cc:1:7, col:11> D[14:07:44.184] hit selection: </usr/local/google/home/sammccall/test.cc:1:7, col:8> D[14:07:44.184] skip: IntegerLiteral 42 D[14:07:44.184] skipped range = </usr/local/google/home/sammccall/test.cc:1:16> D[14:07:44.184] pop: VarDecl const auto x = 42 D[14:07:44.184] claimRange: </usr/local/google/home/sammccall/test.cc:1:1, col:18> D[14:07:44.184] skip: VarDecl int y = 43 D[14:07:44.184] skipped range = </usr/local/google/home/sammccall/test.cc:2:1, col:9> D[14:07:44.184] Built selection tree TranslationUnitDecl VarDecl const auto x = 42 .QualifiedTypeLoc const auto ``` Reviewers: hokein Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65073 llvm-svn: 366698 |
||
---|---|---|
.. | ||
clang-apply-replacements | ||
clang-change-namespace | ||
clang-doc | ||
clang-include-fixer | ||
clang-move | ||
clang-query | ||
clang-reorder-fields | ||
clang-tidy | ||
clang-tidy-vs | ||
clangd | ||
docs | ||
modularize | ||
pp-trace | ||
test | ||
tool-template | ||
unittests | ||
.arcconfig | ||
.gitignore | ||
CMakeLists.txt | ||
CODE_OWNERS.TXT | ||
LICENSE.TXT | ||
README.txt |
README.txt
//===----------------------------------------------------------------------===// // Clang Tools repository //===----------------------------------------------------------------------===// Welcome to the repository of extra Clang Tools. This repository holds tools that are developed as part of the LLVM compiler infrastructure project and the Clang frontend. These tools are kept in a separate "extra" repository to allow lighter weight checkouts of the core Clang codebase. This repository is only intended to be checked out inside of a full LLVM+Clang tree, and in the 'tools/extra' subdirectory of the Clang checkout. All discussion regarding Clang, Clang-based tools, and code in this repository should be held using the standard Clang mailing lists: http://lists.llvm.org/mailman/listinfo/cfe-dev Code review for this tree should take place on the standard Clang patch and commit lists: http://lists.llvm.org/mailman/listinfo/cfe-commits If you find a bug in these tools, please file it in the LLVM bug tracker: http://llvm.org/bugs/