[LLVMdev] function creation question

Joey Gouly joel.gouly at gmail.com
Tue Sep 10 14:09:37 PDT 2013


A vector type in LLVM can only have a single element type. You'll have to
return a struct type.
On 10 Sep 2013 21:19, "emily thomas" <emilythomas007 at gmail.com> wrote:

> I have an AST, and I walk it to generate llvm-IR. For function
> definitions, I need to be able to generate functions :
> vector<datatypes> foo (param_list)
> i.e. my return value is a vector of different datatype.s, similar to the
> param list.
> My question is, what do i put my elelment type in the vector? It can be a
> vector of any of the element types.. i.e. the first value can be a float,
> the second char* etc..
>
> VectorType* vt = VectorType::get(..)
>  FunctionType* ft = FunctionType::get (vt,..)
> Function *f = Function::Create (..)
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130910/c72c9f64/attachment.html>


More information about the llvm-dev mailing list