Page MenuHomePhabricator

[clang] Fix JSON AST output when a filter is used
Needs ReviewPublic

Authored by woodruffw on Aug 19 2021, 8:15 PM.

Details

Reviewers
klimek
rsmith
Summary

Without this, the combination of -ast-dump=json and -ast-dump-filter FILTER produces invalid JSON: the first line is a string that says Dumping $SOME_DECL_NAME: .

Diff Detail

Unit TestsFailed

TimeTest
350 msx64 windows > Clang Tools.clang-tidy/checkers::readability-container-data-pointer.cpp
Script: -- : 'RUN: at line 1'; C:/Python39/python.exe C:/ws/w6/llvm-project/premerge-checks/clang-tools-extra/test/../test\clang-tidy\check_clang_tidy.py C:\ws\w6\llvm-project\premerge-checks\clang-tools-extra\test\clang-tidy\checkers\readability-container-data-pointer.cpp readability-container-data-pointer C:\ws\w6\llvm-project\premerge-checks\build\tools\clang\tools\extra\test\clang-tidy\checkers\Output\readability-container-data-pointer.cpp.tmp

Event Timeline

woodruffw requested review of this revision.Aug 19 2021, 8:15 PM
woodruffw created this revision.
woodruffw updated this revision to Diff 367938.Aug 20 2021, 8:08 PM

Updated the AST dump tests for JSON to refute the presence of the Dumping prefix.

Also, updated the gen_ast_dump_json_test.py generator to work with Python 3 and to behave better without the presence of the Dumping: sentinels.

Gentle ping for review on this!

Another gentle ping for review.

woodruffw updated this revision to Diff 372595.Tue, Sep 14, 5:15 PM

Increase the context for the patch.