Improve debug error message with register name
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Sat, 3 Sep 2016 06:57:49 +0000 (06:57 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Sat, 3 Sep 2016 06:57:49 +0000 (06:57 +0000)
llvm-svn: 280583

llvm/lib/CodeGen/LiveRangeCalc.cpp

index 98022d9..281cf1f 100644 (file)
@@ -374,7 +374,8 @@ bool LiveRangeCalc::findReachingDefs(LiveRange &LR, MachineBasicBlock &UseMBB,
     if (TargetRegisterInfo::isPhysicalRegister(PhysReg) &&
         !MBB->isLiveIn(PhysReg)) {
       MBB->getParent()->verify();
-      errs() << "The register " << PrintReg(PhysReg)
+      const TargetRegisterInfo *TRI = MRI->getTargetRegisterInfo();
+      errs() << "The register " << PrintReg(PhysReg, TRI)
              << " needs to be live in to BB#" << MBB->getNumber()
              << ", but is missing from the live-in list.\n";
       llvm_unreachable("Invalid global physical register");