Skip to content
This repository was archived by the owner on Dec 20, 2019. It is now read-only.

Commit 6e7d825

Browse files
rnkkinke
authored andcommitted
LDC: Cherry-pick CodeView D language support (svn308890)
llvm-mirror/llvm@7811635 [codeview] Emit 'D' as the cv source language for D code This matches DMD: https://github.com/dlang/dmd/blob/522263965cf3a27ed16b31f3c3562db86cdeabec/src/ddmd/backend/cv8.c#L199 Fixes PR33899. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308890 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 8655f32 commit 6e7d825

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

include/llvm/DebugInfo/CodeView/CodeView.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,11 @@ enum SourceLanguage : uint8_t {
151151
Java = 0x0d,
152152
JScript = 0x0e,
153153
MSIL = 0x0f,
154-
HLSL = 0x10
154+
HLSL = 0x10,
155+
156+
/// The DMD compiler emits 'D' for the CV source language. Microsoft doesn't
157+
/// have an enumerator for it yet.
158+
D = 'D',
155159
};
156160

157161
/// These values correspond to the CV_call_e enumeration, and are documented

lib/CodeGen/AsmPrinter/CodeViewDebug.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,8 @@ static SourceLanguage MapDWLangToCVLang(unsigned DWLang) {
541541
return SourceLanguage::Cobol;
542542
case dwarf::DW_LANG_Java:
543543
return SourceLanguage::Java;
544+
case dwarf::DW_LANG_D:
545+
return SourceLanguage::D;
544546
default:
545547
// There's no CodeView representation for this language, and CV doesn't
546548
// have an "unknown" option for the language field, so we'll use MASM,

lib/DebugInfo/CodeView/EnumTables.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static const EnumEntry<codeview::SourceLanguage> SourceLanguages[] = {
123123
CV_ENUM_ENT(SourceLanguage, CSharp), CV_ENUM_ENT(SourceLanguage, VB),
124124
CV_ENUM_ENT(SourceLanguage, ILAsm), CV_ENUM_ENT(SourceLanguage, Java),
125125
CV_ENUM_ENT(SourceLanguage, JScript), CV_ENUM_ENT(SourceLanguage, MSIL),
126-
CV_ENUM_ENT(SourceLanguage, HLSL),
126+
CV_ENUM_ENT(SourceLanguage, HLSL), CV_ENUM_ENT(SourceLanguage, D),
127127
};
128128

129129
static const EnumEntry<uint32_t> CompileSym2FlagNames[] = {

0 commit comments

Comments
 (0)