Add some asserts to verify MVT invariant assumptions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58701 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2008-11-04 16:03:56 +00:00
parent aa386d0881
commit 38bb2f8d09
2 changed files with 4 additions and 0 deletions

View File

@ -20,12 +20,14 @@ using namespace llvm;
MVT MVT::getExtendedIntegerVT(unsigned BitWidth) {
MVT VT;
VT.LLVMTy = IntegerType::get(BitWidth);
assert(VT.isExtended() && "Type is not extended!");
return VT;
}
MVT MVT::getExtendedVectorVT(MVT VT, unsigned NumElements) {
MVT ResultVT;
ResultVT.LLVMTy = VectorType::get(VT.getTypeForMVT(), NumElements);
assert(ResultVT.isExtended() && "Type is not extended!");
return ResultVT;
}

View File

@ -69,6 +69,7 @@ MVT MVT::getExtendedIntegerVT(unsigned BitWidth) {
if (!ET) ET = new ExtendedIntegerType(BitWidth);
MVT VT;
VT.LLVMTy = ET;
assert(VT.isExtended() && "Type is not extended!");
return VT;
}
@ -78,6 +79,7 @@ MVT MVT::getExtendedVectorVT(MVT VT, unsigned NumElements) {
if (!ET) ET = new ExtendedVectorType(VT, NumElements);
MVT ResultVT;
ResultVT.LLVMTy = ET;
assert(ResultVT.isExtended() && "Type is not extended!");
return ResultVT;
}