1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

[DebugInfo][CodeView] Include namespace into emitted globals

Before this patch, global variables didn't have their namespace prepended in the Codeview debug symbol stream. This prevented Visual Studio from displaying them in the debugger (they appeared as 'unspecified error')

Differential Revision: https://reviews.llvm.org/D79028
This commit is contained in:
Alexandre Ganea 2020-05-04 13:13:19 -04:00
parent 461846b39b
commit 730dc93e22
3 changed files with 223 additions and 146 deletions

View File

@ -3111,7 +3111,9 @@ void CodeViewDebug::emitDebugInfoForGlobal(const CVGlobalVariable &CVGV) {
OS.EmitCOFFSectionIndex(GVSym);
OS.AddComment("Name");
const unsigned LengthOfDataRecord = 12;
emitNullTerminatedSymbolName(OS, DIGV->getName(), LengthOfDataRecord);
emitNullTerminatedSymbolName(
OS, getFullyQualifiedName(DIGV->getScope(), DIGV->getName()),
LengthOfDataRecord);
endSymbolRecord(DataEnd);
} else {
// FIXME: Currently this only emits the global variables in the IR metadata.

View File

@ -51,7 +51,7 @@
; CHECK: }
; CHECK: DataSym {
; CHECK: Kind: S_LDATA32 (0x110C)
; CHECK: DisplayName: local_int
; CHECK: DisplayName: foo::local_int
; CHECK: LinkageName: ?local_int@?1??foo@@YAXXZ@4HA
; CHECK: }
; CHECK: BlockSym {
@ -59,7 +59,7 @@
; CHECK: }
; CHECK: DataSym {
; CHECK: Kind: S_LDATA32 (0x110C)
; CHECK: DisplayName: nested_int
; CHECK: DisplayName: foo::nested_int
; CHECK: LinkageName: ?nested_int@?1??foo@@YAXXZ@4HA
; CHECK: }
; CHECK: ScopeEndSym {
@ -78,7 +78,7 @@
; CHECK: }
; CHECK: DataSym {
; CHECK: Kind: S_LDATA32 (0x110C)
; CHECK: DisplayName: local_int
; CHECK: DisplayName: bar::local_int
; CHECK: LinkageName: ?local_int@?1??bar@@YAXXZ@4HA
; CHECK: }
; CHECK: BlockSym {
@ -86,7 +86,7 @@
; CHECK: }
; CHECK: DataSym {
; CHECK: Kind: S_LDATA32 (0x110C)
; CHECK: DisplayName: nested_int
; CHECK: DisplayName: bar::nested_int
; CHECK: LinkageName: ?nested_int@?1??bar@@YAXXZ@4HA
; CHECK: }
; CHECK: ScopeEndSym {

View File

@ -4,111 +4,146 @@
; RUN: llc < %s -filetype=obj | obj2yaml | FileCheck %s --check-prefix=YAML
; C++ source to regenerate:
; $ cat t.cpp
; $ cat a.cpp
; int first;
; template <typename T> struct A { static const int comdat = 3; };
; const int *middle = &A<void>::comdat;
; thread_local const int *middle = &A<void>::comdat;
; namespace foo {
; thread_local int globalTLS = 4;
; static thread_local int staticTLS = 5;
; int justGlobal = 6;
; static int globalStatic = 7;
; }
; int last;
; $ clang t.cpp -S -emit-llvm -g -gcodeview -o t.ll
; int bar() {
; return foo::globalStatic + foo::globalTLS + foo::staticTLS;
; }
; $ clang-cl a.cpp /c /Z7 /GS- /clang:-S /clang:-emit-llvm
; ASM: .section .debug$S,"dr"
; ASM: .p2align 2
; ASM: .long 4 # Debug section magic
; ASM-NEXT: .p2align 2
; ASM-NEXT: .long 4 # Debug section magic
; ASM: .short {{.*-.*}} # Record length
; ASM: .short 4364 # Record kind: S_LDATA32
; ASM: .long 116 # Type
; ASM: .secrel32 "?first@@3HA" # DataOffset
; ASM: .secidx "?first@@3HA" # Segment
; ASM: .asciz "first" # Name
; ASM: .short {{.*-.*}} # Record length
; ASM: .short 4371 # Record kind: S_GTHREAD32
; ASM: .long 4097 # Type
; ASM: .secrel32 "?middle@@3PEBHEB" # DataOffset
; ASM: .secidx "?middle@@3PEBHEB" # Segment
; ASM: .asciz "middle" # Name
; ASM: .short {{.*-.*}} # Record length
; ASM: .short 4365 # Record kind: S_GDATA32
; ASM: .long 116 # Type
; ASM: .secrel32 "?last@@3HA" # DataOffset
; ASM: .secidx "?last@@3HA" # Segment
; ASM: .asciz "last" # Name
; ASM-NEXT: .long 116 # Type
; ASM-NEXT: .secrel32 "?first@@3HA" # DataOffset
; ASM-NEXT: .secidx "?first@@3HA" # Segment
; ASM-NEXT: .asciz "first" # Name
; ASM-NEXT: .p2align 2
; ASM: .short 4371 # Record kind: S_GTHREAD32
; ASM-NEXT: .long 4100 # Type
; ASM-NEXT: .secrel32 "?middle@@3PEBHEB" # DataOffset
; ASM-NEXT: .secidx "?middle@@3PEBHEB" # Segment
; ASM-NEXT: .asciz "middle" # Name
; ASM-NEXT: .p2align 2
; ASM: .short 4371 # Record kind: S_GTHREAD32
; ASM-NEXT: .long 116 # Type
; ASM-NEXT: .secrel32 "?globalTLS@foo@@3HA" # DataOffset
; ASM-NEXT: .secidx "?globalTLS@foo@@3HA" # Segment
; ASM-NEXT: .asciz "foo::globalTLS" # Name
; ASM-NEXT: .p2align 2
; ASM: .short 4365 # Record kind: S_GDATA32
; ASM-NEXT: .long 116 # Type
; ASM-NEXT: .secrel32 "?justGlobal@foo@@3HA" # DataOffset
; ASM-NEXT: .secidx "?justGlobal@foo@@3HA" # Segment
; ASM-NEXT: .asciz "foo::justGlobal" # Name
; ASM-NEXT: .p2align 2
; ASM: .short 4365 # Record kind: S_GDATA32
; ASM-NEXT: .long 116 # Type
; ASM-NEXT: .secrel32 "?last@@3HA" # DataOffset
; ASM-NEXT: .secidx "?last@@3HA" # Segment
; ASM-NEXT: .asciz "last" # Name
; ASM-NEXT: .p2align 2
; ASM: .short 4364 # Record kind: S_LDATA32
; ASM-NEXT: .long 116 # Type
; ASM-NEXT: .secrel32 "?globalStatic@foo@@3HA" # DataOffset
; ASM-NEXT: .secidx "?globalStatic@foo@@3HA" # Segment
; ASM-NEXT: .asciz "foo::globalStatic" # Name
; ASM-NEXT: .p2align 2
; ASM: .short 4370 # Record kind: S_LTHREAD32
; ASM-NEXT: .long 116 # Type
; ASM-NEXT: .secrel32 "?staticTLS@foo@@3HA" # DataOffset
; ASM-NEXT: .secidx "?staticTLS@foo@@3HA" # Segment
; ASM-NEXT: .asciz "foo::staticTLS" # Name
; ASM-NEXT: .p2align 2
; ASM: .section .debug$S,"dr",associative,"?comdat@?$A@X@@2HB"
; ASM: .p2align 2
; ASM: .long 4 # Debug section magic
; ASM-NEXT: .p2align 2
; ASM-NEXT: .long 4 # Debug section magic
; ASM: .short {{.*-.*}} # Record length
; ASM: .short 4365 # Record kind: S_GDATA32
; ASM: .long 4096 # Type
; ASM: .secrel32 "?comdat@?$A@X@@2HB" # DataOffset
; ASM: .secidx "?comdat@?$A@X@@2HB" # Segment
; ASM: .asciz "comdat" # Name
; OBJ: CodeViewTypes [
; OBJ: Section: .debug$T
; OBJ: Magic: 0x4
; OBJ: Modifier (0x1000) {
; OBJ: TypeLeafKind: LF_MODIFIER (0x1001)
; OBJ: ModifiedType: int (0x74)
; OBJ: Modifiers [ (0x1)
; OBJ: Const (0x1)
; OBJ: ]
; OBJ: }
; OBJ: Pointer (0x1001) {
; OBJ: TypeLeafKind: LF_POINTER (0x1002)
; OBJ: PointeeType: const int (0x1000)
; OBJ: PtrType: Near64 (0xC)
; OBJ: PtrMode: Pointer (0x0)
; OBJ: IsFlat: 0
; OBJ: IsConst: 0
; OBJ: IsVolatile: 0
; OBJ: IsUnaligned: 0
; OBJ: }
; OBJ: ]
; ASM-NEXT: .long 4099 # Type
; ASM-NEXT: .secrel32 "?comdat@?$A@X@@2HB" # DataOffset
; ASM-NEXT: .secidx "?comdat@?$A@X@@2HB" # Segment
; ASM-NEXT: .asciz "comdat" # Name
; OBJ: CodeViewDebugInfo [
; OBJ: Section: .debug$S
; OBJ: Magic: 0x4
; OBJ: Subsection [
; OBJ: SubSectionType: Symbols (0xF1)
; OBJ: DataSym {
; OBJ: Kind: S_LDATA32 (0x110C)
; OBJ: DataOffset: ?first@@3HA+0x0
; OBJ: Type: int (0x74)
; OBJ: DisplayName: first
; OBJ: LinkageName: ?first@@3HA
; OBJ: }
; OBJ: GlobalTLS {
; OBJ: DataOffset: ?middle@@3PEBHEB+0x0
; OBJ: Type: const int* (0x1001)
; OBJ: DisplayName: middle
; OBJ: LinkageName: ?middle@@3PEBHEB
; OBJ: }
; OBJ: GlobalData {
; OBJ: Kind: S_GDATA32 (0x110D)
; OBJ: DataOffset: ?last@@3HA+0x0
; OBJ: Type: int (0x74)
; OBJ: DisplayName: last
; OBJ: LinkageName: ?last@@3HA
; OBJ: }
; OBJ: ]
; OBJ: ]
; OBJ: CodeViewDebugInfo [
; OBJ: Section: .debug$S
; OBJ: Magic: 0x4
; OBJ: Subsection [
; OBJ: SubSectionType: Symbols (0xF1)
; OBJ: GlobalData {
; OBJ: DataOffset: ?comdat@?$A@X@@2HB+0x0
; OBJ: Type: const int (0x1000)
; OBJ: DisplayName: comdat
; OBJ: LinkageName: ?comdat@?$A@X@@2HB
; OBJ: }
; OBJ: ]
; OBJ: ]
; OBJ-LABEL: GlobalData {
; OBJ-NEXT: Kind: S_GDATA32 (0x110D)
; OBJ-NEXT: DataOffset: ?first@@3HA+0x0
; OBJ-NEXT: Type: int (0x74)
; OBJ-NEXT: DisplayName: first
; OBJ-NEXT: LinkageName: ?first@@3HA
; OBJ-NEXT: }
; OBJ-NEXT: GlobalTLS {
; OBJ-NEXT: Kind: S_GTHREAD32 (0x1113)
; OBJ-NEXT: DataOffset: ?middle@@3PEBHEB+0x0
; OBJ-NEXT: Type: const int* (0x1004)
; OBJ-NEXT: DisplayName: middle
; OBJ-NEXT: LinkageName: ?middle@@3PEBHEB
; OBJ-NEXT: }
; OBJ-NEXT: GlobalTLS {
; OBJ-NEXT: Kind: S_GTHREAD32 (0x1113)
; OBJ-NEXT: DataOffset: ?globalTLS@foo@@3HA+0x0
; OBJ-NEXT: Type: int (0x74)
; OBJ-NEXT: DisplayName: foo::globalTLS
; OBJ-NEXT: LinkageName: ?globalTLS@foo@@3HA
; OBJ-NEXT: }
; OBJ-NEXT: GlobalData {
; OBJ-NEXT: Kind: S_GDATA32 (0x110D)
; OBJ-NEXT: DataOffset: ?justGlobal@foo@@3HA+0x0
; OBJ-NEXT: Type: int (0x74)
; OBJ-NEXT: DisplayName: foo::justGlobal
; OBJ-NEXT: LinkageName: ?justGlobal@foo@@3HA
; OBJ-NEXT: }
; OBJ-NEXT: GlobalData {
; OBJ-NEXT: Kind: S_GDATA32 (0x110D)
; OBJ-NEXT: DataOffset: ?last@@3HA+0x0
; OBJ-NEXT: Type: int (0x74)
; OBJ-NEXT: DisplayName: last
; OBJ-NEXT: LinkageName: ?last@@3HA
; OBJ-NEXT: }
; OBJ-NEXT: DataSym {
; OBJ-NEXT: Kind: S_LDATA32 (0x110C)
; OBJ-NEXT: DataOffset: ?globalStatic@foo@@3HA+0x0
; OBJ-NEXT: Type: int (0x74)
; OBJ-NEXT: DisplayName: foo::globalStatic
; OBJ-NEXT: LinkageName: ?globalStatic@foo@@3HA
; OBJ-NEXT: }
; OBJ-NEXT: ThreadLocalDataSym {
; OBJ-NEXT: Kind: S_LTHREAD32 (0x1112)
; OBJ-NEXT: DataOffset: ?staticTLS@foo@@3HA+0x0
; OBJ-NEXT: Type: int (0x74)
; OBJ-NEXT: DisplayName: foo::staticTLS
; OBJ-NEXT: LinkageName: ?staticTLS@foo@@3HA
; OBJ-NEXT: }
; OBJ: GlobalData {
; OBJ-NEXT: Kind: S_GDATA32 (0x110D)
; OBJ-LABEL: DataOffset: ?comdat@?$A@X@@2HB+0x0
; OBJ-NEXT: Type: const int (0x1003)
; OBJ-NEXT: DisplayName: comdat
; OBJ-NEXT: LinkageName: ?comdat@?$A@X@@2HB
; YAML-LABEL: - Name: '.debug$S'
; YAML: Subsections:
@ -116,75 +151,115 @@
; YAML: Records:
; YAML: - Kind: S_COMPILE3
; YAML: Compile3Sym:
; YAML: - !Symbols
; YAML: Records:
; YAML: - Kind: S_LDATA32
; YAML: DataSym:
; YAML-NEXT: Records:
; YAML-LABEL: - Kind: S_GDATA32
; YAML-NEXT: DataSym:
; YAML-NOT: Segment
; YAML: Type: 116
; YAML-NEXT: Type: 116
; YAML-NOT: Segment
; YAML: DisplayName: first
; YAML-NEXT: DisplayName: first
; YAML-NOT: Segment
; YAML: - Kind: S_GTHREAD32
; YAML: ThreadLocalDataSym:
; YAML: Type: 4097
; YAML: DisplayName: middle
; YAML: - Kind: S_GDATA32
; YAML: DataSym:
; YAML-NEXT: - Kind: S_GTHREAD32
; YAML-NEXT: ThreadLocalDataSym:
; YAML-NEXT: Type: 4100
; YAML-NEXT: DisplayName: middle
; YAML-NEXT: - Kind: S_GTHREAD32
; YAML-NEXT: ThreadLocalDataSym:
; YAML-NEXT: Type: 116
; YAML-NEXT: DisplayName: 'foo::globalTLS'
; YAML-NEXT: - Kind: S_GDATA32
; YAML-NEXT: DataSym:
; YAML-NOT: Segment
; YAML: Type: 116
; YAML-NOT: Offset
; YAML-NEXT: Type: 116
; YAML-NOT: Segment
; YAML: DisplayName: last
; YAML-NEXT: DisplayName: 'foo::justGlobal'
; YAML-NOT: Segment
; YAML-NEXT: - Kind: S_GDATA32
; YAML-NEXT: DataSym:
; YAML-NEXT: Type: 116
; YAML-NEXT: DisplayName: last
; YAML-NEXT: - Kind: S_LDATA32
; YAML-NEXT: DataSym:
; YAML-NEXT: Type: 116
; YAML-NEXT: DisplayName: 'foo::globalStatic'
; YAML-NEXT: - Kind: S_LTHREAD32
; YAML-NEXT: ThreadLocalDataSym:
; YAML-NEXT: Type: 116
; YAML-NEXT: DisplayName: 'foo::staticTLS'
; The missing offsets are represented as relocations against this section.
; YAML: Relocations:
; YAML: - VirtualAddress: 92
; YAML: SymbolName: '?first@@3HA'
; YAML: Type: IMAGE_REL_AMD64_SECREL
; YAML: - VirtualAddress: 96
; YAML: SymbolName: '?first@@3HA'
; YAML: Type: IMAGE_REL_AMD64_SECTION
; ModuleID = 'a.cpp'
source_filename = "a.cpp"
target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc19.25.28614"
; ModuleID = 't.cpp'
source_filename = "t.cpp"
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc19.0.23918"
$"?comdat@?$A@X@@2HB" = comdat any
$"\01?comdat@?$A@X@@2HB" = comdat any
@"?first@@3HA" = dso_local global i32 0, align 4, !dbg !0
@"?comdat@?$A@X@@2HB" = linkonce_odr dso_local constant i32 3, comdat, align 4, !dbg !6
@"?middle@@3PEBHEB" = dso_local thread_local global i32* @"?comdat@?$A@X@@2HB", align 8, !dbg !15
@"?globalTLS@foo@@3HA" = dso_local thread_local global i32 4, align 4, !dbg !18
@"?justGlobal@foo@@3HA" = dso_local global i32 6, align 4, !dbg !21
@"?last@@3HA" = dso_local global i32 0, align 4, !dbg !23
@"?globalStatic@foo@@3HA" = internal global i32 7, align 4, !dbg !25
@"?staticTLS@foo@@3HA" = internal thread_local global i32 5, align 4, !dbg !27
@"\01?first@@3HA" = internal global i32 0, align 4, !dbg !0
@"\01?comdat@?$A@X@@2HB" = linkonce_odr constant i32 3, comdat, align 4, !dbg !6
@"\01?middle@@3PEBHEB" = thread_local global i32* @"\01?comdat@?$A@X@@2HB", align 8, !dbg !15
@"\01?last@@3HA" = global i32 0, align 4, !dbg !18
; Function Attrs: noinline nounwind optnone uwtable
define dso_local i32 @"?bar@@YAHXZ"() #0 !dbg !36 {
entry:
%0 = load i32, i32* @"?globalStatic@foo@@3HA", align 4, !dbg !39
%1 = load i32, i32* @"?globalTLS@foo@@3HA", align 4, !dbg !39
%add = add nsw i32 %0, %1, !dbg !39
%2 = load i32, i32* @"?staticTLS@foo@@3HA", align 4, !dbg !39
%add1 = add nsw i32 %add, %2, !dbg !39
ret i32 %add1, !dbg !39
}
attributes #0 = { noinline nounwind 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" }
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!20, !21, !22}
!llvm.ident = !{!23}
!llvm.linker.options = !{!29, !30}
!llvm.module.flags = !{!31, !32, !33, !34}
!llvm.ident = !{!35}
!0 = distinct !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = !DIGlobalVariable(name: "first", linkageName: "\01?first@@3HA", scope: !2, file: !3, line: 1, type: !9, isLocal: true, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.9.0 (trunk 271937)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
!3 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(name: "first", linkageName: "?first@@3HA", scope: !2, file: !3, line: 1, type: !9, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !3, producer: "clang version 11.0.0 (https://github.com/llvm/llvm-project.git f5b1301ce8575f6d82e87031a1a5485c33637a93)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, nameTableKind: None)
!3 = !DIFile(filename: "a.cpp", directory: "F:\\llvm-project\\__test", checksumkind: CSK_MD5, checksum: "65c2a7701cffb7a2e8d4caf1cc24caa7")
!4 = !{}
!5 = !{!0, !6, !15, !18}
!6 = distinct !DIGlobalVariableExpression(var: !7, expr: !DIExpression())
!7 = !DIGlobalVariable(name: "comdat", linkageName: "\01?comdat@?$A@X@@2HB", scope: !2, file: !3, line: 2, type: !8, isLocal: false, isDefinition: true, declaration: !10)
!5 = !{!0, !6, !15, !18, !21, !23, !25, !27}
!6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())
!7 = distinct !DIGlobalVariable(name: "comdat", linkageName: "?comdat@?$A@X@@2HB", scope: !2, file: !3, line: 2, type: !8, isLocal: false, isDefinition: true, declaration: !10)
!8 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !9)
!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!10 = !DIDerivedType(tag: DW_TAG_member, name: "comdat", scope: !11, file: !3, line: 2, baseType: !8, flags: DIFlagStaticMember, extraData: i32 3)
!11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A<void>", file: !3, line: 2, size: 8, align: 8, elements: !12, templateParams: !13)
!11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A<void>", file: !3, line: 2, size: 8, flags: DIFlagTypePassByValue, elements: !12, templateParams: !13, identifier: ".?AU?$A@X@@")
!12 = !{!10}
!13 = !{!14}
!14 = !DITemplateTypeParameter(name: "T", type: null)
!15 = distinct !DIGlobalVariableExpression(var: !16, expr: !DIExpression())
!16 = !DIGlobalVariable(name: "middle", linkageName: "\01?middle@@3PEBHEB", scope: !2, file: !3, line: 3, type: !17, isLocal: false, isDefinition: true)
!17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64, align: 64)
!18 = distinct !DIGlobalVariableExpression(var: !19, expr: !DIExpression())
!19 = !DIGlobalVariable(name: "last", linkageName: "\01?last@@3HA", scope: !2, file: !3, line: 4, type: !9, isLocal: false, isDefinition: true)
!20 = !{i32 2, !"CodeView", i32 1}
!21 = !{i32 2, !"Debug Info Version", i32 3}
!22 = !{i32 1, !"PIC Level", i32 2}
!23 = !{!"clang version 3.9.0 (trunk 271937)"}
!15 = !DIGlobalVariableExpression(var: !16, expr: !DIExpression())
!16 = distinct !DIGlobalVariable(name: "middle", linkageName: "?middle@@3PEBHEB", scope: !2, file: !3, line: 3, type: !17, isLocal: false, isDefinition: true)
!17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64)
!18 = !DIGlobalVariableExpression(var: !19, expr: !DIExpression())
!19 = distinct !DIGlobalVariable(name: "globalTLS", linkageName: "?globalTLS@foo@@3HA", scope: !20, file: !3, line: 5, type: !9, isLocal: false, isDefinition: true)
!20 = !DINamespace(name: "foo", scope: null)
!21 = !DIGlobalVariableExpression(var: !22, expr: !DIExpression())
!22 = distinct !DIGlobalVariable(name: "justGlobal", linkageName: "?justGlobal@foo@@3HA", scope: !20, file: !3, line: 7, type: !9, isLocal: false, isDefinition: true)
!23 = !DIGlobalVariableExpression(var: !24, expr: !DIExpression())
!24 = distinct !DIGlobalVariable(name: "last", linkageName: "?last@@3HA", scope: !2, file: !3, line: 10, type: !9, isLocal: false, isDefinition: true)
!25 = !DIGlobalVariableExpression(var: !26, expr: !DIExpression())
!26 = distinct !DIGlobalVariable(name: "globalStatic", linkageName: "?globalStatic@foo@@3HA", scope: !20, file: !3, line: 8, type: !9, isLocal: true, isDefinition: true)
!27 = !DIGlobalVariableExpression(var: !28, expr: !DIExpression())
!28 = distinct !DIGlobalVariable(name: "staticTLS", linkageName: "?staticTLS@foo@@3HA", scope: !20, file: !3, line: 6, type: !9, isLocal: true, isDefinition: true)
!29 = !{!"/DEFAULTLIB:libcmt.lib"}
!30 = !{!"/DEFAULTLIB:oldnames.lib"}
!31 = !{i32 2, !"CodeView", i32 1}
!32 = !{i32 2, !"Debug Info Version", i32 3}
!33 = !{i32 1, !"wchar_size", i32 2}
!34 = !{i32 7, !"PIC Level", i32 2}
!35 = !{!"clang version 11.0.0 (https://github.com/llvm/llvm-project.git f5b1301ce8575f6d82e87031a1a5485c33637a93)"}
!36 = distinct !DISubprogram(name: "bar", linkageName: "?bar@@YAHXZ", scope: !3, file: !3, line: 11, type: !37, scopeLine: 11, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !4)
!37 = !DISubroutineType(types: !38)
!38 = !{!9}
!39 = !DILocation(line: 12, scope: !36)