[PATCH] D42525: [clangd] Replace Optional in ScopeExitGuard (fix after r322838)

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 25 03:52:59 PST 2018


sammccall added inline comments.


================
Comment at: clangd/Function.h:141
 namespace detail {
+/// Optional-like type that sets its value to llvm::None when it was moved
+/// constructed from.
----------------
As noted in the thread I don't think this pulls its weight for us.
Swapping unique_ptr for optional doesn't seem like it'll ever be a bottleneck for us. If we really must avoid the allocation for some reason then adding move logic to ScopeExitGuard seems simpler.
If you feel strongly about keeping this as a separate concept, it should really go in llvm/ADT/Optional.h, and probably needs a new name.



Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D42525





More information about the cfe-commits mailing list