Issue 240422.1: Add version scheme for Swift language
Author: | Adrian Prantl |
---|---|
Champion: | |
Date submitted: | 2024-04-22 |
Date revised: | 2024-04-29 |
Date closed: | 2024-04-29 |
Type: | Enhancement |
Status: | Accepted |
DWARF version: | 6 |
Background
The list of languages in Section 3.1, Tsble 3.1, and at languages-v6.html, does not list a version scheme for the Swift language. This proposal adds one.
Overview
The Swift programming language does not have a version scheme defined
for DW_AT_language_version. This proposal defines it to use the VVMM
version scheme. This way "Swift 5.10" would be
DW_AT_language(DW_LANG_Swift)
DW_AT_language_version(510)
and "Swift 6" would be DW_AT_language_version(600)
.
Even though Swift package releases usually have a Major.Minor.Patch version scheme (e.g., Swift 5.9.2), the Swift compiler frontend's LangOptions data structure only uses Major.Minor to distinguish syntax changes in the parser (see References). This version scheme is designed to match what the compiler does.
Proposed Changes
Augment the table of language encodings to say
Swift DW_LNAME_Swift 0x001a 0 VVMM
References
- Issue 210419.1
- Swift downloads (see older releases for a history of versions).
- LangOptions.h
2024-04-29: Accepted.