ilya-biryukov accepted this revision.
ilya-biryukov added a comment.
This revision is now accepted and ready to land.

LGTM modulo two NITs.
Really excited to see this land.



================
Comment at: clangd/Context.cpp:32
+
+Context Context::swap(Context Replacement) {
+  std::swap(Replacement, currentContext());
----------------
Maybe call it `swapCurrent`. It's longer, but won't allow to mistake it for a 
member `swap` function. 
Since it's almost never used, having a longer name is not a big deal.


================
Comment at: clangd/Context.h:196
+  ~WithContext() {
+    if (Restore)
+      Context::swap(std::move(*Restore));
----------------
I think it can't be `null` after move ctor is deleted.
Maybe always store a `Context` instead of `unique_ptr` and call `swap` 
unconditionally?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D42517



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

Reply via email to