Index: include/llvm/CodeGen/MachineInstr.h =================================================================== --- include/llvm/CodeGen/MachineInstr.h +++ include/llvm/CodeGen/MachineInstr.h @@ -1171,6 +1171,9 @@ return OS; } +void printDebugLoc(DebugLoc DL, const MachineFunction *MF, + raw_ostream &CommentOS); + } // End llvm namespace #endif Index: lib/CodeGen/MachineInstr.cpp =================================================================== --- lib/CodeGen/MachineInstr.cpp +++ lib/CodeGen/MachineInstr.cpp @@ -1450,7 +1450,8 @@ #endif } -static void printDebugLoc(DebugLoc DL, const MachineFunction *MF, +namespace llvm { +void printDebugLoc(DebugLoc DL, const MachineFunction *MF, raw_ostream &CommentOS) { const LLVMContext &Ctx = MF->getFunction()->getContext(); if (!DL.isUnknown()) { // Print source line info. @@ -1473,6 +1474,7 @@ } } } +} void MachineInstr::print(raw_ostream &OS, const TargetMachine *TM, bool SkipOpers) const { Index: lib/Target/X86/X86CodeEmitter.cpp =================================================================== --- lib/Target/X86/X86CodeEmitter.cpp +++ lib/Target/X86/X86CodeEmitter.cpp @@ -1112,9 +1112,18 @@ case TargetOpcode::INLINEASM: // We allow inline assembler nodes with empty bodies - they can // implicitly define registers, which is ok for JIT. - if (MI.getOperand(0).getSymbolName()[0]) + if (MI.getOperand(0).getSymbolName()[0]) { + DebugLoc DL = MI.getDebugLoc(); + if (const MachineBasicBlock *MBB = MI.getParent()) { + if (const MachineFunction *MF = MBB->getParent()) { + printDebugLoc(DL, MF, llvm::errs()); + llvm::errs() << '\n'; + } + } report_fatal_error("JIT does not support inline asm!"); + } break; + case TargetOpcode::DBG_VALUE: case TargetOpcode::CFI_INSTRUCTION: break; case TargetOpcode::GC_LABEL: