<div class="gmail_quote">On Fri, Feb 4, 2011 at 2:12 PM, Frits van Bommel <span dir="ltr"><<a href="mailto:fvbommel@gmail.com">fvbommel@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

If you remove all the 'static's from the member functions, it'd work<br>
more like IRBuilder.<br>
It would also allow you to take the LLVMContext& as a constructor<br>
parameter, so that methods like this:<br>
<div class="im"><br>
On Fri, Feb 4, 2011 at 6:57 PM, Talin <<a href="mailto:viridia@gmail.com">viridia@gmail.com</a>> wrote:<br>
>   /// GetStruct - return a constant struct given a context and a vector<br>
>   /// of elements.<br>
>   static Constant *GetStruct(<br>
>     LLVMContext &Context,<br>
>     const std::vector<Constant*> &V,<br>
>     bool Packed = false) {<br>
>     return ConstantStruct::get(Context, V, Packed);<br>
>   }<br>
<br>
</div>can remove it from their parameter list. It's probably pretty unlikely<br>
a given ConstantBuilder instance would be used with multiple<br>
LLVMContexts.<br>
<br>
Making this a class you need an instance of would likely also allow<br>
typing to be reduced a bit because said instance can be given a<br>
shorter name than 'ConstantBuilder'. For example: 'cb.GetStruct(...)'<br>
instead of 'ConstantBuilder::GetStruct(MyContext, ...)'.<br>
</blockquote></div><br>Actually, my main question is whether there is even interest in this - I'm happy to write all the docs and unit tests, but only if this is something that people want. I know that it makes my life a lot easier to be able to create constant structs and arrays like this, but I can do that just as easily in my own project.<div>

<br><div><div>-- <br>-- Talin<br>
</div></div></div>