This is an archive of the discontinued LLVM Phabricator instance.

Add dump() member function to ArgList.
ClosedPublic

Authored by jlebar on Dec 17 2015, 4:47 PM.

Details

Reviewers
echristo

Diff Detail

Event Timeline

jlebar updated this revision to Diff 43197.Dec 17 2015, 4:47 PM
jlebar retitled this revision from to Add dump() member function to ArgList..
jlebar updated this object.
jlebar added a reviewer: echristo.
jlebar added a subscriber: llvm-commits.
echristo edited edge metadata.Dec 17 2015, 5:02 PM

Can you make this follow the model of print(raw_ostream) + dump() that uses print(OS) similar to the rest of the standard dumps? Also, llvm::dbgs() not llvm::errs() :)

Thanks!

-eric

Unfortunately not to both, I think. Arg doesn't have a print() I can call. And Arg::dump() writes to errs(), not dbgs().

If you think it's worthwhile I can try fixing Arg up to idiom in a separate patch. Not sure how much it matters, though.

We appear to be wonderfully consistent about this. In general, I prefer dbgs for this sort of thing.

dzur:~/sources/llvm> grep -r errs\(\) * | wc -l
1461
dzur:~/sources/llvm> grep -r dbgs\(\) * | wc -l
4449

Seems to say dbgs in a very macro sort of way :)

Can also put a print method on Arg if you'd like as a small separate thing?

I'm not too picky, though if you don't do it I'll probably do it for consistency with everything else.

Thanks!

-eric

echristo accepted this revision.Dec 17 2015, 5:57 PM
echristo edited edge metadata.

Since we've got the follow up patch this is also OK.

-eric

This revision is now accepted and ready to land.Dec 17 2015, 5:57 PM

Seems to say dbgs in a very macro sort of way :)

Can also put a print method on Arg if you'd like as a small separate thing?

Done in D15634.

Committed thusly:

dzur:~/sources/llvm> git svn dcommit
Committing to https://llvm.org/svn/llvm-project/llvm/trunk ...
M include/llvm/Option/ArgList.h
M lib/Option/ArgList.cpp
Committed r256009

jlebar closed this revision.Dec 20 2015, 8:58 PM