From 6129c376935db12dc79f6d515a1d96632adb480c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 8 Apr 2010 00:09:16 +0000 Subject: [PATCH] convert a report_fatal_error that I was able to trigger into a nice error so the user at least knows what inline asm is a problem. For example: error: inline asm not supported yet: don't know how to handle tied indirect register inputs pr8788-1.c:14:10: note: generated from here asm ("\n" : "+r" (stack->regs) ^ Instead of: fatal error: error in backend: Don't know how to handle tied indirect register inputs yet! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100731 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index d783dd0b252..e8e9498628d 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -28,6 +28,7 @@ #include "llvm/Instructions.h" #include "llvm/Intrinsics.h" #include "llvm/IntrinsicInst.h" +#include "llvm/LLVMContext.h" #include "llvm/Module.h" #include "llvm/CodeGen/FastISel.h" #include "llvm/CodeGen/GCStrategy.h" @@ -5497,9 +5498,14 @@ void SelectionDAGBuilder::visitInlineAsm(CallSite CS) { if (InlineAsm::isRegDefKind(OpFlag) || InlineAsm::isRegDefEarlyClobberKind(OpFlag)) { // Add (OpFlag&0xffff)>>3 registers to MatchedRegs. - if (OpInfo.isIndirect) - report_fatal_error("Don't know how to handle tied indirect " - "register inputs yet!"); + if (OpInfo.isIndirect) { + // This happens on gcc/testsuite/gcc.dg/pr8788-1.c + LLVMContext &Ctx = CurMBB->getParent()->getFunction()->getContext(); + Ctx.emitError(CS.getInstruction(), "inline asm not supported yet:" + " don't know how to handle tied " + "indirect register inputs"); + } + RegsForValue MatchedRegs; MatchedRegs.TLI = &TLI; MatchedRegs.ValueVTs.push_back(InOperandVal.getValueType());