Use SmallVectorImpl::reverse_iterator instead of SmallVector to avoid specifying the vector size.