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

Commit 64f4e71

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 f0682e1 commit 64f4e71

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
@@ -157,7 +157,11 @@ enum SourceLanguage : uint8_t {
157157
Java = 0x0d,
158158
JScript = 0x0e,
159159
MSIL = 0x0f,
160-
HLSL = 0x10
160+
HLSL = 0x10,
161+
162+
/// The DMD compiler emits 'D' for the CV source language. Microsoft doesn't
163+
/// have an enumerator for it yet.
164+
D = 'D',
161165
};
162166

163167
/// 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
@@ -572,6 +572,8 @@ static SourceLanguage MapDWLangToCVLang(unsigned DWLang) {
572572
return SourceLanguage::Cobol;
573573
case dwarf::DW_LANG_Java:
574574
return SourceLanguage::Java;
575+
case dwarf::DW_LANG_D:
576+
return SourceLanguage::D;
575577
default:
576578
// There's no CodeView representation for this language, and CV doesn't
577579
// 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
@@ -132,7 +132,7 @@ static const EnumEntry<codeview::SourceLanguage> SourceLanguages[] = {
132132
CV_ENUM_ENT(SourceLanguage, CSharp), CV_ENUM_ENT(SourceLanguage, VB),
133133
CV_ENUM_ENT(SourceLanguage, ILAsm), CV_ENUM_ENT(SourceLanguage, Java),
134134
CV_ENUM_ENT(SourceLanguage, JScript), CV_ENUM_ENT(SourceLanguage, MSIL),
135-
CV_ENUM_ENT(SourceLanguage, HLSL),
135+
CV_ENUM_ENT(SourceLanguage, HLSL), CV_ENUM_ENT(SourceLanguage, D),
136136
};
137137

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

0 commit comments

Comments
 (0)