Check if Type is a vector before calling function Type::getVectorNumElements.