From 10b5eaed917d6f91aa2d416c08c93697bd1d446f Mon Sep 17 00:00:00 2001 From: Scott Linder Date: Thu, 10 Dec 2020 21:54:15 +0000 Subject: [PATCH] [SmallVector] Copy new docs into Doxygen comment Copy the `ProgrammersManual.rst` changes from D92522 to the Doxygen comment for `SmallVector`, to hopefully encourage new uses migrating to the no-explicit-`N` form. Differential Revision: https://reviews.llvm.org/D93069 --- llvm/include/llvm/ADT/SmallVector.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h index 1b2787b..10b9d4e 100644 --- a/llvm/include/llvm/ADT/SmallVector.h +++ b/llvm/include/llvm/ADT/SmallVector.h @@ -1012,7 +1012,14 @@ template struct CalculateSmallVectorDefaultInlinedElements { /// elements is below that threshold. This allows normal "small" cases to be /// fast without losing generality for large inputs. /// -/// Note that this does not attempt to be exception safe. +/// \note +/// In the absence of a well-motivated choice for the number of inlined +/// elements \p N, it is recommended to use \c SmallVector (that is, +/// omitting the \p N). This will choose a default number of inlined elements +/// reasonable for allocation on the stack (for example, trying to keep \c +/// sizeof(SmallVector) around 64 bytes). +/// +/// \warning This does not attempt to be exception safe. /// template ::value> -- 2.7.4