[LLVMdev] Plans considering first class structs and multiple return values

Matthijs Kooijman - Inter-Actief matthijs.kooijman at inter-actief.net
Thu Jul 3 00:37:39 PDT 2008


Hi Marc,

there a few examples of this in the code, have look at BuildSubAggregate in
lib/Analysis/ValueTracking.cpp for example (there's quite some code around it
and it's recursive, which doesn't make this the best example, but it should
help).

The interesting parts look something like this:

Value *Undef = UndefValue::get(IndexedType);
Value *T0 = lvm::InsertValueInst::Create(To, V, Idxs.begin(),
																				 Idxs.end(), "tmp", InsertBefore);
Value *T1 = lvm::InsertValueInst::Create(To, V, Idxs2.begin(),
																				 Idxs2.end(), "tmp", InsertBefore);

Gr.

Matthijs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080703/5895260d/attachment.sig>


More information about the llvm-dev mailing list