TransformUtils: Avoid getNodePtrUnchecked() in integer division, NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sun, 21 Feb 2016 20:14:29 +0000 (20:14 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sun, 21 Feb 2016 20:14:29 +0000 (20:14 +0000)
commitec6f7fed54cdcc0e2588f912626314c0a58b24d7
treedc28a89bbb70376c2f76b5c66e578a663839f029
parent820cf20a986f06d7fb1f055ae44748529f896d94
TransformUtils: Avoid getNodePtrUnchecked() in integer division, NFC

Stop relying on `getNodePtrUnchecked()` being useful on invalid
iterators.  This function is documented to be for internal use only, and
the pointer type will eventually have to change to remove UB from
ilist_iterator.  Instead, check the iterator before it has been
invalidated.

llvm-svn: 261497
llvm/lib/Transforms/Utils/IntegerDivision.cpp