[PATCH] [VER 2] replace llvm_unreachable call with emitError in SIInstrInfo::copyPhysReg

Tom Stellard thomas.stellard at amd.com
Fri Apr 11 14:09:04 PDT 2014


From: Darren <darren.powell at amd.com>

---
 lib/Target/R600/SIInstrInfo.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/Target/R600/SIInstrInfo.cpp b/lib/Target/R600/SIInstrInfo.cpp
index b19ff98..6d22c1b 100644
--- a/lib/Target/R600/SIInstrInfo.cpp
+++ b/lib/Target/R600/SIInstrInfo.cpp
@@ -19,6 +19,8 @@
 #include "SIMachineFunctionInfo.h"
 #include "llvm/CodeGen/MachineInstrBuilder.h"
 #include "llvm/CodeGen/MachineRegisterInfo.h"
+#include "llvm/IR/Function.h"
+#include "llvm/IR/LLVMContext.h"
 #include "llvm/MC/MCInstrDesc.h"
 
 using namespace llvm;
@@ -153,7 +155,10 @@ SIInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
     SubIndices = Sub0_15;
 
   } else {
-    llvm_unreachable("Can't copy register!");
+    const MachineFunction *MF = MBB.getParent();
+    LLVMContext &Ctx = MF->getFunction()->getContext();
+
+    Ctx.emitError(Twine("SIInstrInfo::copyPhysReg - Can't copy register!"));
   }
 
   while (unsigned SubIdx = *SubIndices++) {
-- 
1.8.3.2




More information about the llvm-commits mailing list