[clang] [lldb] [clang] Add -ast-dump-filter-path to filter AST dump by file path (PR #194266)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 2 17:54:30 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,c,h -- clang/test/AST/ast-dump-filter-path-include.c clang/test/AST/ast-dump-filter-path.c clang/test/AST/filter-header.h clang/include/clang/Frontend/ASTConsumers.h clang/include/clang/Frontend/FrontendOptions.h clang/lib/Frontend/ASTConsumers.cpp clang/lib/Frontend/FrontendActions.cpp clang/tools/clang-check/ClangCheck.cpp clang/tools/clang-import-test/clang-import-test.cpp lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Frontend/ASTConsumers.cpp b/clang/lib/Frontend/ASTConsumers.cpp
index cf01056f8..1b170d73f 100644
--- a/clang/lib/Frontend/ASTConsumers.cpp
+++ b/clang/lib/Frontend/ASTConsumers.cpp
@@ -21,8 +21,8 @@
#include "clang/Basic/SourceManager.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/GlobPattern.h"
-#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/Timer.h"
+#include "llvm/Support/raw_ostream.h"
using namespace clang;
//===----------------------------------------------------------------------===//
@@ -209,22 +209,23 @@ clang::CreateASTPrinter(std::unique_ptr<raw_ostream> Out,
std::unique_ptr<ASTConsumer>
clang::CreateASTDumper(std::unique_ptr<raw_ostream> Out, StringRef FilterString,
- StringRef FilterPath, bool DumpDecls,
- bool Deserialize, bool DumpLookups,
- bool DumpDeclTypes, ASTDumpOutputFormat Format) {
+ StringRef FilterPath, bool DumpDecls, bool Deserialize,
+ bool DumpLookups, bool DumpDeclTypes,
+ ASTDumpOutputFormat Format) {
assert((DumpDecls || Deserialize || DumpLookups) && "nothing to dump");
- return std::make_unique<ASTPrinter>(
- std::move(Out),
- Deserialize ? ASTPrinter::DumpFull
- : DumpDecls ? ASTPrinter::Dump : ASTPrinter::None,
- Format, FilterString, FilterPath, DumpLookups, DumpDeclTypes);
+ return std::make_unique<ASTPrinter>(std::move(Out),
+ Deserialize ? ASTPrinter::DumpFull
+ : DumpDecls ? ASTPrinter::Dump
+ : ASTPrinter::None,
+ Format, FilterString, FilterPath,
+ DumpLookups, DumpDeclTypes);
}
std::unique_ptr<ASTConsumer>
clang::CreateASTDumper(raw_ostream &Out, StringRef FilterString,
- StringRef FilterPath, bool DumpDecls,
- bool Deserialize, bool DumpLookups,
- bool DumpDeclTypes, ASTDumpOutputFormat Format) {
+ StringRef FilterPath, bool DumpDecls, bool Deserialize,
+ bool DumpLookups, bool DumpDeclTypes,
+ ASTDumpOutputFormat Format) {
assert((DumpDecls || Deserialize || DumpLookups) && "nothing to dump");
return std::make_unique<ASTPrinter>(Out,
Deserialize ? ASTPrinter::DumpFull
``````````
</details>
https://github.com/llvm/llvm-project/pull/194266
More information about the cfe-commits
mailing list