[PATCH] D59229: Add Swift enumerator value for CodeView::SourceLanguage
Nathan Lanza via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 11 14:04:39 PDT 2019
lanza created this revision.
Herald added subscribers: llvm-commits, jdoerfert.
Herald added a project: LLVM.
Swift now generates PDBs for debugging on Windows. llvm and lldb
need a language enumerator value too properly handle the output
emitted by swiftc.
Repository:
rL LLVM
https://reviews.llvm.org/D59229
Files:
include/llvm/DebugInfo/CodeView/CodeView.h
lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
lib/DebugInfo/PDB/PDBExtras.cpp
lib/DebugInfo/PDB/PDBSymbolCompiland.cpp
tools/llvm-pdbutil/MinimalSymbolDumper.cpp
Index: tools/llvm-pdbutil/MinimalSymbolDumper.cpp
===================================================================
--- tools/llvm-pdbutil/MinimalSymbolDumper.cpp
+++ tools/llvm-pdbutil/MinimalSymbolDumper.cpp
@@ -206,6 +206,7 @@
RETURN_CASE(SourceLanguage, MSIL, "msil");
RETURN_CASE(SourceLanguage, HLSL, "hlsl");
RETURN_CASE(SourceLanguage, D, "d");
+ RETURN_CASE(SourceLanguage, Swift, "swift");
}
return formatUnknownEnum(Lang);
}
Index: lib/DebugInfo/PDB/PDBSymbolCompiland.cpp
===================================================================
--- lib/DebugInfo/PDB/PDBSymbolCompiland.cpp
+++ lib/DebugInfo/PDB/PDBSymbolCompiland.cpp
@@ -100,6 +100,7 @@
.Case(".cc", LangC)
.Case(".cxx", LangC)
.Case(".asm", Lang == PDB_Lang::Masm)
+ .Case(".swift", Lang == PDB_Lang::Swift)
.Default(false))
return File->getFileName();
}
Index: lib/DebugInfo/PDB/PDBExtras.cpp
===================================================================
--- lib/DebugInfo/PDB/PDBExtras.cpp
+++ lib/DebugInfo/PDB/PDBExtras.cpp
@@ -192,6 +192,7 @@
CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang, MSIL, OS)
CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang, HLSL, OS)
CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang, D, OS)
+ CASE_OUTPUT_ENUM_CLASS_NAME(PDB_Lang, Swift, OS)
}
return OS;
}
Index: lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
===================================================================
--- lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -699,6 +699,8 @@
return SourceLanguage::Java;
case dwarf::DW_LANG_D:
return SourceLanguage::D;
+ case dwarf::DW_LANG_Swift:
+ return SourceLanguage::Swift;
default:
// There's no CodeView representation for this language, and CV doesn't
// have an "unknown" option for the language field, so we'll use MASM,
Index: include/llvm/DebugInfo/CodeView/CodeView.h
===================================================================
--- include/llvm/DebugInfo/CodeView/CodeView.h
+++ include/llvm/DebugInfo/CodeView/CodeView.h
@@ -159,9 +159,10 @@
MSIL = 0x0f,
HLSL = 0x10,
- /// The DMD compiler emits 'D' for the CV source language. Microsoft doesn't
- /// have an enumerator for it yet.
+ /// The DMD & Swift compilers emit 'D' and 'S', respectively, for the CV
+ /// source language. Microsoft does not have enumerators for them yet.
D = 'D',
+ Swift = 'S',
};
/// These values correspond to the CV_call_e enumeration, and are documented
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59229.190151.patch
Type: text/x-patch
Size: 2570 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190311/5598626f/attachment.bin>
More information about the llvm-commits
mailing list