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

Mikhail Ramalho via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 26 07:18:38 PDT 2018


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.


-- 

Mikhail Ramalho.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180426/0bb13e51/attachment-0001.html>


More information about the cfe-commits mailing list