[LLVMdev] Documentation of bitcasts in calls

Thomas Ströder stroeder at informatik.rwth-aachen.de
Mon Jul 13 04:46:41 PDT 2015


Dear all,

I just stumbled over the following instruction in the LLVM IR of a C
program compiled with clang:

%26 = call i32 (...)* bitcast (i32 (i32, i32, i32, i32, i32)*
@KeWaitForSingleObject to i32 (...)*)(i32 %23, i32 %24, i32 %25, i32 0,
i32 0)

Since our LLVM Parser choked on this instruction, I tried to check the
documentation, but did not find anything about such nested bitcasts
within calls. What is the exact syntax and semantics (while I can guess
the latter, especially the former is interesting for me when building a
parser for LLVM IR) for such instructions and/or where is this
documented? In particular, the parantheses around the arguments of the
bitcast are confusing me.

Alternatively, is there a way to tell clang not to inline such bitcasts,
but have them in a separate instruction before and use the result in the
call?

Best regards,

  Thomas


-- 
Thomas Ströder        mailto:stroeder at informatik.rwth-aachen.de
LuFG Informatik 2     http://verify.rwth-aachen.de/stroeder
RWTH Aachen           phone: +49 241 80-21241

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150713/df4526c6/attachment.sig>


More information about the llvm-dev mailing list