[LLVMdev] Problem selecting the correct registers for a calling convention

Borja Ferrer borja.ferav at gmail.com
Tue Jul 2 05:15:18 PDT 2013


Hello Job,

I managed to resolve this same problem by using custom C++ code since as
you mentioned
the isSplit flag doesn't help here. There are 2 ways to analyze the
arguments of a function:

1) You can get a Function pointer in LowerFormalArguments, and in LowerCall
only when Callee can by dyn_casted to a GlobalAddressSDNode. By having this
pointer you can then do:

for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end();I !=
E; ++I)

  {
    unsigned Bytes = TD->getTypeSizeInBits(I->getType()) / 8;
    // do stuff here
  }


2) The second case is when the dyn_cast above fails because the Callee
SDValue is a

ExternalSymbolSDNode. In this case you have to manually analyze the
arguments using PartOffset.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130702/719fc65c/attachment.html>


More information about the llvm-dev mailing list