Skip to content

Commit ee0dd49

Browse files
committed
[ClangImporter] Use the current version to vend enum constant names.
The compiler itself no longer uses this API but the debugger does, in order to pretty-print option sets. The normal way to test this would be to add an LLDB-side test that uses a framework with versioned API notes. Unfortunately I can't think of a straightforward way to test it Swift-side.
1 parent c402030 commit ee0dd49

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

include/swift/ClangImporter/ClangImporter.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,7 @@ class ClangImporter final : public ClangModuleLoader {
260260
/// The return value may be an empty identifier, in which case the enum would
261261
/// not be imported.
262262
///
263-
/// This is mostly an implementation detail of the importer, but is also
264-
/// used by the debugger.
263+
/// This is not used by the importer itself, but is used by the debugger.
265264
Identifier getEnumConstantName(const clang::EnumConstantDecl *enumConstant);
266265

267266
/// Writes the mangled name of \p clangDecl to \p os.

lib/ClangImporter/ImportDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7570,7 +7570,7 @@ ClangImporter::Implementation::getSpecialTypedefKind(clang::TypedefNameDecl *dec
75707570

75717571
Identifier
75727572
ClangImporter::getEnumConstantName(const clang::EnumConstantDecl *enumConstant){
7573-
return Impl.importFullName(enumConstant, ImportNameVersion::Swift3)
7573+
return Impl.importFullName(enumConstant, Impl.CurrentVersion)
75747574
.getDeclName()
75757575
.getBaseName();
75767576
}

0 commit comments

Comments
 (0)