From: Matt Arsenault Date: Tue, 28 Mar 2017 20:33:12 +0000 (+0000) Subject: Fix crashing on TargetCustom PseudoSourceValues X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=98ede9e115c381fe3a07313341d997256af99b9c;p=llvm Fix crashing on TargetCustom PseudoSourceValues Default to something more reasonable if printCustom isn't implemented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298941 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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 {