[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
Tue Apr 24 12:28:52 PDT 2018


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

> Why wasn't there a file for function parameter? Function parameters *are*
>  declared in some file, or am I missing something?

They are declared in some file defined by the line markers; the file are
not registered in the SourceManager as actual files, so getting the
FileEntry will always fail, that's why I changed it to get the PresumedLoc.

More general question is: how do we want USRs for function parameters to

> work, specifically should USR of the same param of different declarations
>  be the same or different?

That's a good point, this patch will generated different names for the same
function param if a function is first defined then declared somewhere else.

I guess it should follow the USR generation pattern for FunctionDecls, what
do you think?


Repository:
  rC Clang

https://reviews.llvm.org/D42966





More information about the cfe-commits mailing list