[cfe-dev] Tooling: how to deal with headers?

Manuel Klimek klimek at google.com
Mon Jan 14 11:41:22 PST 2013


On Mon, Jan 14, 2013 at 8:37 PM, Sean Silva <silvas at purdue.edu> wrote:

> On Mon, Jan 14, 2013 at 5:12 AM, Manuel Klimek <klimek at google.com> wrote:
> > If you use the RefactoringTool, adding Replacement's will
> auto-deduplicate.
>
> Ah cool.
>
> On Mon, Jan 14, 2013 at 5:12 AM, Manuel Klimek <klimek at google.com> wrote:
> > Use RefactoringTool and make all your replacements in a single tool-run.
> It
> > will apply all changes in the very end.
>
> For some reason, I was thinking a separate process being run for each
> TU, and since I wasn't aware of any kind of centralized
> serialization/DB logic for the edits which would then be able to
> deduplicate, but I guess they are all just in the same process and are
> stored in memory. Is peak resident memory O(#replacements) then? What
> kind of memory usage for replacements have you seen in practice?
>

For llvm-sized projects I think that's not going to be a problem (or you
have very old hardware :P)
For Google-sized projects (> 100MLOC) you'll want to serialize the
replacements in some form (perhaps from a MapReduce or similar :),
deduplicate them, and finally load and apply them. We're currently using
protocol buffers internally for those formats, so until a dependency to
protocol buffers is fine we'll not put that into the main repo.

Cheers,
/Manuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130114/2096a02c/attachment.html>


More information about the cfe-dev mailing list