[PATCH] D42966: Fix USR generation in the presence of #line directives or linemarkes

Mikhail Ramalho via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 26 07:19:36 PDT 2018


mikhail.ramalho added a subscriber: rsmith.
mikhail.ramalho added a comment.

Hi,

> Or is the that whenever there's a `#line` directive we get into a
>  "virtual" file that's not registered in the `SourceManager`?

The virtual file is actually registered in the SourceManager but the
FileEntry for it is NULL (USRGeneration.cpp:33), which forces printLoc to
return true (USRGeneration.cpp:38) and the USR is not generated.

I believe the USR gen for params should have follow the functionDecl
convention. I'm reworking the patch now.

> int func(int param1);
>  int func(int param2);
>  // param1 and param2 could both have the same USR, but different names.
>  That might (or might not) be surprising.

I agree here, they should have the same USR.


Repository:
  rC Clang

https://reviews.llvm.org/D42966





More information about the cfe-commits mailing list