[LLVMdev] Removing std::vector from APIs (was Re: Mutating the elements of a ConstantArray)

David Greene dag at cray.com
Fri May 15 07:26:07 PDT 2009


On Friday 15 May 2009 05:50, Jay Foad wrote:
> > 3. Any comments on the patch itself?
> >
> > The one major thing to be aware of is that it isn't safe to use &V[0]
> > when V is an empty std::vector
>
> Oh dear. That's a bit of a flaw in the plan. I suppose the solution is
> to switch to SmallVector whenever this might be a problem.

Or use iterators.  That's why they're there.

> For now I'm testing with ENABLE_EXPENSIVE_CHECKS=1, and it is indeed
> catching lots of errors!

Mm hmm.  :)

                              -Dave



More information about the llvm-dev mailing list