[LLVMdev] Different signatures or smart casting?

Nick Lewycky nicholas at mxc.ca
Fri Apr 10 11:05:01 PDT 2015


Ksenia Dolgorukova wrote:
> Hello!
> I linked two bitcode files like described below using LTO and find
> they are linked fine instead of making an error.
> ----------
> 1.bc
> ----------
> ...
> define i32 @main(i32 %argc, i8** %argv) #0 {
> entry:
> ...
> %call = call i32 @_Z1aj(i64 2)
> ...
> }
> declare i32 @_Z1aj(i64) #1
> ...
>
> ----------
> 2.bc
> ----------
> ...
> define i32 @_Z1aj(i32 %b) #0 {
> entry:
> ...
> }
> ...
>
> ----------
>
> In the first file function "_Z1aj" is declared as having i64 argument,
> whereas in the second file the function "_Z1aj" is described as having
> i32 argument!
>
> Are function signatures different?

They're both 'a(unsigned int)', but perhaps you compiled one of them 
targeting a 32-bit platform and the other targeting a 64-bit platform? 
What triple is at the top of each .bc file?

> How does LLVM cast them?
> Could it be a bug?
>




More information about the llvm-dev mailing list