[PATCH] clarify ownership of BugReport objects

Aaron Ballman aaron at aaronballman.com
Mon Jun 22 08:07:48 PDT 2015


Currently, when the analyzer wants to emit a report, it takes a naked
pointer, and the emitReport function eventually takes over ownership
of that pointer. I think this is a dangerous API because it's not
particularly clear that this ownership transfer will happen, or that
the pointer must be unique.

This patch makes the ownership semantics more clear by encoding it as
part of the API. There should be no functional changes, and I do not
think it caught any bugs, but I do think this is an improvement.

Thoughts or opinions?

~Aaron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unique.patch
Type: application/octet-stream
Size: 55201 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150622/fe6608b8/attachment.obj>


More information about the cfe-commits mailing list