[LLVMdev] Troubling promotion of return value to Integer ...

Alireza.Moshtaghi at microchip.com Alireza.Moshtaghi at microchip.com
Sun May 18 18:33:29 PDT 2008


But they both follow the same calling convention. There are two
possibilities in the caller:

1) Call node returns sizeof(int) or larger: in this case there is no
truncation.

2) Call node returns smaller than sizeof(int): in this case callee
always has to return an int so it has to consistently either sign extend
or zero extend because int is either signed or unsigned consistently for
that port. Assuming that caller and callee follow the same calling
convention, caller always knows (hence the llvm pass knows) that, if the
return value of the called function is being truncated, it is because of
return value promotion. It also knows the calling convention, so it
knows whether it is sign or zero extended. This is regardless of
translation unit where the callee is in.

 

>No, because the callee and caller may be in different translation
units.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080518/010a51ba/attachment.html>


More information about the llvm-dev mailing list