Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang][Index] Use canonical function parameter types in USRs #68222

Merged
merged 2 commits into from
Apr 16, 2024

Conversation

sdkrystian
Copy link
Member

This is necessary to ensure that functions declared in different translation units whose parameter types only differ in top-level cv-qualification generate the same USR.

For example:

// A.cpp
void f(const int x); // c:@F@f#1I#

// B.cpp
void f(int x);       // c:@F@f#I#

With the proposed changes, the USR for both functions will be c:@F@f#I#.

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Oct 4, 2023
clang/lib/Index/USRGeneration.cpp Outdated Show resolved Hide resolved
@mizvekov
Copy link
Contributor

mizvekov commented Oct 4, 2023

Also, would you make sure to add a test case for this?

Thanks.

@sdkrystian
Copy link
Member Author

@mizvekov Sure, I'll take care of that tomorrow

@mizvekov
Copy link
Contributor

@sdkrystian ping, do you still intend to continue this? Just adding your example as a test case would be fine.

@sdkrystian
Copy link
Member Author

@mizvekov I totally forgot about this PR, sorry! I'll add a test and merge tomorrow :)

@sdkrystian sdkrystian merged commit 71b9f66 into llvm:main Apr 16, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants