add a sanity check: LegalizeOp should return a value that is the same type

as its input.

llvm-svn: 27528
This commit is contained in:
Chris Lattner 2006-04-08 04:13:17 +00:00
parent fc72a6b72d
commit 101ea66813
1 changed files with 3 additions and 0 deletions

View File

@ -2688,6 +2688,9 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
}
}
assert(Result.getValueType() == Op.getValueType() &&
"Bad legalization!");
// Make sure that the generated code is itself legal.
if (Result != Op)
Result = LegalizeOp(Result);