From a3fa896b52caa7a70fbed684779dfacda8d85baa Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Tue, 28 Mar 2017 20:33:12 +0000 Subject: [PATCH] Fix crashing on TargetCustom PseudoSourceValues Default to something more reasonable if printCustom isn't implemented. llvm-svn: 298941 --- lib/CodeGen/PseudoSourceValue.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/PseudoSourceValue.cpp b/lib/CodeGen/PseudoSourceValue.cpp index 804a4c3dad6..b29e62bf1aa 100644 --- a/lib/CodeGen/PseudoSourceValue.cpp +++ b/lib/CodeGen/PseudoSourceValue.cpp @@ -29,7 +29,10 @@ PseudoSourceValue::PseudoSourceValue(PSVKind Kind) : Kind(Kind) {} 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 {