Skip to content

[PATCH 7/7] [clang] improve NestedNameSpecifier: LLDB changes #149949

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

Open
wants to merge 1 commit into
base: users/mizvekov/name-qualification-refactor-6
Choose a base branch
from

Conversation

mizvekov
Copy link
Contributor

@mizvekov mizvekov commented Jul 22, 2025

Patch series starting at #147835

@mizvekov mizvekov self-assigned this Jul 22, 2025
@mizvekov mizvekov requested a review from JDevlieghere as a code owner July 22, 2025 01:01
@llvmbot llvmbot added the lldb label Jul 22, 2025
@llvmbot
Copy link
Member

llvmbot commented Jul 22, 2025

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-lldb

Author: Matheus Izvekov (mizvekov)

Changes

Test run of the LLDB CI, just checking if anything needs to be updated there.


Full diff: https://github.com/llvm/llvm-project/pull/149949.diff

1 Files Affected:

  • (added) lldb/DELETE.ME ()
diff --git a/lldb/DELETE.ME b/lldb/DELETE.ME
new file mode 100644
index 0000000000000..e69de29bb2d1d

@mizvekov mizvekov force-pushed the users/mizvekov/name-qualification-refactor-7 branch from 3c8cbad to 7c873c4 Compare July 22, 2025 05:53
@mizvekov mizvekov changed the title Draft: [PATCH 7/7] [clang] improve NestedNameSpecifier: LLDB changes [PATCH 7/7] [clang] improve NestedNameSpecifier: LLDB changes Jul 22, 2025
@mizvekov mizvekov requested a review from Michael137 July 22, 2025 05:55
@mizvekov mizvekov force-pushed the users/mizvekov/name-qualification-refactor-7 branch from 7c873c4 to 2c01149 Compare July 22, 2025 06:33
@mizvekov mizvekov force-pushed the users/mizvekov/name-qualification-refactor-6 branch from 998f226 to 47b79ce Compare July 22, 2025 19:53
@mizvekov mizvekov force-pushed the users/mizvekov/name-qualification-refactor-7 branch 2 times, most recently from 285569d to 968ecb4 Compare July 22, 2025 20:05
Copy link

github-actions bot commented Jul 22, 2025

✅ With the latest revision this PR passed the Python code formatter.

@mizvekov mizvekov force-pushed the users/mizvekov/name-qualification-refactor-7 branch 11 times, most recently from b8c6168 to ea97cf5 Compare July 24, 2025 04:53
Copy link
Member

@Michael137 Michael137 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmmm yea I don't think we want to be losing the scope qualifiers for the typenames. What does LLDB have to do to retain those?

@mizvekov
Copy link
Contributor Author

Hmmmm yea I don't think we want to be losing the scope qualifiers for the typenames. What does LLDB have to do to retain those?

The answer to that depends on what LLDB wants and can do here.

The status quo is, the types produced in the places changed here are not valid as-written types, as they lacked an ElaboratedType. Clang will currently print types lacking an ElaboratedType as if they were fully qualified, with a synthesized name qualifier.

This is used to distinguish canonical from non-canonical types, and the motivation is that we find it more appropriate to print canonical types as fully qualified when they appear in diagnostics and such.

Now with this patch series, we retain the ability to distinguish canonical RecordTypes and EnumTypes, and still print those as fully qualified. But a mis-feature of the status quo is removed: the same would work for TypedefTypes, if they lacked an ElaboratedType on top, then we would fully qualify them when printing.

But this was not an intentional feature, and it lacks motivation, as TypedefTypes never appear in canonical types.
This patch does not create an AST representation for such a TypedefType, beyond what you can do synthesizing a name qualifier yourself.

Now, does LLDB want to keep fully qualified names here, or does it want these to be printed as-written?

Changing this back to the status quo is more straight-forward, we just need to synthesize fully qualified types.

This is taking me a while because it's currently very difficulty for me to get a functional LLDB workflow on MacOS, so
I am currently relying only on the CI job to test and debug this.

To change this to as-written, we would need to figure out if we have a source for this information first, if we store and can retrieve those from all of the Debug info formats we support.

@mizvekov mizvekov force-pushed the users/mizvekov/name-qualification-refactor-7 branch from ea97cf5 to ba9b546 Compare July 27, 2025 21:57
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Jul 27, 2025
@llvmbot llvmbot added the clang:frontend Language frontend issues, e.g. anything involving "Sema" label Jul 27, 2025
Copy link

github-actions bot commented Jul 27, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@mizvekov mizvekov force-pushed the users/mizvekov/name-qualification-refactor-7 branch 4 times, most recently from 1ee6918 to ff7f559 Compare July 28, 2025 01:27
@mizvekov mizvekov force-pushed the users/mizvekov/name-qualification-refactor-7 branch from ff7f559 to 75be9ef Compare July 28, 2025 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category lldb
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants