[PATCH] D118755: [clangd] Crash in __memcmp_avx2_movbe

Ivan Murashko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 7 05:35:46 PST 2022


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



More information about the cfe-commits mailing list