Thanks for the helpful suggestions. I have not yet submitted an official bug report, however I just tried several of the downloadable toolchains, and it seems to no longer occur with the 5.2 one as well as the latest development snapshot.
It is however still happening with the Swift 5.1 toolchain and it gives a little more information then (assertion failure).
Assertion failed: (isReg() && "This is not a register operand!"), function getReg, file /Users/buildnode/jenkins/workspace/oss-swift-5.1-package-osx/llvm/include/llvm/MC/MCInst.h, line 66.
Stack dump:
0. Running pass 'Function Pass Manager' on module '/Users/megastep/Library/Developer/Xcode/DerivedData/AudioKit_For_iOS-bjgbdowpgngrljgglytxnqbrkwao/Build/Intermediates.noindex/AudioKit For iOS.build/Release-iphonesimulator/AudioKit.build/Objects-normal/x86_64/AKReverb2.o'.
1. Running pass 'X86 Assembly Printer' on function '@"$s8AudioKit11AKMIDIEventV15internalPacketsSaySays5UInt8VGGvg"'
0 swift 0x000000010cdccfc5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1 swift 0x000000010cdcc2b5 llvm::sys::RunSignalHandlers() + 85
2 swift 0x000000010cdcd5a8 SignalHandler(int) + 264
3 libsystem_platform.dylib 0x00007fff6e41b42d _sigtramp + 29
4 libdyld.dylib 0x00007fff6e221345 dyldGlobalLockRelease() + 0
5 libsystem_c.dylib 0x00007fff6e2f0a1c abort + 120
6 libsystem_c.dylib 0x00007fff6e2efcd6 err + 0
7 swift 0x000000010d2f9b91 (anonymous namespace)::X86MCCodeEmitter::encodeInstruction(llvm::MCInst const&, llvm::raw_ostream&, llvm::SmallVectorImpl<llvm::MCFixup>&, llvm::MCSubtargetInfo const&) const (.cold.104) + 33
8 swift 0x000000010a5d55bd (anonymous namespace)::X86MCCodeEmitter::encodeInstruction(llvm::MCInst const&, llvm::raw_ostream&, llvm::SmallVectorImpl<llvm::MCFixup>&, llvm::MCSubtargetInfo const&) const + 15837
9 swift 0x000000010cb6f315 (anonymous namespace)::MCMachOStreamer::EmitInstToData(llvm::MCInst const&, llvm::MCSubtargetInfo const&) + 213
10 swift 0x000000010cb74e91 llvm::MCObjectStreamer::EmitInstruction(llvm::MCInst const&, llvm::MCSubtargetInfo const&, bool) + 49
11 swift 0x000000010a5695d1 llvm::X86AsmPrinter::EmitInstruction(llvm::MachineInstr const*) + 22081
12 swift 0x000000010ac4fe51 llvm::AsmPrinter::EmitFunctionBody() + 3393
13 swift 0x000000010a389b68 llvm::X86AsmPrinter::runOnMachineFunction(llvm::MachineFunction&) + 296
14 swift 0x000000010b55908a llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 330
15 swift 0x000000010cc9c043 llvm::FPPassManager::runOnFunction(llvm::Function&) + 947
16 swift 0x000000010cc9c2f8 llvm::FPPassManager::runOnModule(llvm::Module&) + 72
17 swift 0x000000010cc9c70e llvm::legacy::PassManagerImpl::run(llvm::Module&) + 798
18 swift 0x00000001096c9641 swift::performLLVM(swift::IRGenOptions&, swift::DiagnosticEngine*, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, swift::version::Version const&, llvm::StringRef, swift::UnifiedStatsReporter*) + 2417
19 swift 0x00000001096cf254 (anonymous namespace)::LLVMCodeGenThreads::Thread::run() + 516
20 swift 0x00000001096cf049 (anonymous namespace)::LLVMCodeGenThreads::runThread(void*) + 9
21 libsystem_pthread.dylib 0x00007fff6e426e65 _pthread_start + 148
22 libsystem_pthread.dylib 0x00007fff6e42283b thread_start + 15
error: Abort trap: 6 (in target 'AudioKit' from project 'AudioKit For iOS')
It's good that this appears to be fixed in 5.2 but I don't know what the timeline is for this to ship in Xcode?
EDIT: I have also narrowed down the Swift method in the code that causes this crash, since it's always the same stack trace. Removing that method allows compilation to complete as expected with the Swift 5.1 toolchain. Here is its code:
public var internalPackets: [[MIDIByte]] {
var splitData = [[MIDIByte]]()
let byteLimit = Int(data.count / 256)
for i in 0...byteLimit {
let arrayStart = i * 256
let arrayEnd: Int = min(Int(arrayStart + 256), Int(data.count))
let tempData = Array(data[arrayStart..<arrayEnd])
splitData.append(tempData)
}
return splitData
}