[llvm-dev] changes in i1 xor

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Mon Mar 7 10:24:33 PST 2016


Hi Carlo,

On 7 March 2016 at 10:14, Carlo Kok via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
>   call void (%._Foundation.NSString*, ...) @NSLog(%NSString* bitcast (%NSConstantString* @_unnamed_cfstring_1 to %NSString*), i1 %6)

I think this is incorrect. Per C rules, types smaller than int get
promoted to int for varargs calls. So the standard library will be
expecting an i32 here (which you can obtain by either sign or zero
extension depending on preference).

I also wouldn't necessarily want to rely on being able to pass an i1
even if you control both the caller and callee, it's likely fairly
untested territory at best.

Cheers.

Tim.


More information about the llvm-dev mailing list