llvm-project/clang/unittests
Sam McCall 6aca6032c5 [AST] Include the TranslationUnitDecl when traversing with TraversalScope
Given `int foo, bar;`, TraverseAST reveals this tree:
  TranslationUnitDecl
   - foo
   - bar

Before this patch, with the TraversalScope set to {foo}, TraverseAST yields:
  foo

After this patch it yields:
  TranslationUnitDecl
  - foo

Also, TraverseDecl(TranslationUnitDecl) now respects the traversal scope.

---

The main effect of this today is that clang-tidy checks that match the
translationUnitDecl(), either in order to traverse it or check
parentage, should work.

Differential Revision: https://reviews.llvm.org/D104071
2021-06-11 14:29:45 +02:00
..
AST [AST] Include the TranslationUnitDecl when traversing with TraversalScope 2021-06-11 14:29:45 +02:00
ASTMatchers [clang] p1099 using enum part 2 2021-06-08 11:11:46 -07:00
Analysis Bump googletest to 1.10.0 2021-05-14 19:16:31 +02:00
Basic [clang][cli] Generate and round-trip language options 2021-02-09 10:18:55 +01:00
CodeGen [clang-repl] Recommit "Land initial infrastructure for incremental parsing" 2021-05-13 06:30:29 +00:00
CrossTU [analyzer][CTU] API for CTU macro expansions 2021-02-22 11:12:22 +01:00
DirectoryWatcher [DirectoryWatcher] Increase timeout to make test less flaky 2021-03-05 17:49:14 -08:00
Driver [clang] accept -fsanitize-ignorelist= in addition to -fsanitize-blacklist= 2021-05-04 10:24:00 -04:00
Format clang-format: [JS] don't sort named imports if off. 2021-06-11 12:02:33 +02:00
Frontend Introduce SYCL 2020 mode 2021-05-18 10:34:14 -04:00
Index [index] Improve macro indexing support 2021-04-06 09:12:14 -07:00
Interpreter [clang-repl] Fix ClangReplInterpreterTests unittest dependency. 2021-05-13 10:32:08 +00:00
Introspection [AST] Fix DeclarationNameInfo introspection 2021-04-26 18:49:13 +01:00
Lex [clang][clangd] Use reverse header map lookup in suggestPathToFileForDiagnostics 2021-06-03 01:37:55 -07:00
Rename Bump googletest to 1.10.0 2021-05-14 19:16:31 +02:00
Rewrite [Rewrite][NFC] Add FIXMEs and tests for RemoveLineIfEmpty bug 2019-08-15 21:17:48 +00:00
Sema [clang][CodeComplete] Fix crash on ParenListExprs 2021-02-08 13:16:49 +01:00
Serialization Revert "[modules] Do not cache invalid state for modules that we attempted to load." 2020-03-10 10:59:26 -07:00
StaticAnalyzer [ADT] Remove APInt/APSInt toString() std::string variants 2021-06-11 13:19:15 +01:00
Tooling [AST] Include the TranslationUnitDecl when traversing with TraversalScope 2021-06-11 14:29:45 +02:00
libclang [libclang] Add CXRewriter to libclang API 2020-09-04 14:17:03 -07:00
CMakeLists.txt [clang-repl] Recommit "Land initial infrastructure for incremental parsing" 2021-05-13 06:30:29 +00:00