Page MenuHomePhabricator

PR13575: Fix USR mangling for functions taking function pointers as arguments.
ClosedPublic

Authored by jkorous-apple on Oct 9 2017, 3:15 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

jkorous-apple created this revision.Oct 9 2017, 3:15 PM
arphaman added inline comments.Oct 9 2017, 3:39 PM
lib/Index/USRGeneration.cpp
757 ↗(On Diff #118281)

I believe you can drop the '(' and ')'. The '#' should be enough to prevent the USR collision.

added another test

jkorous-apple added inline comments.Oct 9 2017, 4:21 PM
lib/Index/USRGeneration.cpp
757 ↗(On Diff #118281)

Actually, this is a great question!

I was worried it might not be the case so I created two more test cases.
Let's try to imagine there are no parentheses in those USRs.
First two test cases could be solved by using 'v' or something for functions taking no arguments. But 3rd and 4th test cases would definitely need some disambiguation then.

I am not saying this is the only possible way how to represent function pointers but for proposed solution those parentheses are needed.

arphaman accepted this revision.Oct 9 2017, 4:58 PM

LGTM.

This revision is now accepted and ready to land.Oct 9 2017, 4:58 PM
This revision was automatically updated to reflect the committed changes.