RKSimon added inline comments.

================
Comment at: clang/include/clang/ExtractAPI/API.h:138
   APIRecord(RecordKind Kind, StringRef USR, StringRef Name,
-            PresumedLoc Location, AvailabilitySet Availabilities,
+            PresumedLoc Location, const AvailabilitySet &Availabilities,
             LinkageInfo Linkage, const DocComment &Comment,
----------------
aaron.ballman wrote:
> A lot of these changes look to be regressions, so I think Coverity is 
> incorrect to flag these. The old code is passing an `AvailabilitySet` by 
> value because it's doing a move operation on initialization: 
> `Availabilities(std::move(Availabilities))`. Making this into a const 
> reference defeats that optimization because you can't steal resources from a 
> const object (so this turns a move into a copy).
> 
> You should look through the rest of the patch for similar problematic changes.
I've never been sure whether coverity is being particularly poor at recognising 
the std::move pattern or particularly smart at realising it can't occur for 
some reason.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147901

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

Reply via email to