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

Jay Foad jay.foad at gmail.com
Thu May 14 04:56:56 PDT 2009


2009/4/1 Chris Lattner <clattner at apple.com>:
> As far API design goes, we're in a mixed state.  I'd strongly prefer
> to get rid of std::vector from the various interfaces, f.e. creating a
> constant array currently requires passing in an std::vector.  For
> these sorts of interfaces, we should migrate to passing in a "Constant
> *const* / unsigned" pair.  This allows use with a C array, a
> SmallVector, std::vector, or any other container with sequential
> storage.

I've made a start on this for the constructors of StructType and
FunctionType. I've attached the patch so far, which is just enough to
build lib/VMCore/. Before I continue with it:

1. Is this still the way you want to go?
2. Do you care about breaking out-of-tree code that creates struct or
function types? I'm happy to convert cfe and llvm-gcc myself.
3. Are there any logistical problems with committing a wide-reaching
patch like this?
3. Any comments on the patch itself?

Thanks,
Jay.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.novector
Type: application/octet-stream
Size: 11187 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090514/1716a3d2/attachment.obj>


More information about the llvm-dev mailing list