[PATCH] Add reference counting support to SourceMgr

David Blaikie dblaikie at gmail.com
Tue Jun 24 22:39:30 PDT 2014


Not sure where is best to have the discussion, but I'd like to
understand why this refcounting needs to be /intrusive/. It always
seems like a wart if code is taking ownership without documenting that
contract through the type system (and this is case where intrusive
reference counting is required/used - a raw pointer is passed around
and some subsystem takes ownership of that, while sharing it with some
other, unknown, owner).

- David

On Tue, Jun 24, 2014 at 10:27 PM, Alp Toker <alp at nuanti.com> wrote:
> The attached patch switches SourceMgr to use reference counting internally
> by making MemoryBuffer optionally refcounted.
>
> With this change it becomes possible to share ownership of memory buffers
> between multiple source managers in the backend and frontend instead of
> copying file contents into memory or re-reading from disk repeatedly.
>
> These are supporting changes for clang with no functional change on the LLVM
> side.
>
> See thread "[PATCH] Don't duplicate entire file contents in memory" posted
> to cfe-commits for details.
>
> Alp.
>
> --
> http://www.nuanti.com
> the browser experts
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



More information about the llvm-commits mailing list