This is an archive of the discontinued LLVM Phabricator instance.

[llvm-cov] Allow commas in filenames passed to `-object` flag
ClosedPublic

Authored by andrewjcg on Sep 1 2020, 10:55 PM.

Details

Summary

Currently, -object takes a comma separated list of objects as an
argument, which prevents it working with path names that contain a
comma. Drop comma-separated support, which requires to set pass the
-object flag multiple times to set multiple objects.

Diff Detail

Event Timeline

andrewjcg created this revision.Sep 1 2020, 10:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 1 2020, 10:55 PM
andrewjcg requested review of this revision.Sep 1 2020, 10:55 PM
vsk added a comment.Sep 2 2020, 2:18 PM

I don't think the intention was ever to require filename arguments to be comma separated (the expectation is that multiple -object arguments should be passed). This looks like a reasonable cleanup though.

It should be simple enough to add a test for this. There are a few examples of -object being passed multiple times in llvm/test/tools/llvm-cov; one of these can converted to test RUN: not llvm-cov ... -object=f1,f2 ... 2>&1 | FileCheck %s.

vsk accepted this revision.Sep 14 2020, 2:56 PM

Thanks, lgtm with a minor change.

llvm/test/tools/llvm-cov/comma,in,path.test
3 ↗(On Diff #291085)

It'd be nice to check for something more than exit code 0, e.g. using -dump-collected-paths.

This revision is now accepted and ready to land.Sep 14 2020, 2:56 PM

test for something more than exit code

As I don't have commit access, is there someone on this diff that can push this? Or is there some process for this?

andrewjcg retitled this revision from [llvm-cov] Allow commas in filenams passed to `-object` flag to [llvm-cov] Allow commas in filenames passed to `-object` flag.Sep 18 2020, 12:14 PM
This revision was automatically updated to reflect the committed changes.
vsk added a comment.Sep 18 2020, 1:46 PM

@andrewjcg I've committed this in 3c731ba5f1b. I found conflicting information online about whether Windows allows filenames with commas in them. To err on the safe side (and avoid potentially corrupting the git history for some llvm devs), I changed the test. Hope you don't mind -- if you prefer another way of doing it, let me know.

@vsk: Looks good, thanks!