rnk added a subscriber: dblaikie.
rnk added a comment.

For reference, this is the code sequence that needs the SmallVector change:
https://github.com/llvm/llvm-project/blob/99e2cba219aea80b3f11de2aa4e0192b28852de4/clang/lib/Frontend/CompilerInvocation.cpp#L1872



================
Comment at: clang-tools-extra/clang-move/tool/ClangMove.cpp:113
   move::MoveDefinitionSpec Spec;
-  Spec.Names = {Names.begin(), Names.end()};
+  Spec.Names = (std::vector<std::string> &)Names;
   Spec.OldHeader = OldHeader;
----------------
Converting from std::list to SmallVector by way of std::vector with a C-style 
cast is a bit surprising. Is there a simpler way to write this, like 
`Spec.Names.assign(Names.begin(), Names.end());`?


================
Comment at: llvm/include/llvm/ADT/SmallVector.h:905
+
+  const SmallVector &operator=(const std::vector<T> &Vec) {
+    this->assign(Vec.begin(), Vec.end());
----------------
+@dblaikie, who knows more about STL container details than I do.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69959/new/

https://reviews.llvm.org/D69959



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to