Index: lib/CodeGen/CodeGenAction.cpp =================================================================== --- lib/CodeGen/CodeGenAction.cpp +++ lib/CodeGen/CodeGenAction.cpp @@ -519,8 +519,15 @@ // Get the diagnostic ID based. switch (DI.getKind()) { case llvm::DK_InlineAsm: - if (InlineAsmDiagHandler(cast(DI))) - return; + if (InlineAsmDiagHandler(cast(DI))) { + if (Severity != llvm::DS_Error) + return; + // If there was an error with inline asm, the BB may actually be + // incomplete and may fail later in the best scenario, or simply miss the + // entire block of inline assembly in the worst case. Terminate the + // process at this point, we can no longer recover. + exit(1); + } ComputeDiagID(Severity, inline_asm, DiagID); break; case llvm::DK_StackSize: