[PATCH] D90944: [clang-tidy] implement misc-mt-unsafe

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 17 05:29:14 PST 2020


lebedev.ri added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/misc/MtUnsafeCheck.cpp:279-282
+  llvm::DenseSet<StringRef> result;
+  result.insert(std::begin(posixFunctions), std::end(posixFunctions));
+  result.insert(std::begin(glibcFunctions), std::end(glibcFunctions));
+  return {result.begin(), result.end()};
----------------
njames93 wrote:
> Would it not be faster to get rid of the set. Instead insert all the items in to a vector, then sort and unique it
I can't imagine this will have measurable performance difference.
The main problem is algorithmic, https://reviews.llvm.org/D90944#inline-853246

But my main point is https://llvm.org/docs/CodingStandards.html#do-not-use-static-constructors


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

https://reviews.llvm.org/D90944



More information about the cfe-commits mailing list