[RGT] Recode more unreachable assertions and tautologies
authorPaul Robinson <paul.robinson@sony.com>
Fri, 19 Mar 2021 14:43:36 +0000 (07:43 -0700)
committerPaul Robinson <paul.robinson@sony.com>
Fri, 19 Mar 2021 16:17:22 +0000 (09:17 -0700)
commitfb4f6057a637cabc687f7457d20a29da2c890ec0
tree3072b0cd71ad56bf613f01a333288def689ac0cf
parent9d2df964070700ae0d244e84572ac2275050e49a
[RGT] Recode more unreachable assertions and tautologies

Count iterations of zero-trip loops and assert the count is zero,
rather than asserting inside the loop.
Unreachable functions should use llvm_unreachable.
Remove tautological 'if' statements, even when they're following a
pattern of checks.

Found by the Rotten Green Tests project.
llvm/unittests/ADT/BitVectorTest.cpp
llvm/unittests/ADT/ImmutableListTest.cpp
llvm/unittests/ADT/StringRefTest.cpp
llvm/unittests/IR/BasicBlockTest.cpp
llvm/unittests/Linker/LinkModulesTest.cpp