diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -3111,7 +3111,12 @@ OS.EmitCOFFSectionIndex(GVSym); OS.AddComment("Name"); const unsigned LengthOfDataRecord = 12; - emitNullTerminatedSymbolName(OS, DIGV->getName(), LengthOfDataRecord); + emitNullTerminatedSymbolName( + OS, + DataSym == SymbolKind::S_LTHREAD32 + ? DIGV->getName() + : getFullyQualifiedName(DIGV->getScope(), DIGV->getName()), + LengthOfDataRecord); endSymbolRecord(DataEnd); } else { // FIXME: Currently this only emits the global variables in the IR metadata. diff --git a/llvm/test/DebugInfo/COFF/global_visibility.ll b/llvm/test/DebugInfo/COFF/global_visibility.ll --- a/llvm/test/DebugInfo/COFF/global_visibility.ll +++ b/llvm/test/DebugInfo/COFF/global_visibility.ll @@ -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 { diff --git a/llvm/test/DebugInfo/COFF/globals.ll b/llvm/test/DebugInfo/COFF/globals.ll --- a/llvm/test/DebugInfo/COFF/globals.ll +++ b/llvm/test/DebugInfo/COFF/globals.ll @@ -4,111 +4,147 @@ ; RUN: llc < %s -filetype=obj | obj2yaml | FileCheck %s --check-prefix=YAML ; C++ source to regenerate: -; $ cat t.cpp +; $ cat a.cpp ; int first; ; template struct A { static const int comdat = 3; }; -; const int *middle = &A::comdat; +; thread_local const int *middle = &A::comdat; +; namespace foo { +; thread_local int globalTLS = 4; +; int justGlobal = 5; +; static int globalStatic = 6; +; } ; int last; -; $ clang t.cpp -S -emit-llvm -g -gcodeview -o t.ll +; int bar() { +; thread_local int LocalTLS = 7; +; return foo::globalStatic + foo::globalTLS * LocalTLS; +; } +; $ 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 4370 # Record kind: S_LTHREAD32 +; ASM-NEXT: .long 116 # Type +; ASM-NEXT: .secrel32 "?LocalTLS@?1??bar@@YAHXZ@4HA" # DataOffset +; ASM-NEXT: .secidx "?LocalTLS@?1??bar@@YAHXZ@4HA" # Segment +; ASM-NEXT: .asciz "LocalTLS" # Name +; ASM-NEXT: .p2align 2 + +; ASM: .short 4365 # Record kind: S_GDATA32 +; 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 {{.*-.*}} # 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-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 {{.*-.*}} # 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 "?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: .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: ThreadLocalDataSym { +; OBJ-NEXT: Kind: S_LTHREAD32 (0x1112) +; OBJ-NEXT: DataOffset: ?LocalTLS@?1??bar@@YAHXZ@4HA+0x0 +; OBJ-NEXT: Type: int (0x74) +; OBJ-NEXT: DisplayName: LocalTLS +; OBJ-NEXT: LinkageName: ?LocalTLS@?1??bar@@YAHXZ@4HA +; OBJ-NEXT: } + +; 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: 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 +152,116 @@ ; YAML: Records: ; YAML: - Kind: S_COMPILE3 ; YAML: Compile3Sym: + +; YAML-LABEL: - Kind: S_LTHREAD32 +; YAML-NEXT: ThreadLocalDataSym: +; YAML-NEXT: Type: 116 +; YAML-NEXT: DisplayName: LocalTLS + ; 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' + +; 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" -; 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 +$"?comdat@?$A@X@@2HB" = comdat any -; 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" +@"?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 5, align 4, !dbg !21 +@"?last@@3HA" = dso_local global i32 0, align 4, !dbg !23 +@"?LocalTLS@?1??bar@@YAHXZ@4HA" = internal thread_local global i32 7, align 4, !dbg !25 +@"?globalStatic@foo@@3HA" = internal global i32 6, align 4, !dbg !30 -$"\01?comdat@?$A@X@@2HB" = comdat any +; Function Attrs: noinline nounwind optnone uwtable +define dso_local i32 @"?bar@@YAHXZ"() #0 !dbg !27 { +entry: + %0 = load i32, i32* @"?globalStatic@foo@@3HA", align 4, !dbg !39 + %1 = load i32, i32* @"?globalTLS@foo@@3HA", align 4, !dbg !39 + %2 = load i32, i32* @"?LocalTLS@?1??bar@@YAHXZ@4HA", align 4, !dbg !39 + %mul = mul nsw i32 %1, %2, !dbg !39 + %add = add nsw i32 %0, %mul, !dbg !39 + ret i32 %add, !dbg !39 +} -@"\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 +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 = !{!32, !33} +!llvm.module.flags = !{!34, !35, !36, !37} +!llvm.ident = !{!38} -!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: "3eacae02cace2f8718d2942a852762ec") !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, !30} +!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", file: !3, line: 2, size: 8, align: 8, elements: !12, templateParams: !13) +!11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", 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: 6, 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: 9, type: !9, isLocal: false, isDefinition: true) +!25 = !DIGlobalVariableExpression(var: !26, expr: !DIExpression()) +!26 = distinct !DIGlobalVariable(name: "LocalTLS", scope: !27, file: !3, line: 11, type: !9, isLocal: true, isDefinition: true) +!27 = distinct !DISubprogram(name: "bar", linkageName: "?bar@@YAHXZ", scope: !3, file: !3, line: 10, type: !28, scopeLine: 10, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !4) +!28 = !DISubroutineType(types: !29) +!29 = !{!9} +!30 = !DIGlobalVariableExpression(var: !31, expr: !DIExpression()) +!31 = distinct !DIGlobalVariable(name: "globalStatic", linkageName: "?globalStatic@foo@@3HA", scope: !20, file: !3, line: 7, type: !9, isLocal: true, isDefinition: true) +!32 = !{!"/DEFAULTLIB:libcmt.lib"} +!33 = !{!"/DEFAULTLIB:oldnames.lib"} +!34 = !{i32 2, !"CodeView", i32 1} +!35 = !{i32 2, !"Debug Info Version", i32 3} +!36 = !{i32 1, !"wchar_size", i32 2} +!37 = !{i32 7, !"PIC Level", i32 2} +!38 = !{!"clang version 11.0.0 (https://github.com/llvm/llvm-project.git f5b1301ce8575f6d82e87031a1a5485c33637a93)"} +!39 = !DILocation(line: 12, scope: !27)