Skip to content

Cherry pick SBSourceLanguage #8885

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

adrian-prantl
Copy link

@adrian-prantl adrian-prantl commented Jun 12, 2024

rdar://129225957

adrian-prantl and others added 15 commits June 12, 2024 11:06
This patch adds DWARF constants for DW_AT_language_name and
DW_AT_language_version to Dwarf.def and Dwarf.h.

While the DWARF 6 spec is not finalized, the constants are published on
the DWARF website and considered stable, with idea being that the list
published on dwarfstd.org is the authoritative source that is being
continuously updated between DWARF revisions, as new languages are being
developed.

https://dwarfstd.org/languages-v6.html

My main motivation for adding this is to use in
llvm#89981

(cherry picked from commit 300340f)
(cherry picked from commit aa21158)
that separates out language and version. To avoid reinventing the wheel
and introducing subtle incompatibilities, this API uses the table of
languages and versiond defined by the upcoming DWARF 6 standard
(https://dwarfstd.org/languages-v6.html). While the DWARF 6 spec is not
finialized, the list of languages is broadly considered stable.

The primary motivation for this is to allow the Swift language plugin to
switch between language dialects between, e.g., Swift 5.9 and 6.0 with
out introducing a ton of new language codes. On the main branch this
change is considered NFC.

Depends on llvm#89980

(cherry picked from commit 975eca0)

 Conflicts:
	lldb/packages/Python/lldbsuite/test/dotest_args.py
	lldb/source/Commands/CommandObjectDWIMPrint.cpp
	lldb/source/Expression/UserExpression.cpp

(cherry picked from commit 811bc94)
… type.

rdar://126783312
(cherry picked from commit 3c88dde)
(cherry picked from commit 4cd11c9)
(cherry picked from commit 592a664)
(cherry picked from commit b88d211)

 Conflicts:
	lldb/packages/Python/lldbsuite/test/builders/builder.py

(cherry picked from commit 2c21b76)
Use a Python script to generate SBLanguages.h instead of piggybacking on
LLDB TableGen. This addresses Nico Weber's post-commit feedback.

(cherry picked from commit dcbf0fc)
(cherry picked from commit 88d242e)
(cherry picked from commit b8c301f)
(cherry picked from commit 3d267a8)
(cherry picked from commit f8a1db3)
Use add_custom_command instead of add_custom_target to generate
SBLanguages.h.

(cherry picked from commit 3809e20)
(cherry picked from commit 18013b9)
Alex pointed out in llvm#91254 that we only need the custom target if we had
more than one target depending on it. This isn't the case upstream, but
on our downstream fork, we have a second dependency. Reintroduce the
target so that everything can depend on that, without the
single-dependency foot-gun.

(cherry picked from commit dad1109)
(cherry picked from commit 26f8029)
llvm#91511)

…db-resource-headers

The Xcode build otherwise fails with
```
CMake Error in source/API/CMakeLists.txt:
  The custom command generating

    /Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-standalone/lldb-xcode-build/include/lldb/API/SBLanguages.h

  is attached to multiple targets:

    lldb-sbapi-dwarf-enums
    liblldb-resource-headers

  but none of these is a common dependency of the other(s).  This is not
  allowed by the Xcode "new build system".

CMake Generate step failed.  Build files cannot be regenerated correctly.
```

(cherry picked from commit fcfc15b)
(cherry picked from commit d645457)
llvm#91128)

Create API folder if it does not exist, before creating SBLanguages.h

(cherry picked from commit dbcfa29)
(cherry picked from commit 8bc993c)
(cherry picked from commit 3bde798)
(cherry picked from commit 997d177)
(cherry picked from commit d74bc82)
(cherry picked from commit 19ef747)
@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl adrian-prantl merged commit a338c11 into swiftlang:stable/20240408 Jun 12, 2024
0 of 3 checks passed
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.

5 participants