[PATCH] D62970: [clang-doc] De-duplicate comments and locations

Diego Astiazarán via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 11 13:34:40 PDT 2019


DiegoAstiazaran marked 4 inline comments as done.
DiegoAstiazaran added inline comments.


================
Comment at: clang-tools-extra/clang-doc/Representation.cpp:124
+  for (auto &Comment : Other.Description) {
+    bool IsCommentUnique = std::find(Description.begin(), Description.end(),
+                                     Comment) == Description.end();
----------------
jakehehrlich wrote:
> juliehockett wrote:
> > ```if (std::find(Description.begin(), Description.end(), Comment) == Description.end())
> >   Description.emplace_back(std::move(Comment));```
> Instead of deduping like this can we just make Description a set?
The YAML generator uses an llvm method that doesn't support sets, so changing Description to a set would break that.
Talking with Julie we decided to de-duplicate with sort and unique.


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

https://reviews.llvm.org/D62970





More information about the cfe-commits mailing list