[cfe-commits] [PATCH] PR9214: convert InvokeInst API to use ArrayRef

Jay Foad jay.foad at gmail.com
Thu Apr 14 04:13:53 PDT 2011

See http://llvm.org/bugs/show_bug.cgi?id=9214

The bugs says:

> Various LLVM APIs (such as the Constant*::get APIs, the
> GetElementPtrInst::Create methods, IRBuilder CreateGEP method, etc) that take
> multiple input values take std::vectors, and some now also can take a pointer
> to the start of an array and a count (for use with SmallVector).  The new
> ArrayRef class subsumes both of these uses and is more convenient to use.

I had a look at the "IRBuilder CreateGEP method", and noticed that
there are several Instructions that could take ArrayRefs where they
currently take a pair of RandomAccessIterators, both in their own
constructors and Create() methods, and in the corresponding IRBuilder
API to create them. The Instructions in question are:


This patch just converts InvokeInst, because I thought it would be the
easiest one to start with.

I'm concerned about the amount of churn it causes. It touches more or
less every place that creates an InvokeInst. I expect there to be way
more churn with more common Instructions like CallInst and
GetElementPtrInst. Do we really want to cause this pain for all
clients of the LLVM APIs?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: arrayref-invokeinst
Type: application/octet-stream
Size: 20146 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110414/dfd215b9/attachment.obj>

More information about the cfe-commits mailing list