[cfe-dev] Proposal: A "Const tool" for clang

Sean Silva silvas at purdue.edu
Tue Feb 5 12:12:40 PST 2013

I guess my point was not that such a tool hasn't been made (I was
aware of the chromium code search, DXR, and woboq code browser
mentioned in this thread and thought about them when writing that
response), but that it would have to be implemented essentially from
scratch, whereas the proposal seems to talk about "find all calls" as
a primitive operation that is taken for granted, and the complexity of
which isn't mentioned in the proposal.

Also, the "interactive" aspect, e.g. "if the user says: Make the
second parameter to function1 const" really suggests integration into,
say, an editor (something like how clang-format can be called from
vim), and AFAIK Chromium Code Search, DXR, and woboq all treat the
source code as a static object not subject to modification, and are
not prepared for interactive, incremental modification.

I'm not trying to say that Marshall's tool isn't a good idea (I think
it's a great idea!), but I think that the development of a tool with
its aims is quite an endeavor and that Marshall should consider
breaking it up into reusable pieces (preferably integrated into e.g.
Tooling). For example, some way to effectively reason and search
across translation units (which is a basic presupposition of the tool
in Marshall's proposal) would be useful to a large number of other
tools; one example is the Static Analyzer, which could use this
functionality to do cross-TU analyses.

Having said that: Marshall, I would really like to see the proposal
beefed up to delineate the current infrastructure that this tool will
be built on, and what infrastructure will need to be developed to
enable the creation of the tool.

-- Sean Silva

More information about the cfe-dev mailing list