[LLVMdev] Incompatible types at call site

Frits van Bommel fvbommel at gmail.com
Tue Apr 5 00:47:40 PDT 2011

On Tue, Apr 5, 2011 at 2:35 AM, Arushi Aggarwal <arushi987 at gmail.com> wrote:
> For a call like this,
> %tmp6 = call i32 (...)* bitcast (i32 (i8*, i8, i8**)* @ssplit to i32
> (...)*)(i8* %tmp599, i32 46, i8** %domainv3) nounwind ; <i32>
> does the 2nd argument get zero extended or sign extended?

Since you're passing an i32 to a function expecting an i8 I'd actually
expect it to get truncated.

However, other outcomes are possible. For example, on 16-bit
machines[1], this might actually cause the parameters to fail to line
up, so while the second parameter would likely be either 0 or 46
there's no telling what the *third* parameter would wind up being.
(I'm not sure if LLVM actually supports any such machines though)

[1]: In this case meaning machines where a C 'int' is 16 bits, since
this depends on the C calling convention for the machine in question.

More information about the llvm-dev mailing list