[cfe-dev] Getting an Allocaed block into an Expr

Reid Kleckner rnk at google.com
Thu Jun 18 08:47:20 PDT 2015


You should be able to use EmitCallArgs to get most of the CallArgList and
add your CallArg either at the beginning or end of the argument sequence,
depending on where you want it. This is how we do constructor calls, for
example. As long as your argument is a scalar and not an aggregate, this
will work just fine, it's like the way we handle the 'this' parameter
separately in EmitCXXConstructorCall.

On Thu, Jun 18, 2015 at 2:16 AM, Nat! <nat at mulle-kybernetik.com> wrote:

> Hi
>
> I have the following problem in creating a custom function call. I want to
> reuse CodeGenFunction::EmitCallArgs, since it seems to be solving some
> tricky issues with MS compilers.
>
> At the time I want to call `EmitCallArgs` I have all my arguments ready,
> except one, which I am allocaing on the fly like this:
>
> LValue   Record = MakeNaturalAlignAddrLValue( CreateMemTemp( RecTy,
> "_additional"), RecTy);
>
> So now I have an (LLVM) LValue  but EmitCallArgs expects an iterator of
> (CLANG) Expr *. So I would like to fake a temporary pointer expression to
> my allocaed record add it to my arguments and call EmitCallArgs. But I
> haven't found a place in clang, that creates a pointer expr to a LLVM
> LValue. Maybe it's impossible ?
>
> Thanks for any help in advance
>         Nat!
> ------------------------------------------------------
> Ignorance more frequently begets confidence than does
> knowledge  -- Darwin
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150618/acbf8190/attachment.html>


More information about the cfe-dev mailing list