[llvm] r298941 - Fix crashing on TargetCustom PseudoSourceValues

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 28 13:33:13 PDT 2017


Author: arsenm
Date: Tue Mar 28 15:33:12 2017
New Revision: 298941

URL: http://llvm.org/viewvc/llvm-project?rev=298941&view=rev
Log:
Fix crashing on TargetCustom PseudoSourceValues

Default to something more reasonable if printCustom isn't implemented.

Modified:
    llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp

Modified: llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp?rev=298941&r1=298940&r2=298941&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp (original)
+++ llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp Tue Mar 28 15:33:12 2017
@@ -29,7 +29,10 @@ PseudoSourceValue::PseudoSourceValue(PSV
 PseudoSourceValue::~PseudoSourceValue() {}
 
 void PseudoSourceValue::printCustom(raw_ostream &O) const {
-  O << PSVNames[Kind];
+  if (Kind < TargetCustom)
+    O << PSVNames[Kind];
+  else
+    O << "TargetCustom" << Kind;
 }
 
 bool PseudoSourceValue::isConstant(const MachineFrameInfo *) const {




More information about the llvm-commits mailing list