简体   繁体   English

LLVM错误:找到损坏的函数,编译中止

[英]LLVM ERROR: Broken function found, compilation aborted

Here are couple of simple lines in swift: 以下是swift中的几行简单:

let umAB: Unmanaged<ABAddressBookRef> = ABAddressBookCreate()
let ab: ABAddressBookRef = umAB.takeRetainedValue()

The second line breaks code compilation, here's the error that I get: 第二行打破了代码编译,这是我得到的错误:

Bitcast requires both operands to be pointer or neither
%27 = bitcast %objc_object* %26 to %PSs9AnyObject_, !dbg !170
LLVM ERROR: Broken function found, compilation aborted!
Command /Applications/Xcode6-Beta2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift failed with exit code 1

Any ideas what's wrong with the second line? 任何想法第二行有什么问题?

This is late, but the answer is simple: This is a bug in the compiler. 这已经很晚了,但答案很简单: 这是编译器中的一个错误。 LLVM ERROR implies that bad LLVM IR has been generated, and that is a bug in the calling program. LLVM ERROR意味着已生成错误的LLVM IR,这是调用程序中的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM