[cfe-commits] [PATCH] Analysis/Support/BumpVector.h insert method.

Ted Kremenek kremenek at apple.com
Mon Sep 13 15:29:16 PDT 2010


Makes sense.

Applied:

http://llvm.org/viewvc/llvm-project?view=rev&revision=113799

On Sep 13, 2010, at 2:38 PM, Marcin Świderski wrote:

> W dniu 13 września 2010 23:17 użytkownik Ted Kremenek <kremenek at apple.com> napisał:
> Hi Marcin,
> 
> If you think you will need to be using insert(), I'm dubious that a vector is the right data structure.  Doing inserts repeatedly might wreck havoc on CFG construction time.  What do you think?
> 
> On Sep 13, 2010, at 12:51 PM, Marcin Świderski wrote:
> 
> > Hi
> >
> > This is an implementation of insert method for BumpVector that is needed in my work on CFG.
> >
> > Cheers,
> > Marcin
> > <bump-vector-insert.patch>
> 
> I use insert for adding CFGElements for implicit destructors. The procedure is as follows:
>  - count objects for destruction (time linear w.r.t. depth of local scopes),
>  - make room for those objects with batch insert of empty CFGElements,
>  - set proper values of destructors for inserted CFGElements.
> 
> This will cause data moving inside the vector only while back patching for goto statements. In other cases this will only append data at the end of vector, and can be optimized if will cause too much overhead. Currently I would prefere to leave it this way.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20100913/809a322d/attachment.html>


More information about the cfe-commits mailing list