Skip to content

Commit 2e59c39

Browse files
committed
[llvm-debuginfo-analyzer] Add support for parsing DWARF / CodeView source language
1 parent 8832a59 commit 2e59c39

25 files changed

+106
-3
lines changed

llvm/include/llvm/DebugInfo/LogicalView/Core/LVElement.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@
1414
#ifndef LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVELEMENT_H
1515
#define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVELEMENT_H
1616

17+
#include "llvm/BinaryFormat/Dwarf.h"
18+
#include "llvm/DebugInfo/CodeView/CodeView.h"
1719
#include "llvm/DebugInfo/LogicalView/Core/LVObject.h"
1820
#include "llvm/Support/Casting.h"
1921
#include <map>
2022
#include <set>
23+
#include <variant>
2124
#include <vector>
2225

2326
namespace llvm {
@@ -64,6 +67,22 @@ using LVElementKindSet = std::set<LVElementKind>;
6467
using LVElementDispatch = std::map<LVElementKind, LVElementGetFunction>;
6568
using LVElementRequest = std::vector<LVElementGetFunction>;
6669

70+
/// A source language supported by any of the debug info representations.
71+
struct LVSourceLanguage {
72+
LVSourceLanguage() = default;
73+
LVSourceLanguage(llvm::dwarf::SourceLanguage SL) : Language(SL) {}
74+
LVSourceLanguage(llvm::codeview::SourceLanguage SL) : Language(SL) {}
75+
76+
bool isValid() const { return Language.index() != 0; }
77+
template <typename T> T getAs() { return std::get<T>(Language); }
78+
StringRef getName() const;
79+
80+
private:
81+
std::variant<std::monostate, llvm::dwarf::SourceLanguage,
82+
llvm::codeview::SourceLanguage>
83+
Language;
84+
};
85+
6786
class LVElement : public LVObject {
6887
enum class Property {
6988
IsLine, // A logical line.
@@ -214,6 +233,9 @@ class LVElement : public LVObject {
214233
virtual StringRef getProducer() const { return StringRef(); }
215234
virtual void setProducer(StringRef ProducerName) {}
216235

236+
virtual LVSourceLanguage getSourceLanguage() const { return {}; }
237+
virtual void setSourceLanguage(LVSourceLanguage SL) {}
238+
217239
virtual bool isCompileUnit() const { return false; }
218240
virtual bool isRoot() const { return false; }
219241

llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,9 @@ class LVScopeCompileUnit final : public LVScope {
407407
// Toolchain producer.
408408
size_t ProducerIndex = 0;
409409

410+
// Source language.
411+
LVSourceLanguage SourceLanguage{};
412+
410413
// Compilation directory name.
411414
size_t CompilationDirectoryIndex = 0;
412415

@@ -540,6 +543,9 @@ class LVScopeCompileUnit final : public LVScope {
540543
ProducerIndex = getStringPool().getIndex(ProducerName);
541544
}
542545

546+
LVSourceLanguage getSourceLanguage() const override { return SourceLanguage; }
547+
void setSourceLanguage(LVSourceLanguage SL) override { SourceLanguage = SL; }
548+
543549
void setCPUType(codeview::CPUType Type) { CompilationCPUType = Type; }
544550
codeview::CPUType getCPUType() { return CompilationCPUType; }
545551

llvm/lib/DebugInfo/LogicalView/Core/LVElement.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#include "llvm/DebugInfo/LogicalView/Core/LVElement.h"
14+
#include "llvm/DebugInfo/CodeView/EnumTables.h"
1415
#include "llvm/DebugInfo/LogicalView/Core/LVReader.h"
1516
#include "llvm/DebugInfo/LogicalView/Core/LVScope.h"
1617
#include "llvm/DebugInfo/LogicalView/Core/LVType.h"
@@ -19,6 +20,23 @@ using namespace llvm;
1920
using namespace llvm::codeview;
2021
using namespace llvm::logicalview;
2122

23+
StringRef LVSourceLanguage::getName() const {
24+
if (!isValid())
25+
return {};
26+
switch (Language.index()) {
27+
case 1: // DWARF
28+
return llvm::dwarf::LanguageString(
29+
std::get<llvm::dwarf::SourceLanguage>(Language));
30+
case 2: // CodeView
31+
{
32+
static auto LangNames = llvm::codeview::getSourceLanguageNames();
33+
return LangNames[std::get<llvm::codeview::SourceLanguage>(Language)].Name;
34+
}
35+
default:
36+
llvm_unreachable("Unsupported language");
37+
}
38+
}
39+
2240
#define DEBUG_TYPE "Element"
2341

2442
LVElementDispatch LVElement::Dispatch = {

llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1707,11 +1707,17 @@ void LVScopeCompileUnit::print(raw_ostream &OS, bool Full) const {
17071707

17081708
void LVScopeCompileUnit::printExtra(raw_ostream &OS, bool Full) const {
17091709
OS << formattedKind(kind()) << " '" << getName() << "'\n";
1710-
if (options().getPrintFormatting() && options().getAttributeProducer())
1710+
if (options().getPrintFormatting() && options().getAttributeProducer()) {
17111711
printAttributes(OS, Full, "{Producer} ",
17121712
const_cast<LVScopeCompileUnit *>(this), getProducer(),
17131713
/*UseQuotes=*/true,
17141714
/*PrintRef=*/false);
1715+
if (auto SL = getSourceLanguage(); SL.isValid())
1716+
printAttributes(OS, Full, "{Language} ",
1717+
const_cast<LVScopeCompileUnit *>(this), SL.getName(),
1718+
/*UseQuotes=*/true,
1719+
/*PrintRef=*/false);
1720+
}
17151721

17161722
// Reset file index, to allow its children to print the correct filename.
17171723
options().resetFilenameIndex();

llvm/lib/DebugInfo/LogicalView/Readers/LVCodeViewVisitor.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,8 +947,11 @@ Error LVSymbolVisitor::visitKnownRecord(CVSymbol &Record,
947947
// The name of the CU, was extracted from the 'BuildInfo' subsection.
948948
Reader->setCompileUnitCPUType(Compile2.Machine);
949949
Scope->setName(CurrentObjectName);
950-
if (options().getAttributeProducer())
950+
if (options().getAttributeProducer()) {
951951
Scope->setProducer(Compile2.Version);
952+
Scope->setSourceLanguage(LVSourceLanguage{
953+
static_cast<llvm::codeview::SourceLanguage>(Compile2.getLanguage())});
954+
}
952955
getReader().isSystemEntry(Scope, CurrentObjectName);
953956

954957
// The line records in CodeView are recorded per Module ID. Update
@@ -992,8 +995,11 @@ Error LVSymbolVisitor::visitKnownRecord(CVSymbol &Record,
992995
// The name of the CU, was extracted from the 'BuildInfo' subsection.
993996
Reader->setCompileUnitCPUType(Compile3.Machine);
994997
Scope->setName(CurrentObjectName);
995-
if (options().getAttributeProducer())
998+
if (options().getAttributeProducer()) {
996999
Scope->setProducer(Compile3.Version);
1000+
Scope->setSourceLanguage(LVSourceLanguage{
1001+
static_cast<llvm::codeview::SourceLanguage>(Compile3.getLanguage())});
1002+
}
9971003
getReader().isSystemEntry(Scope, CurrentObjectName);
9981004

9991005
// The line records in CodeView are recorded per Module ID. Update

llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,11 @@ void LVDWARFReader::processOneAttribute(const DWARFDie &Die,
383383
if (options().getAttributeProducer())
384384
CurrentElement->setProducer(dwarf::toStringRef(FormValue));
385385
break;
386+
case dwarf::DW_AT_language:
387+
if (options().getAttributeProducer())
388+
CurrentElement->setSourceLanguage(LVSourceLanguage{
389+
static_cast<llvm::dwarf::SourceLanguage>(GetAsUnsignedConstant())});
390+
break;
386391
case dwarf::DW_AT_upper_bound:
387392
CurrentElement->setUpperBound(GetBoundValue(FormValue));
388393
break;

llvm/test/tools/llvm-debuginfo-analyzer/COFF/02-coff-logical-lines.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
; ONE-EMPTY:
2727
; ONE-NEXT: [001] {CompileUnit} 'hello-world.cpp'
2828
; ONE-NEXT: [002] {Producer} 'clang version 15.0.0 {{.*}}'
29+
; ONE-NEXT: [002] {Language} 'Cpp'
2930
; ONE-NEXT: [002] {Function} extern not_inlined 'main' -> 'int'
3031
; ONE-NEXT: [003] 4 {Line}
3132
; ONE-NEXT: [003] {Code} 'subq $0x28, %rsp'
@@ -43,6 +44,7 @@
4344
; ONE-EMPTY:
4445
; ONE-NEXT: [001] {CompileUnit} 'hello-world.cpp'
4546
; ONE-NEXT: [002] {Producer} 'Microsoft (R) Optimizing Compiler'
47+
; ONE-NEXT: [002] {Language} 'Cpp'
4648
; ONE-NEXT: [002] {Function} extern not_inlined 'main' -> 'int'
4749
; ONE-NEXT: [003] 4 {Line}
4850
; ONE-NEXT: [003] {Code} 'subq $0x28, %rsp'

llvm/test/tools/llvm-debuginfo-analyzer/COFF/03-coff-incorrect-lexical-scope-typedef.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
; ONE-EMPTY:
4343
; ONE-NEXT: [001] {CompileUnit} 'pr-44884.cpp'
4444
; ONE-NEXT: [002] {Producer} 'clang version 15.0.0 {{.*}}'
45+
; ONE-NEXT: [002] {Language} 'Cpp'
4546
; ONE-NEXT: [002] {Function} extern not_inlined 'bar' -> 'int'
4647
; ONE-NEXT: [003] {Parameter} 'Input' -> 'float'
4748
; ONE-NEXT: [003] 1 {Line}
@@ -63,6 +64,7 @@
6364
; ONE-EMPTY:
6465
; ONE-NEXT: [001] {CompileUnit} 'pr-44884.cpp'
6566
; ONE-NEXT: [002] {Producer} 'Microsoft (R) Optimizing Compiler'
67+
; ONE-NEXT: [002] {Language} 'Cpp'
6668
; ONE-NEXT: [002] {Function} extern not_inlined 'bar' -> 'int'
6769
; ONE-NEXT: [003] {Variable} 'Input' -> 'float'
6870
; ONE-NEXT: [003] 1 {Line}

llvm/test/tools/llvm-debuginfo-analyzer/COFF/04-coff-missing-nested-enumerators.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
; ONE-EMPTY:
3838
; ONE-NEXT: [001] {CompileUnit} 'pr-46466.cpp'
3939
; ONE-NEXT: [002] {Producer} 'clang version 15.0.0 {{.*}}'
40+
; ONE-NEXT: [002] {Language} 'Cpp'
4041
; ONE-NEXT: [002] {Variable} extern 'S' -> 'Struct'
4142
; ONE-NEXT: [002] 1 {Struct} 'Struct'
4243
; ONE-NEXT: [003] {Member} public 'U' -> 'Union'
@@ -50,6 +51,7 @@
5051
; ONE-EMPTY:
5152
; ONE-NEXT: [001] {CompileUnit} 'pr-46466.cpp'
5253
; ONE-NEXT: [002] {Producer} 'Microsoft (R) Optimizing Compiler'
54+
; ONE-NEXT: [002] {Language} 'Cpp'
5355
; ONE-NEXT: [002] {Variable} extern 'S' -> 'Struct'
5456
; ONE-NEXT: [002] 1 {Struct} 'Struct'
5557
; ONE-NEXT: [003] {Member} public 'U' -> 'Union'

llvm/test/tools/llvm-debuginfo-analyzer/COFF/05-coff-incorrect-lexical-scope-variable.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
; ONE-EMPTY:
4444
; ONE-NEXT: [001] {CompileUnit} 'pr-43860.cpp'
4545
; ONE-NEXT: [002] {Producer} 'clang version 15.0.0 {{.*}}'
46+
; ONE-NEXT: [002] {Language} 'Cpp'
4647
; ONE-NEXT: [002] 2 {Function} inlined 'InlineFunction' -> 'int'
4748
; ONE-NEXT: [003] {Parameter} '' -> 'int'
4849
; ONE-NEXT: [002] {Function} extern not_inlined 'test' -> 'int'
@@ -59,6 +60,7 @@
5960
; ONE-EMPTY:
6061
; ONE-NEXT: [001] {CompileUnit} 'pr-43860.cpp'
6162
; ONE-NEXT: [002] {Producer} 'Microsoft (R) Optimizing Compiler'
63+
; ONE-NEXT: [002] {Language} 'Cpp'
6264
; ONE-NEXT: [002] {Function} extern declared_inlined 'InlineFunction' -> 'int'
6365
; ONE-NEXT: [003] {Block}
6466
; ONE-NEXT: [004] {Variable} 'Var_2' -> 'int'

llvm/test/tools/llvm-debuginfo-analyzer/COFF/06-coff-full-logical-view.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
; ONE-EMPTY:
2929
; ONE-NEXT: [0x0000000000][001] {CompileUnit} 'test.cpp'
3030
; ONE-NEXT: [0x0000000000][002] {Producer} 'clang version 15.0.0 {{.*}}'
31+
; ONE-NEXT: [0x0000000000][002] {Language} 'Cpp'
3132
; ONE-NEXT: {Directory} 'test.cpp'
3233
; ONE-NEXT: {Directory} 'x:/tests/input'
3334
; ONE-NEXT: {File} 'general'

llvm/test/tools/llvm-debuginfo-analyzer/DWARF/02-dwarf-logical-lines.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
; ONE-EMPTY:
2727
; ONE-NEXT: [001] {CompileUnit} 'hello-world.cpp'
2828
; ONE-NEXT: [002] {Producer} 'clang version 15.0.0 {{.*}}'
29+
; ONE-NEXT: [002] {Language} 'DW_LANG_C_plus_plus_14'
2930
; ONE-NEXT: [002] 3 {Function} extern not_inlined 'main' -> 'int'
3031
; ONE-NEXT: [003] 4 {Line}
3132
; ONE-NEXT: [003] {Code} 'pushq %rbp'
@@ -48,6 +49,7 @@
4849
; ONE-EMPTY:
4950
; ONE-NEXT: [001] {CompileUnit} 'hello-world.cpp'
5051
; ONE-NEXT: [002] {Producer} 'GNU C++14 10.3.0 {{.*}}'
52+
; ONE-NEXT: [002] {Language} 'DW_LANG_C_plus_plus'
5153
; ONE-NEXT: [002] 3 {Function} extern not_inlined 'main' -> 'int'
5254
; ONE-NEXT: [003] 4 {Line}
5355
; ONE-NEXT: [003] {Code} 'endbr64'

llvm/test/tools/llvm-debuginfo-analyzer/DWARF/03-dwarf-incorrect-lexical-scope-typedef.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
; ONE-EMPTY:
4343
; ONE-NEXT: [001] {CompileUnit} 'pr-44884.cpp'
4444
; ONE-NEXT: [002] {Producer} 'clang version 15.0.0 {{.*}}'
45+
; ONE-NEXT: [002] {Language} 'DW_LANG_C_plus_plus_14'
4546
; ONE-NEXT: [002] 1 {Function} extern not_inlined 'bar' -> 'int'
4647
; ONE-NEXT: [003] 1 {Parameter} 'Input' -> 'float'
4748
; ONE-NEXT: [003] 1 {Line}
@@ -76,6 +77,7 @@
7677
; ONE-EMPTY:
7778
; ONE-NEXT: [001] {CompileUnit} 'pr-44884.cpp'
7879
; ONE-NEXT: [002] {Producer} 'GNU C++14 10.3.0 {{.*}}'
80+
; ONE-NEXT: [002] {Language} 'DW_LANG_C_plus_plus'
7981
; ONE-NEXT: [002] 1 {Function} extern not_inlined 'bar' -> 'int'
8082
; ONE-NEXT: [003] 1 {Parameter} 'Input' -> 'float'
8183
; ONE-NEXT: [003] 1 {Line}

llvm/test/tools/llvm-debuginfo-analyzer/DWARF/04-dwarf-missing-nested-enumerators.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
; ONE-EMPTY:
3838
; ONE-NEXT: [001] {CompileUnit} 'pr-46466.cpp'
3939
; ONE-NEXT: [002] {Producer} 'clang version 15.0.0 {{.*}}'
40+
; ONE-NEXT: [002] {Language} 'DW_LANG_C_plus_plus_14'
4041
; ONE-NEXT: [002] 8 {Variable} extern 'S' -> 'Struct'
4142
; ONE-NEXT: [002] 1 {Struct} 'Struct'
4243
; ONE-NEXT: [003] 5 {Member} public 'U' -> 'Union'
@@ -46,6 +47,7 @@
4647
; ONE-EMPTY:
4748
; ONE-NEXT: [001] {CompileUnit} 'pr-46466.cpp'
4849
; ONE-NEXT: [002] {Producer} 'GNU C++14 10.3.0 {{.*}}'
50+
; ONE-NEXT: [002] {Language} 'DW_LANG_C_plus_plus'
4951
; ONE-NEXT: [002] 8 {Variable} extern 'S' -> 'Struct'
5052
; ONE-NEXT: [002] 1 {Struct} 'Struct'
5153
; ONE-NEXT: [003] 5 {Member} public 'U' -> 'Union'

llvm/test/tools/llvm-debuginfo-analyzer/DWARF/05-dwarf-incorrect-lexical-scope-variable.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
; ONE-EMPTY:
4444
; ONE-NEXT: [001] {CompileUnit} 'pr-43860.cpp'
4545
; ONE-NEXT: [002] {Producer} 'clang version 15.0.0 {{.*}}'
46+
; ONE-NEXT: [002] {Language} 'DW_LANG_C_plus_plus_14'
4647
; ONE-NEXT: [002] 2 {Function} extern inlined 'InlineFunction' -> 'int'
4748
; ONE-NEXT: [003] {Block}
4849
; ONE-NEXT: [004] 5 {Variable} 'Var_2' -> 'int'
@@ -63,6 +64,7 @@
6364
; ONE-EMPTY:
6465
; ONE-NEXT: [001] {CompileUnit} 'pr-43860.cpp'
6566
; ONE-NEXT: [002] {Producer} 'GNU C++14 10.3.0 {{.*}}'
67+
; ONE-NEXT: [002] {Language} 'DW_LANG_C_plus_plus'
6668
; ONE-NEXT: [002] 2 {Function} extern declared_inlined 'InlineFunction' -> 'int'
6769
; ONE-NEXT: [003] {Block}
6870
; ONE-NEXT: [004] 5 {Variable} 'Var_2' -> 'int'

llvm/test/tools/llvm-debuginfo-analyzer/DWARF/06-dwarf-full-logical-view.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
; ONE-EMPTY:
2929
; ONE-NEXT: [0x000000000b][001] {CompileUnit} 'test.cpp'
3030
; ONE-NEXT: [0x000000000b][002] {Producer} 'clang version 15.0.0 {{.*}}'
31+
; ONE-NEXT: [0x000000000b][002] {Language} 'DW_LANG_C_plus_plus_14'
3132
; ONE-NEXT: {Directory} '/data/projects/tests/input/general'
3233
; ONE-NEXT: {File} 'test.cpp'
3334
; ONE-NEXT: {Public} 'foo' [0x0000000000:0x000000003a]

llvm/test/tools/llvm-debuginfo-analyzer/DWARF/pr-57040-ignored-DW_FORM_implicit_const.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
; ONE-EMPTY:
3939
; ONE-NEXT: [001] {CompileUnit} 'test.cpp'
4040
; ONE-NEXT: [002] {Producer} 'clang version 14.0.6'
41+
; ONE-NEXT: [002] {Language} 'DW_LANG_C_plus_plus_14'
4142
; ONE-NEXT: [002] 1 {TypeAlias} 'INTPTR' -> '* const int'
4243
; ONE-NEXT: [002] 2 {Function} extern not_inlined 'foo' -> 'int'
4344
; ONE-NEXT: [003] {Block}
@@ -57,6 +58,7 @@
5758
; TWO-EMPTY:
5859
; TWO-NEXT: [001] {CompileUnit} 'test.cpp'
5960
; TWO-NEXT: [002] {Producer} 'GNU C++17 11.3.0 {{.*}}'
61+
; TWO-NEXT: [002] {Language} 'DW_LANG_C_plus_plus_14'
6062
; TWO-NEXT: [002] 1 {TypeAlias} 'INTPTR' -> '* const int'
6163
; TWO-NEXT: [002] 2 {Function} extern not_inlined 'foo' -> 'int'
6264
; TWO-NEXT: [003] {Block}

llvm/test/tools/llvm-debuginfo-analyzer/DWARF/pr-57040-incorrect-function-compare.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
; ONE-EMPTY:
5252
; ONE-NEXT: [001] {CompileUnit} 'test.cpp'
5353
; ONE-NEXT: [002] {Producer} 'clang version 14.0.6'
54+
; ONE-NEXT: [002] {Language} 'DW_LANG_C_plus_plus_14'
5455
; ONE-NEXT: [002] 1 {TypeAlias} 'INTPTR' -> '* const int'
5556
; ONE-NEXT: [002] 2 {Function} extern not_inlined 'foo' -> 'int'
5657
; ONE-NEXT: [003] {Block}
@@ -106,6 +107,7 @@
106107
; THR-EMPTY:
107108
; THR-NEXT: [001] {CompileUnit} 'test.cpp'
108109
; THR-NEXT: [002] {Producer} 'GNU C++17 11.3.0 {{.*}}'
110+
; THR-NEXT: [002] {Language} 'DW_LANG_C_plus_plus_14'
109111
; THR-NEXT: [002] 1 {TypeAlias} 'INTPTR' -> '* const int'
110112
; THR-NEXT: [002] 2 {Function} extern not_inlined 'foo' -> 'int'
111113
; THR-NEXT: [003] {Block}

llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/02-wasm-logical-lines.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
; ONE-EMPTY:
2929
; ONE-NEXT: [001] {CompileUnit} 'hello-world.cpp'
3030
; ONE-NEXT: [002] {Producer} 'clang version 19{{.*}}'
31+
; ONE-NEXT: [002] {Language} 'DW_LANG_C_plus_plus_14'
3132
; ONE-NEXT: [002] 3 {Function} extern not_inlined 'main' -> 'int'
3233
; ONE-NEXT: [003] 4 {Line}
3334
; ONE-NEXT: [003] {Code} 'nop'

llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/03-wasm-incorrect-lexical-scope-typedef.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
; ONE-EMPTY:
4646
; ONE-NEXT: [001] {CompileUnit} 'pr-44884.cpp'
4747
; ONE-NEXT: [002] {Producer} 'clang version 19{{.*}}'
48+
; ONE-NEXT: [002] {Language} 'DW_LANG_C_plus_plus_14'
4849
; ONE-NEXT: [002] 1 {Function} extern not_inlined 'bar' -> 'int'
4950
; ONE-NEXT: [003] 1 {Parameter} 'Input' -> 'float'
5051
; ONE-NEXT: [003] 1 {Line}
@@ -84,6 +85,7 @@
8485
; ONE-EMPTY:
8586
; ONE-NEXT: [001] {CompileUnit} 'pr-44884.cpp'
8687
; ONE-NEXT: [002] {Producer} 'GNU C++14 10.3.0 {{.*}}'
88+
; ONE-NEXT: [002] {Language} 'DW_LANG_C_plus_plus'
8789
; ONE-NEXT: [002] 1 {Function} extern not_inlined 'bar' -> 'int'
8890
; ONE-NEXT: [003] 1 {Parameter} 'Input' -> 'float'
8991
; ONE-NEXT: [003] 1 {Line}

llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/04-wasm-missing-nested-enumerators.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
; ONE-EMPTY:
4141
; ONE-NEXT: [001] {CompileUnit} 'pr-46466.cpp'
4242
; ONE-NEXT: [002] {Producer} 'clang version 19{{.*}}'
43+
; ONE-NEXT: [002] {Language} 'DW_LANG_C_plus_plus_14'
4344
; ONE-NEXT: [002] 8 {Variable} extern 'S' -> 'Struct'
4445
; ONE-NEXT: [002] 1 {Struct} 'Struct'
4546
; ONE-NEXT: [003] 5 {Member} public 'U' -> 'Union'
@@ -49,6 +50,7 @@
4950
; ONE-EMPTY:
5051
; ONE-NEXT: [001] {CompileUnit} 'pr-46466.cpp'
5152
; ONE-NEXT: [002] {Producer} 'GNU C++14 10.3.0 {{.*}}'
53+
; ONE-NEXT: [002] {Language} 'DW_LANG_C_plus_plus'
5254
; ONE-NEXT: [002] 8 {Variable} extern 'S' -> 'Struct'
5355
; ONE-NEXT: [002] 1 {Struct} 'Struct'
5456
; ONE-NEXT: [003] 5 {Member} public 'U' -> 'Union'

llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/05-wasm-incorrect-lexical-scope-variable.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
; ONE-EMPTY:
4747
; ONE-NEXT: [001] {CompileUnit} 'pr-43860.cpp'
4848
; ONE-NEXT: [002] {Producer} 'clang version 19{{.*}}'
49+
; ONE-NEXT: [002] {Language} 'DW_LANG_C_plus_plus_14'
4950
; ONE-NEXT: [002] 2 {Function} extern inlined 'InlineFunction' -> 'int'
5051
; ONE-NEXT: [003] {Block}
5152
; ONE-NEXT: [004] 5 {Variable} 'Var_2' -> 'int'
@@ -66,6 +67,7 @@
6667
; ONE-EMPTY:
6768
; ONE-NEXT: [001] {CompileUnit} 'pr-43860.cpp'
6869
; ONE-NEXT: [002] {Producer} 'GNU C++14 10.3.0 {{.*}}'
70+
; ONE-NEXT: [002] {Language} 'DW_LANG_C_plus_plus'
6971
; ONE-NEXT: [002] 2 {Function} extern declared_inlined 'InlineFunction' -> 'int'
7072
; ONE-NEXT: [003] {Block}
7173
; ONE-NEXT: [004] 5 {Variable} 'Var_2' -> 'int'

llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/06-wasm-full-logical-view.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
; ONE-EMPTY:
3232
; ONE-NEXT: [0x000000000b][001] {CompileUnit} 'test.cpp'
3333
; ONE-NEXT: [0x000000000b][002] {Producer} 'clang version 19{{.*}}'
34+
; ONE-NEXT: [0x000000000b][002] {Language} 'DW_LANG_C_plus_plus_14'
3435
; ONE-NEXT: {Directory} '{{.*}}/general'
3536
; ONE-NEXT: {File} 'test.cpp'
3637
; ONE-NEXT: {Public} 'foo' [0x0000000002:0x000000007f]

0 commit comments

Comments
 (0)