This is an archive of the discontinued LLVM Phabricator instance.

[clang-diff] Add commandline arguments.
ClosedPublic

Authored by johannes on Aug 1 2017, 1:50 PM.

Details

Summary

Support command line options for build path and extra arguments
This emulates the options accepted by clang tools that use CommonOptionsParser.

Add a flag to stop after top down matching.

Add a flag for controlling the maximum size parameter for bottom up matching.

Event Timeline

johannes created this revision.Aug 1 2017, 1:50 PM
arphaman edited edge metadata.Aug 2 2017, 4:28 AM

There should be a test that ensures that stop-after works and extra-args are correctly passed to the compiler.

johannes updated this revision to Diff 109415.Aug 2 2017, 1:33 PM

add some test, replace -no-compilation-database with --

There should be a test that ensures that stop-after works and extra-args are correctly passed to the compiler.

stop-after is not tested yet. It is also broken in this patch, I will move it to a later patch, then it is easier to test.

arphaman added inline comments.Aug 3 2017, 1:22 AM
test/Tooling/clang-diff-args.sh
1

I think a '.test' extension rather than '.sh' is better

3

You can just have a CHECK in this file and run FileCheck %s

johannes updated this revision to Diff 109502.Aug 3 2017, 2:40 AM

fix tests

arphaman accepted this revision.Aug 3 2017, 3:02 AM

I think you have to test the -p option too (check the compilation database can be loaded and arguments are propagated to the parser), otherwise LGTM!

This revision is now accepted and ready to land.Aug 3 2017, 3:02 AM
This revision was automatically updated to reflect the committed changes.