[PATCH] D102669: [analyzer][ctu] Fix wrong 'multiple definitions' errors caused by space characters in lookup names when parsing the ctu index file

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 19 06:42:02 PDT 2021


martong added a comment.

First of all, thank you for the patch!

We had a meeting with my colleges (@steakhal, @gamesh411) and we agreed in the following. This issue you are trying to solve here is indeed a serious problem, but we'd like to suggest an alternative and perhaps more durable solution. In `CrossTranslationUnitContext::getLookupName(const NamedDecl *ND)` it would be possible to extend the returned string with a prefix that encodes the length of the USR string.
So, instead of

  c:@F at g#I# ctu-other.cpp.ast

we'd get

  9:c:@F at g#I# ctu-other.cpp.ast

This way, we could handle even file names with spaces in them.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102669



More information about the cfe-commits mailing list