kadircet added inline comments.

================
Comment at: clang-tools-extra/clangd/QueryDriverDatabase.cpp:344
+    }
+    return Cmd;
   }
----------------
kadircet wrote:
> ofc we don't need it. but the thing is we are returning an 
> `Optional<tooling::Command>` hence the return statement needs to invoke a 
> constructor for `Optional` and without `std::move` it would invoke a copy 
> constructor rather than a move-based one.
> 
> And even though rest of the calculations are cached per driver&language name, 
> this copy is going to happen for every translation unit. So in theory it 
> would be nice to prevent that.
oh actually never mind, `Cmd` itself is also an `Optional<tooling::Command>`, i 
thought it was a naked `tooling::Command`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92012

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

Reply via email to