ivanmurashko added inline comments.

================
Comment at: clang/include/clang/Tooling/Inclusions/HeaderIncludes.h:100
   // and "x" will be treated as the same header when deleting #includes.
   llvm::StringMap<llvm::SmallVector<Include, 1>> ExistingIncludes;
 
----------------
sammccall wrote:
> An alternative would be to use a std::forward_list<Include> here.
> 
> This guarantees pointer stability, it's an extra allocation but seems 
> unlikely to matter.
> 
> It would be more robust if the data structure changes (e.g. becomes large, or 
> is mutated after creation) but probably none of this will ever happen.
> 
> Up to you.
I changed my solution accordingly this suggestion. 
Small note: The `std::list` seems to be more suitable here as soon as the last 
element of the structure is used at the code.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118755

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

Reply via email to