Skip to content

Commit 525a591

Browse files
committed
Revert 76c5f27 "Re-land [Debug][CodeView] Emit fully qualified names for globals"
> Before this patch, S_[L|G][THREAD32|DATA32] records were emitted with a simple name, not the fully qualified name (namespace + class scope). > > Differential Revision: https://reviews.llvm.org/D79447 This causes asserts in Chromium builds: CodeViewDebug.cpp:2997: void llvm::CodeViewDebug::emitDebugInfoForUDTs(const std::vector<std::pair<std::string, const DIType *>> &): Assertion `OriginalSize == UDTs.size()' failed. I will follow up on the Phabricator issue.
1 parent 4f0cc10 commit 525a591

File tree

7 files changed

+330
-547
lines changed

7 files changed

+330
-547
lines changed

lldb/test/Shell/SymbolFile/PDB/variables.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ GLOBALS: SymbolFile pdb ([[MOD]])
1313
GLOBALS: CompileUnit{{.*}}, language = "c++", file = '{{.*}}\VariablesTest.cpp'
1414
GLOBALS-DAG: Variable{{.*}}, name = "g_IntVar"
1515
GLOBALS-SAME: scope = global, location = {{.*}}, external
16+
GLOBALS-DAG: Variable{{.*}}, name = "m_StaticClassMember"
17+
GLOBALS-SAME: scope = global, location = {{.*}}, external
1618
GLOBALS-DAG: Variable{{.*}}, name = "g_pConst"
1719
GLOBALS-SAME: scope = global, location = {{.*}}, external
1820
GLOBALS-DAG: Variable{{.*}}, name = "same_name_var"
1921
GLOBALS-SAME: scope = global, location = {{.*}}, external
20-
GLOBALS-DAG: Variable{{.*}}, name = "Class::m_StaticClassMember"
21-
GLOBALS-SAME: scope = global, location = {{.*}}, external
2222
GLOBALS-DAG: Variable{{.*}}, name = "g_EnumVar"
2323
GLOBALS-SAME: scope = global, location = {{.*}}, external
2424
GLOBALS-DAG: Variable{{.*}}, name = "g_tls"

llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -343,24 +343,8 @@ static std::string formatNestedName(ArrayRef<StringRef> QualifiedNameComponents,
343343
return FullyQualifiedName;
344344
}
345345

346-
struct CodeViewDebug::TypeLoweringScope {
347-
TypeLoweringScope(CodeViewDebug &CVD) : CVD(CVD) { ++CVD.TypeEmissionLevel; }
348-
~TypeLoweringScope() {
349-
// Don't decrement TypeEmissionLevel until after emitting deferred types, so
350-
// inner TypeLoweringScopes don't attempt to emit deferred types.
351-
if (CVD.TypeEmissionLevel == 1)
352-
CVD.emitDeferredCompleteTypes();
353-
--CVD.TypeEmissionLevel;
354-
}
355-
CodeViewDebug &CVD;
356-
};
357-
358346
std::string CodeViewDebug::getFullyQualifiedName(const DIScope *Scope,
359347
StringRef Name) {
360-
// Ensure types in the scope chain are emitted as soon as possible.
361-
// This can create otherwise a situation where S_UDTs are emitted while
362-
// looping in emitDebugInfoForUDTs.
363-
TypeLoweringScope S(*this);
364348
SmallVector<StringRef, 5> QualifiedNameComponents;
365349
collectParentScopeNames(Scope, QualifiedNameComponents);
366350
return formatNestedName(QualifiedNameComponents, Name);
@@ -371,6 +355,18 @@ std::string CodeViewDebug::getFullyQualifiedName(const DIScope *Ty) {
371355
return getFullyQualifiedName(Scope, getPrettyScopeName(Ty));
372356
}
373357

358+
struct CodeViewDebug::TypeLoweringScope {
359+
TypeLoweringScope(CodeViewDebug &CVD) : CVD(CVD) { ++CVD.TypeEmissionLevel; }
360+
~TypeLoweringScope() {
361+
// Don't decrement TypeEmissionLevel until after emitting deferred types, so
362+
// inner TypeLoweringScopes don't attempt to emit deferred types.
363+
if (CVD.TypeEmissionLevel == 1)
364+
CVD.emitDeferredCompleteTypes();
365+
--CVD.TypeEmissionLevel;
366+
}
367+
CodeViewDebug &CVD;
368+
};
369+
374370
TypeIndex CodeViewDebug::getScopeIndex(const DIScope *Scope) {
375371
// No scope means global scope and that uses the zero index.
376372
if (!Scope || isa<DIFile>(Scope))
@@ -2985,16 +2981,10 @@ void CodeViewDebug::emitEndSymbolRecord(SymbolKind EndKind) {
29852981
}
29862982

29872983
void CodeViewDebug::emitDebugInfoForUDTs(
2988-
const std::vector<std::pair<std::string, const DIType *>> &UDTs) {
2989-
#ifndef NDEBUG
2990-
size_t OriginalSize = UDTs.size();
2991-
#endif
2984+
ArrayRef<std::pair<std::string, const DIType *>> UDTs) {
29922985
for (const auto &UDT : UDTs) {
29932986
const DIType *T = UDT.second;
29942987
assert(shouldEmitUdt(T));
2995-
// Ensure no new types are discovered when executing the code below.
2996-
// See discussion in https://reviews.llvm.org/D79512
2997-
assert(OriginalSize == UDTs.size());
29982988

29992989
MCSymbol *UDTRecordEnd = beginSymbolRecord(SymbolKind::S_UDT);
30002990
OS.AddComment("Type");
@@ -3102,14 +3092,6 @@ void CodeViewDebug::emitGlobalVariableList(ArrayRef<CVGlobalVariable> Globals) {
31023092

31033093
void CodeViewDebug::emitDebugInfoForGlobal(const CVGlobalVariable &CVGV) {
31043094
const DIGlobalVariable *DIGV = CVGV.DIGV;
3105-
3106-
const DIScope *Scope = DIGV->getScope();
3107-
// For static data members, get the scope from the declaration.
3108-
if (const auto *MemberDecl = dyn_cast_or_null<DIDerivedType>(
3109-
DIGV->getRawStaticDataMemberDeclaration()))
3110-
Scope = MemberDecl->getScope();
3111-
std::string QualifiedName = getFullyQualifiedName(Scope, DIGV->getName());
3112-
31133095
if (const GlobalVariable *GV =
31143096
CVGV.GVInfo.dyn_cast<const GlobalVariable *>()) {
31153097
// DataSym record, see SymbolRecord.h for more info. Thread local data
@@ -3129,9 +3111,13 @@ void CodeViewDebug::emitDebugInfoForGlobal(const CVGlobalVariable &CVGV) {
31293111
OS.EmitCOFFSectionIndex(GVSym);
31303112
OS.AddComment("Name");
31313113
const unsigned LengthOfDataRecord = 12;
3132-
emitNullTerminatedSymbolName(OS, QualifiedName, LengthOfDataRecord);
3114+
emitNullTerminatedSymbolName(
3115+
OS, getFullyQualifiedName(DIGV->getScope(), DIGV->getName()),
3116+
LengthOfDataRecord);
31333117
endSymbolRecord(DataEnd);
31343118
} else {
3119+
// FIXME: Currently this only emits the global variables in the IR metadata.
3120+
// This should also emit enums and static data members.
31353121
const DIExpression *DIE = CVGV.GVInfo.get<const DIExpression *>();
31363122
assert(DIE->isConstant() &&
31373123
"Global constant variables must contain a constant expression.");
@@ -3151,7 +3137,13 @@ void CodeViewDebug::emitDebugInfoForGlobal(const CVGlobalVariable &CVGV) {
31513137
OS.emitBinaryData(SRef);
31523138

31533139
OS.AddComment("Name");
3154-
emitNullTerminatedSymbolName(OS, QualifiedName);
3140+
const DIScope *Scope = DIGV->getScope();
3141+
// For static data members, get the scope from the declaration.
3142+
if (const auto *MemberDecl = dyn_cast_or_null<DIDerivedType>(
3143+
DIGV->getRawStaticDataMemberDeclaration()))
3144+
Scope = MemberDecl->getScope();
3145+
emitNullTerminatedSymbolName(OS,
3146+
getFullyQualifiedName(Scope, DIGV->getName()));
31553147
endSymbolRecord(SConstantEnd);
31563148
}
31573149
}

llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,8 @@ class LLVM_LIBRARY_VISIBILITY CodeViewDebug : public DebugHandlerBase {
310310

311311
void emitDebugInfoForRetainedTypes();
312312

313-
void emitDebugInfoForUDTs(
314-
const std::vector<std::pair<std::string, const DIType *>> &UDTs);
313+
void
314+
emitDebugInfoForUDTs(ArrayRef<std::pair<std::string, const DIType *>> UDTs);
315315

316316
void emitDebugInfoForGlobals();
317317
void emitGlobalVariableList(ArrayRef<CVGlobalVariable> Globals);
Lines changed: 105 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
; RUN: llc < %s | FileCheck %s --check-prefix=ASM
22
; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s --check-prefix=OBJ
33

4-
; // C++ source to regenerate:
4+
; C++ source to regenerate:
55
; namespace Test1 {
66
; const float TestConst1 = 3.14;
77
; }
88
; struct S {
99
; static const int TestConst2 = -10;
1010
; enum { SEnum = 42 };
11-
; };
11+
; }
1212
; enum TestEnum : int {
13-
; ENUM_A = 2147000000,
14-
; ENUM_B = -2147000000,
13+
; ENUM_A = 2147000000,
14+
; ENUM_B = -2147000000,
1515
; };
1616
; void useConst(int);
1717
; void foo() {
@@ -20,33 +20,27 @@
2020
; useConst(ENUM_B);
2121
; useConst(S::SEnum);
2222
; }
23-
;
24-
; $ clang a.cpp -S -emit-llvm -g -gcodeview
23+
; $ clang t.cpp -S -emit-llvm -g -gcodeview -o t.ll
2524

2625
; ASM-LABEL: .long 241 # Symbol subsection for globals
27-
28-
; ASM: .short 4359 # Record kind: S_CONSTANT
29-
; ASM-NEXT: .long 4099 # Type
30-
; ASM-NEXT: .byte 0x04, 0x80, 0xc3, 0xf5 # Value
31-
; ASM-NEXT: .byte 0x48, 0x40
32-
; ASM-NEXT: .asciz "Test1::TestConst1" # Name
33-
; ASM-NEXT: .p2align 2
34-
35-
; ASM: .short 4359 # Record kind: S_CONSTANT
36-
; ASM-NEXT: .long 4101 # Type
37-
; ASM-NEXT: .byte 0x0a, 0x80, 0xf6, 0xff # Value
38-
; ASM-NEXT: .byte 0xff, 0xff, 0xff, 0xff
39-
; ASM-NEXT: .byte 0xff, 0xff
40-
; ASM-NEXT: .asciz "S::TestConst2" # Name
41-
; ASM-NEXT: .p2align 2
42-
43-
; ASM: .short 4359 # Record kind: S_CONSTANT
44-
; ASM-NEXT: .long 4110 # Type
45-
; ASM-NEXT: .byte 0x0a, 0x80, 0x40, 0x61 # Value
46-
; ASM-NEXT: .byte 0x07, 0x80, 0xff, 0xff
47-
; ASM-NEXT: .byte 0xff, 0xff
48-
; ASM-NEXT: .asciz "ENUM_B" # Name
49-
; ASM-NEXT: .p2align 2
26+
; ASM: .short {{.*-.*}} # Record length
27+
; ASM: .short 4359 # Record kind: S_CONSTANT
28+
; ASM-NEXT: .long 4102 # Type
29+
; ASM-NEXT: .byte 0x04, 0x80, 0xc3, 0xf5 # Value
30+
; ASM-NEXT: .byte 0x48, 0x40
31+
; ASM-NEXT: .asciz "Test1::TestConst1" # Name
32+
; ASM: .short {{.*-.*}} # Record length
33+
; ASM: .short 4359 # Record kind: S_CONSTANT
34+
; ASM-NEXT: .long 4103 # Type
35+
; ASM-NEXT: .byte 0x61, 0x00 # Value
36+
; ASM-NEXT: .asciz "S::TestConst2" # Name
37+
; ASM: .short {{.*-.*}} # Record length
38+
; ASM: .short 4359 # Record kind: S_CONSTANT
39+
; ASM-NEXT: .long 4105 # Type
40+
; ASM-NEXT: .byte 0x0a, 0x80, 0x40, 0x61 # Value
41+
; ASM-NEXT: .byte 0x07, 0x80, 0xff, 0xff
42+
; ASM-NEXT: .byte 0xff, 0xff
43+
; ASM-NEXT: .asciz "ENUM_B" # Name
5044
; ASM-NOT: .asciz "S::SEnum" # Name
5145

5246
; OBJ: CodeViewDebugInfo [
@@ -56,85 +50,110 @@
5650
; OBJ: SubSectionType: Symbols (0xF1)
5751
; OBJ: ConstantSym {
5852
; OBJ-NEXT: Kind: S_CONSTANT (0x1107)
59-
; OBJ-NEXT: Type: const float (0x1003)
53+
; OBJ-NEXT: Type: const float (0x1006)
6054
; OBJ-NEXT: Value: 1078523331
6155
; OBJ-NEXT: Name: Test1::TestConst1
6256
; OBJ-NEXT: }
6357
; OBJ-NEXT: ConstantSym {
6458
; OBJ-NEXT: Kind: S_CONSTANT (0x1107)
65-
; OBJ-NEXT: Type: const int (0x1005)
66-
; OBJ-NEXT: Value: 18446744073709551606
59+
; OBJ-NEXT: Type: const char (0x1007)
60+
; OBJ-NEXT: Value: 97
6761
; OBJ-NEXT: Name: S::TestConst2
6862
; OBJ-NEXT: }
6963
; OBJ-NEXT: ConstantSym {
7064
; OBJ-NEXT: Kind: S_CONSTANT (0x1107)
71-
; OBJ-NEXT: Type: TestEnum (0x100E)
65+
; OBJ-NEXT: Type: TestEnum (0x1009)
7266
; OBJ-NEXT: Value: 18446744071562551616
7367
; OBJ-NEXT: Name: ENUM_B
7468
; OBJ-NEXT: }
7569
; OBJ-NOT: Name: S::SEnum
7670

77-
; ModuleID = 'a.cpp'
78-
source_filename = "a.cpp"
79-
target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
80-
target triple = "x86_64-pc-windows-msvc19.25.28614"
71+
; ModuleID = 't.cpp'
72+
source_filename = "t.cpp"
73+
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
74+
target triple = "x86_64-pc-windows-msvc19.16.27030"
75+
76+
; Function Attrs: noinline nounwind optnone uwtable
77+
define dso_local void @"?useConst@@YAXH@Z"(i32) #0 !dbg !32 {
78+
entry:
79+
%.addr = alloca i32, align 4
80+
store i32 %0, i32* %.addr, align 4
81+
call void @llvm.dbg.declare(metadata i32* %.addr, metadata !36, metadata !DIExpression()), !dbg !37
82+
ret void, !dbg !37
83+
}
84+
85+
; Function Attrs: nounwind readnone speculatable
86+
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
8187

82-
; Function Attrs: noinline optnone uwtable
83-
define dso_local void @"?foo@@YAXXZ"() #0 !dbg !31 {
88+
; Function Attrs: noinline norecurse nounwind optnone uwtable
89+
define dso_local i32 @main() #2 !dbg !38 {
8490
entry:
85-
call void @"?useConst@@YAXH@Z"(i32 3), !dbg !35
86-
call void @"?useConst@@YAXH@Z"(i32 -10), !dbg !36
87-
call void @"?useConst@@YAXH@Z"(i32 -2147000000), !dbg !37
88-
call void @"?useConst@@YAXH@Z"(i32 42), !dbg !38
89-
ret void, !dbg !39
91+
%retval = alloca i32, align 4
92+
store i32 0, i32* %retval, align 4
93+
call void @"?useConst@@YAXH@Z"(i32 3), !dbg !41
94+
call void @"?useConst@@YAXH@Z"(i32 97), !dbg !42
95+
call void @"?useConst@@YAXH@Z"(i32 -2147000000), !dbg !43
96+
call void @"?useConst@@YAXH@Z"(i32 42), !dbg !44
97+
call void @llvm.debugtrap(), !dbg !45
98+
ret i32 0, !dbg !46
9099
}
91100

92-
declare dso_local void @"?useConst@@YAXH@Z"(i32) #1
101+
; Function Attrs: nounwind
102+
declare void @llvm.debugtrap() #3
93103

94-
attributes #0 = { noinline optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
95-
attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
104+
attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
105+
attributes #1 = { nounwind readnone speculatable }
106+
attributes #2 = { noinline norecurse nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
107+
attributes #3 = { nounwind }
96108

97109
!llvm.dbg.cu = !{!0}
98-
!llvm.module.flags = !{!26, !27, !28, !29}
99-
!llvm.ident = !{!30}
110+
!llvm.module.flags = !{!27, !28, !29, !30}
111+
!llvm.ident = !{!31}
100112

101-
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 11.0.0 (https://github.com/llvm/llvm-project.git 202f144bffd0be254a829924195e1b8ebabcbb79)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !15, globals: !16, nameTableKind: None)
102-
!1 = !DIFile(filename: "a.cpp", directory: "F:\\llvm-project\\__test", checksumkind: CSK_MD5, checksum: "a1dbf3aabea9e8f9d1be48f60287942f")
103-
!2 = !{!3, !11}
104-
!3 = !DICompositeType(tag: DW_TAG_enumeration_type, scope: !4, file: !1, line: 6, baseType: !8, size: 32, elements: !9, identifier: ".?AW4<unnamed-enum-SEnum>@S@@")
113+
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 9.0.0 (https://github.com/llvm/llvm-project.git f60f863075c7056f26e701b0405fc5752f0db576)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !16, globals: !17, nameTableKind: None)
114+
!1 = !DIFile(filename: "t.cpp", directory: "C:\5Csrc\5Ctesting", checksumkind: CSK_MD5, checksum: "70da26ef1009521e2127bf71f8d532a2")
115+
!2 = !{!3, !12}
116+
!3 = !DICompositeType(tag: DW_TAG_enumeration_type, scope: !4, file: !1, line: 6, baseType: !9, size: 32, elements: !10, identifier: ".?AW4<unnamed-enum-SEnum>@S@@")
105117
!4 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !1, line: 4, size: 8, flags: DIFlagTypePassByValue, elements: !5, identifier: ".?AUS@@")
106118
!5 = !{!6, !3}
107-
!6 = !DIDerivedType(tag: DW_TAG_member, name: "TestConst2", scope: !4, file: !1, line: 5, baseType: !7, flags: DIFlagStaticMember, extraData: i32 -10)
119+
!6 = !DIDerivedType(tag: DW_TAG_member, name: "TestConst2", scope: !4, file: !1, line: 5, baseType: !7, flags: DIFlagStaticMember, extraData: i8 97)
108120
!7 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !8)
109-
!8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
110-
!9 = !{!10}
111-
!10 = !DIEnumerator(name: "SEnum", value: 42)
112-
!11 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "TestEnum", file: !1, line: 8, baseType: !8, size: 32, elements: !12, identifier: ".?AW4TestEnum@@")
113-
!12 = !{!13, !14}
114-
!13 = !DIEnumerator(name: "ENUM_A", value: 2147000000)
115-
!14 = !DIEnumerator(name: "ENUM_B", value: -2147000000)
116-
!15 = !{!4}
117-
!16 = !{!17, !22, !24}
118-
!17 = !DIGlobalVariableExpression(var: !18, expr: !DIExpression(DW_OP_constu, 1078523331, DW_OP_stack_value))
119-
!18 = distinct !DIGlobalVariable(name: "TestConst1", scope: !19, file: !1, line: 2, type: !20, isLocal: true, isDefinition: true)
120-
!19 = !DINamespace(name: "Test1", scope: null)
121-
!20 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !21)
122-
!21 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float)
123-
!22 = !DIGlobalVariableExpression(var: !23, expr: !DIExpression(DW_OP_constu, 18446744073709551606, DW_OP_stack_value))
124-
!23 = distinct !DIGlobalVariable(name: "TestConst2", scope: !0, file: !1, line: 5, type: !7, isLocal: true, isDefinition: true, declaration: !6)
125-
!24 = !DIGlobalVariableExpression(var: !25, expr: !DIExpression(DW_OP_constu, 18446744071562551616, DW_OP_stack_value))
126-
!25 = distinct !DIGlobalVariable(name: "ENUM_B", scope: !0, file: !1, line: 10, type: !11, isLocal: true, isDefinition: true)
127-
!26 = !{i32 2, !"CodeView", i32 1}
128-
!27 = !{i32 2, !"Debug Info Version", i32 3}
129-
!28 = !{i32 1, !"wchar_size", i32 2}
130-
!29 = !{i32 7, !"PIC Level", i32 2}
131-
!30 = !{!"clang version 11.0.0 (https://github.com/llvm/llvm-project.git 202f144bffd0be254a829924195e1b8ebabcbb79)"}
132-
!31 = distinct !DISubprogram(name: "foo", linkageName: "?foo@@YAXXZ", scope: !1, file: !1, line: 13, type: !32, scopeLine: 13, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !34)
133-
!32 = !DISubroutineType(types: !33)
134-
!33 = !{null}
135-
!34 = !{}
136-
!35 = !DILocation(line: 14, scope: !31)
137-
!36 = !DILocation(line: 15, scope: !31)
138-
!37 = !DILocation(line: 16, scope: !31)
139-
!38 = !DILocation(line: 17, scope: !31)
140-
!39 = !DILocation(line: 18, scope: !31)
121+
!8 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
122+
!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
123+
!10 = !{!11}
124+
!11 = !DIEnumerator(name: "SEnum", value: 42)
125+
!12 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "TestEnum", file: !1, line: 8, baseType: !9, size: 32, elements: !13, identifier: ".?AW4TestEnum@@")
126+
!13 = !{!14, !15}
127+
!14 = !DIEnumerator(name: "ENUM_A", value: 2147000000)
128+
!15 = !DIEnumerator(name: "ENUM_B", value: -2147000000)
129+
!16 = !{!4}
130+
!17 = !{!18, !23, !25}
131+
!18 = !DIGlobalVariableExpression(var: !19, expr: !DIExpression(DW_OP_constu, 1078523331, DW_OP_stack_value))
132+
!19 = distinct !DIGlobalVariable(name: "TestConst1", scope: !20, file: !1, line: 2, type: !21, isLocal: true, isDefinition: true)
133+
!20 = !DINamespace(name: "Test1", scope: null)
134+
!21 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !22)
135+
!22 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float)
136+
!23 = !DIGlobalVariableExpression(var: !24, expr: !DIExpression(DW_OP_constu, 97, DW_OP_stack_value))
137+
!24 = distinct !DIGlobalVariable(name: "TestConst2", scope: !0, file: !1, line: 5, type: !7, isLocal: true, isDefinition: true, declaration: !6)
138+
!25 = !DIGlobalVariableExpression(var: !26, expr: !DIExpression(DW_OP_constu, 18446744071562551616, DW_OP_stack_value))
139+
!26 = distinct !DIGlobalVariable(name: "ENUM_B", scope: !0, file: !1, line: 10, type: !12, isLocal: true, isDefinition: true)
140+
!27 = !{i32 2, !"CodeView", i32 1}
141+
!28 = !{i32 2, !"Debug Info Version", i32 3}
142+
!29 = !{i32 1, !"wchar_size", i32 2}
143+
!30 = !{i32 7, !"PIC Level", i32 2}
144+
!31 = !{!"clang version 9.0.0 (https://github.com/llvm/llvm-project.git f60f863075c7056f26e701b0405fc5752f0db576)"}
145+
!32 = distinct !DISubprogram(name: "useConst", linkageName: "?useConst@@YAXH@Z", scope: !1, file: !1, line: 12, type: !33, scopeLine: 12, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !35)
146+
!33 = !DISubroutineType(types: !34)
147+
!34 = !{null, !9}
148+
!35 = !{}
149+
!36 = !DILocalVariable(arg: 1, scope: !32, file: !1, line: 12, type: !9)
150+
!37 = !DILocation(line: 12, scope: !32)
151+
!38 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 13, type: !39, scopeLine: 13, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !35)
152+
!39 = !DISubroutineType(types: !40)
153+
!40 = !{!9}
154+
!41 = !DILocation(line: 14, scope: !38)
155+
!42 = !DILocation(line: 15, scope: !38)
156+
!43 = !DILocation(line: 16, scope: !38)
157+
!44 = !DILocation(line: 17, scope: !38)
158+
!45 = !DILocation(line: 18, scope: !38)
159+
!46 = !DILocation(line: 19, scope: !38)

0 commit comments

Comments
 (0)