Bitcast requires both operands to be pointer or neither

I can build or analyze my project with no warnings, and it runs correctly in simulator and on the actual device. When I do an Archive build though, it fails. If I manually run the full swiftc command shown in the log, I get this output, which isn't helping me any:


{

"kind": "finished",

"name": "compile",

"pid": 6509,

"output": "Bitcast requires both operands to be pointer or neither\n %805 = bitcast i8* %804 to %VSs20UnsafeMutablePointer, !dbg !36482\nPHI node operands are not the same type as the result!\n %864 = phi i8* [ %805, %842 ], [ %876, %892 ], !dbg !36519\nBitcast requires both operands to be pointer or neither\n %921 = bitcast %VSs20UnsafeMutablePointer %805 to <{ %SS, %VSs5Int32 }>*, !dbg !36519\nLLVM ERROR: Broken function found, compilation aborted!\n",

"exit-status": 1

}


Nothing in that output tells me *where* it's having this issue. How in the world do I figure out what it is having an issue with? I don't do any UnsafeMutablePointer stuff myself.

Replies

Might be an llvm bitcode bug. Try disabling bitcode for now, and if that works, file a bug.

Do you have a fix yet as I am getting the same error on my project?



How do you disable bitcode

Set code optimizations to none to get ride of the error