My problem is that AMDIL assumes the last thing in the program is "end", which is emitted in EmitEndOfAsmFile. When using debug info, the OutStreamer.Finish() dumps the line tables after it, which doesn't parse. http://llvm-reviews.chandlerc.com/D633