[LLVMdev] Lowering formal pointer arguments

Patrik Hägglund H patrik.h.hagglund at ericsson.com
Mon Mar 19 01:00:55 PDT 2012


Here is a quick-and-dirty fix, done on top of trunk from Jan 25. It just adds FTy as an extra parameter. Inside LowerCall:

  ... FTy->getReturnType();

  for (FunctionType::param_iterator i = FTy->param_begin(),
         e = FTy->param_end(); i != e; ++i) {
    Type *T = *i;
    ...

However, using NULL as default value probably breaks some code, which needs to be fixed (before submitting upstream). Also, for example, the isVarArg parameter should probably be removed.

/Patrik Hägglund  

-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Christoph Erhardt
Sent: den 16 mars 2012 15:39
To: llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] Lowering formal pointer arguments

Hi Patrik,

> DAG.getMachineFunction().getFunction() only works in LowerFormalArguments (there it returns the callee), not in LowerCall (where it returns the caller, rather than the callee). You need to pass more information about the function type to LowerCall (besides partial information such as the isVarArg parameter).
> 
> I can provide a patch if you are interested. (Unfortunately, to push this upstream has been on my to-do-list for while).
please do! I have been facing the same problem and am very interested in
a clean solution for this.

Best regards,
Christoph
_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lowercall_fty.diff
Type: application/octet-stream
Size: 18766 bytes
Desc: lowercall_fty.diff
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120319/9301afd0/attachment.obj>


More information about the llvm-dev mailing list