summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorAhmed Bougacha <ahmed.bougacha@gmail.com>2015-01-07 22:47:46 +0000
committerAhmed Bougacha <ahmed.bougacha@gmail.com>2015-01-07 22:47:46 +0000
commit97fea8bb95ed75c745e62d3f89035ff7e721caae (patch)
treece7c343ffabd84fcb8ba4ffc9277241b2af19881 /llvm/lib/IR/Verifier.cpp
parent0599297cb42d6718e0c40f62189bfa6cf8bf9e7b (diff)
downloadbcm5719-llvm-97fea8bb95ed75c745e62d3f89035ff7e721caae.tar.gz
bcm5719-llvm-97fea8bb95ed75c745e62d3f89035ff7e721caae.zip
[CodeGen] Add MVT::isValid to replace manual validity checks. NFC.
Now that we have MVT::FIRST_VALUETYPE (r225362), we can provide a method checking that the MVT is valid, that is, it's in [FIRST_VALUETYPE, LAST_VALUETYPE[. This commit also uses it in a few asserts, that would previously accept invalid MVTs, such as the default constructed -1. In that case, the code following those asserts would do an out-of-bounds array access. Using MVT::isValid, those assertions fail as expected when passed invalid MVTs. It feels clunky to have such a validity checking function, but it's at least better than the alternative of broken manual checks. llvm-svn: 225411
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud