mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
Fix SCEVCommutativeExpr::print to be robust in the case of improper
expression canonicalization. Its job is to print what's there, not to make judgements about it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101461 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -247,11 +247,13 @@ void SCEVSignExtendExpr::print(raw_ostream &OS) const {
|
||||
}
|
||||
|
||||
void SCEVCommutativeExpr::print(raw_ostream &OS) const {
|
||||
assert(NumOperands > 1 && "This plus expr shouldn't exist!");
|
||||
const char *OpStr = getOperationStr();
|
||||
OS << "(" << *Operands[0];
|
||||
for (unsigned i = 1, e = NumOperands; i != e; ++i)
|
||||
OS << OpStr << *Operands[i];
|
||||
OS << "(";
|
||||
for (op_iterator I = op_begin(), E = op_end(); I != E; ++I) {
|
||||
OS << **I;
|
||||
if (next(I) != E)
|
||||
OS << OpStr;
|
||||
}
|
||||
OS << ")";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user