LLVM Create VarArg Function and access var args
<p>I have been trying to create a function using the module pass in LLVM. What I am trying to do is create a variable argument function and then add the logic to manipulate the variable arguments.
For example:</p>

<pre><code>/\*can do this\*/

int foo(int a, ...)
{

    double var1;
    //can't figure out how to add any of this using llvm

    va_list ap;     
    va_start(ap, a);
    va_arg(var1,double);
    va_end(ap);
}
</code></pre>

<p>Creating the function type is easy because I just set the vararg boolean to true. What do I do after that?</p>