Skip to content

[clang][DebugInfo][gmodules] Set runtimeLang on ObjC forward declarations #9759

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

Merged

Conversation

Michael137
Copy link

In Objective-C, forward declarations are currently represented as:

DW_TAG_structure_type
  DW_AT_name                ("Foo")
  DW_AT_declaration         (true)
  DW_AT_APPLE_runtime_class (DW_LANG_ObjC)

However, when compiling with -gmodules, when a class definition is turned into a forward declaration within a DW_TAG_module, the DIE for the forward declaration looks as follows:

DW_TAG_structure_type
  DW_AT_name                ("Foo")
  DW_AT_declaration         (true)

Note the absence of DW_AT_APPLE_runtime_class. With recent changes in LLDB, not being able to differentiate between C++ and Objective-C forward declarations has become problematic (see attached test-case and explanation in llvm#119860).

(cherry picked from commit 7c7fd60)

…ions

In Objective-C, forward declarations are currently represented as:
```
DW_TAG_structure_type
  DW_AT_name                ("Foo")
  DW_AT_declaration         (true)
  DW_AT_APPLE_runtime_class (DW_LANG_ObjC)
```
However, when compiling with `-gmodules`, when a class definition
is turned into a forward declaration within a `DW_TAG_module`, the
DIE for the forward declaration looks as follows:
```
DW_TAG_structure_type
  DW_AT_name                ("Foo")
  DW_AT_declaration         (true)
```

Note the absence of `DW_AT_APPLE_runtime_class`. With recent changes in
LLDB, not being able to differentiate between C++ and Objective-C
forward declarations has become problematic (see attached test-case
and explanation in llvm#119860).

(cherry picked from commit 7c7fd60)
@Michael137 Michael137 requested a review from a team as a code owner December 17, 2024 13:34
@Michael137
Copy link
Author

@swift-ci test

@adrian-prantl adrian-prantl merged commit 40f7f30 into swift/release/6.1 Dec 17, 2024
3 checks passed
@adrian-prantl adrian-prantl deleted the clang/gmodules-fwd-decl-language-to-6.1 branch December 17, 2024 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants