This is an archive of the discontinued LLVM Phabricator instance.

[CaptureTracking] Replace hardcoded constant to option. NFC.
ClosedPublic

Authored by skatkov on Apr 22 2020, 3:33 AM.

Details

Summary

The motivation is to be able to play with the option and change if it is required.

Diff Detail

Event Timeline

skatkov created this revision.Apr 22 2020, 3:33 AM
fedor.sergeev added inline comments.Apr 22 2020, 3:54 AM
llvm/include/llvm/Analysis/CaptureTracking.h
56–57

Flipping the order of two integer parameters is somewhat risky interface change, since it does not lead to errors or even warnings at old call-sites that pass values according to the old interface.

98

If you introduce this accessor function anyway, why dont you just specify it in all the default parameters.
Adding multiple overloads which just fill the default parameter looks too chatty.

skatkov updated this revision to Diff 259236.Apr 22 2020, 4:27 AM

Handled Fedor's comments. Thank you for review.

Look good to me, but I would like to hear other opinions...

llvm/lib/Analysis/CaptureTracking.cpp
32

I'm not sure if '-ct' is enough for people to figure out what it means.
I would mildly prefer -capture-tracking here....

skatkov updated this revision to Diff 259258.Apr 22 2020, 6:09 AM
sstefan1 resigned from this revision.Apr 22 2020, 6:32 AM

One nit, otherwise this seems fine to me

llvm/include/llvm/Analysis/CaptureTracking.h
24–27

Documentation please.

skatkov marked an inline comment as done.Apr 22 2020, 9:10 AM
skatkov added inline comments.
llvm/include/llvm/Analysis/CaptureTracking.h
24–27

It is in cpp file. Would you like me to move it in hpp?

skatkov updated this revision to Diff 259316.Apr 22 2020, 9:13 AM

@fedor.sergeev Feel free to accept this w/o waiting for me

llvm/include/llvm/Analysis/CaptureTracking.h
24–27

Now it looks almost fine. public functions should have documentation in the header.
Please reword it as it is a function and not a constant now. The stuff about "small"
can be removed or moved to the command line option.

skatkov updated this revision to Diff 259449.Apr 22 2020, 7:02 PM
fedor.sergeev accepted this revision.Apr 23 2020, 3:53 AM

LGTM, thanks for cleaning this up!

This revision is now accepted and ready to land.Apr 23 2020, 3:53 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 23 2020, 4:49 AM