244 lines · plain
1; RUN: llc %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o - | llvm-dwarfdump - | FileCheck %s2 3; Check that there are no empty DW_TAG_subprogram tags.4; CHECK: DW_TAG_subprogram5; CHECK-NEXT: DW_AT6; CHECK: DW_TAG_subprogram7; CHECK-NEXT: DW_AT8; CHECK: DW_TAG_subprogram9; CHECK-NEXT: DW_AT10; CHECK: DW_TAG_subprogram11; CHECK-NEXT: DW_AT12; CHECK: DW_TAG_subprogram13; CHECK-NEXT: DW_AT14; CHECK: DW_TAG_subprogram15; CHECK-NEXT: DW_AT16; CHECK: DW_TAG_subprogram17; CHECK-NEXT: DW_AT18; CHECK: DW_TAG_subprogram19; CHECK-NEXT: DW_AT20; CHECK: DW_TAG_subprogram21; CHECK-NEXT: DW_AT22; CHECK: DW_TAG_subprogram23; CHECK-NEXT: DW_AT24; CHECK: DW_TAG_subprogram25; CHECK-NEXT: DW_AT26; CHECK: DW_TAG_subprogram27; CHECK-NEXT: DW_AT28; CHECK: DW_TAG_subprogram29; CHECK-NEXT: DW_AT30; CHECK: DW_TAG_subprogram31; CHECK-NEXT: DW_AT32; CHECK: DW_TAG_subprogram33; CHECK-NEXT: DW_AT34; CHECK: DW_TAG_subprogram35; CHECK-NEXT: DW_AT36; CHECK-NOT: DW_TAG_subprogram37 38target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"39target triple = "x86_64-unknown-linux-gnu"40 41%class.function = type { i8 }42%class.BPLFunctionWriter = type { ptr }43%struct.BPLModuleWriter = type { i8 }44%class.anon = type { i8 }45%class.anon.0 = type { i8 }46 47@"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_" = internal alias void (ptr), ptr @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_"48@"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_0EET_" = internal alias void (ptr), ptr @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_0EET_"49 50define void @_ZN17BPLFunctionWriter9writeExprEv(ptr %this) nounwind uwtable align 2 !dbg !5 {51entry:52 %this.addr = alloca ptr, align 853 %agg.tmp = alloca %class.function, align 154 %agg.tmp2 = alloca %class.anon, align 155 %agg.tmp4 = alloca %class.function, align 156 %agg.tmp5 = alloca %class.anon.0, align 157 store ptr %this, ptr %this.addr, align 858 call void @llvm.dbg.declare(metadata ptr %this.addr, metadata !133, metadata !DIExpression()), !dbg !13559 %this1 = load ptr, ptr %this.addr60 %0 = load ptr, ptr %this1, align 8, !dbg !13661 call void @"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_0EET_"(ptr %agg.tmp), !dbg !13662 call void @_ZN15BPLModuleWriter14writeIntrinsicE8functionIFvvEE(ptr %0), !dbg !13663 %1 = load ptr, ptr %this1, align 8, !dbg !13864 call void @"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_"(ptr %agg.tmp4), !dbg !13865 call void @_ZN15BPLModuleWriter14writeIntrinsicE8functionIFvvEE(ptr %1), !dbg !13866 ret void, !dbg !13967}68 69declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone70 71declare void @_ZN15BPLModuleWriter14writeIntrinsicE8functionIFvvEE(ptr)72 73define internal void @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_"(ptr %this) unnamed_addr nounwind uwtable align 2 {74entry:75 %this.addr = alloca ptr, align 876 %__f = alloca %class.anon.0, align 177 store ptr %this, ptr %this.addr, align 878 call void @llvm.dbg.declare(metadata ptr %this.addr, metadata !140, metadata !DIExpression()), !dbg !14279 call void @llvm.dbg.declare(metadata ptr %__f, metadata !143, metadata !DIExpression()), !dbg !14480 %this1 = load ptr, ptr %this.addr81 call void @"_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_1_0EEvRKT_"(ptr %__f), !dbg !14582 ret void, !dbg !14783}84 85define internal void @"_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_1_0EEvRKT_"(ptr) nounwind uwtable align 2 {86entry:87 %.addr = alloca ptr, align 888 store ptr %0, ptr %.addr, align 889 ret void, !dbg !14890}91 92define internal void @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_0EET_"(ptr %this) unnamed_addr nounwind uwtable align 2 {93entry:94 %this.addr = alloca ptr, align 895 %__f = alloca %class.anon, align 196 store ptr %this, ptr %this.addr, align 897 call void @llvm.dbg.declare(metadata ptr %this.addr, metadata !150, metadata !DIExpression()), !dbg !15198 call void @llvm.dbg.declare(metadata ptr %__f, metadata !152, metadata !DIExpression()), !dbg !15399 %this1 = load ptr, ptr %this.addr100 call void @"_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_0EEvRKT_"(ptr %__f), !dbg !154101 ret void, !dbg !156102}103 104define internal void @"_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_0EEvRKT_"(ptr) nounwind uwtable align 2 {105entry:106 %.addr = alloca ptr, align 8107 store ptr %0, ptr %.addr, align 8108 ret void, !dbg !157109}110 111!llvm.dbg.cu = !{!0}112!llvm.module.flags = !{!162}113 114!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 ", isOptimized: false, emissionKind: FullDebug, file: !161, enums: !1, retainedTypes: !1, globals: !128)115!1 = !{}116!5 = distinct !DISubprogram(name: "writeExpr", linkageName: "_ZN17BPLFunctionWriter9writeExprEv", line: 19, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 19, file: !6, scope: null, type: !7, declaration: !103, retainedNodes: !1)117!6 = !DIFile(filename: "BPLFunctionWriter2.ii", directory: "/home/peter/crashdelta")118!7 = !DISubroutineType(types: !8)119!8 = !{null, !9}120!9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, baseType: !10)121!10 = !DICompositeType(tag: DW_TAG_class_type, name: "BPLFunctionWriter", line: 15, size: 64, align: 64, file: !160, elements: !11)122!11 = !{!12, !103}123!12 = !DIDerivedType(tag: DW_TAG_member, name: "MW", line: 16, size: 64, align: 64, flags: DIFlagPrivate, file: !160, scope: !10, baseType: !13)124!13 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !14)125!14 = !DICompositeType(tag: DW_TAG_class_type, name: "BPLModuleWriter", line: 12, size: 8, align: 8, file: !160, elements: !15)126!15 = !{!16}127!16 = !DISubprogram(name: "writeIntrinsic", linkageName: "_ZN15BPLModuleWriter14writeIntrinsicE8functionIFvvEE", line: 13, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 13, file: !6, scope: !14, type: !17)128!17 = !DISubroutineType(types: !18)129!18 = !{null, !19, !20}130!19 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, baseType: !14)131!20 = !DICompositeType(tag: DW_TAG_class_type, name: "function<void ()>", line: 6, size: 8, align: 8, file: !160, elements: !21, templateParams: !97)132!21 = !{!22, !51, !58, !86, !92}133!22 = !DISubprogram(name: "function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:20:36> >", line: 8, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !6, scope: !20, type: !23, templateParams: !47)134!23 = !DISubroutineType(types: !24)135!24 = !{null, !25, !26}136!25 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, baseType: !20)137!26 = !DICompositeType(tag: DW_TAG_class_type, line: 20, size: 8, align: 8, file: !160, scope: !5, elements: !27)138!27 = !{!28, !35, !41}139!28 = !DISubprogram(name: "operator()", line: 20, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 20, file: !6, scope: !26, type: !29)140!29 = !DISubroutineType(types: !30)141!30 = !{null, !31}142!31 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, baseType: !32)143!32 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !26)144!35 = !DISubprogram(name: "~", line: 20, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 20, file: !6, scope: !26, type: !36)145!36 = !DISubroutineType(types: !37)146!37 = !{null, !38}147!38 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, baseType: !26)148!41 = !DISubprogram(name: "", line: 20, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 20, file: !6, scope: !26, type: !42)149!42 = !DISubroutineType(types: !43)150!43 = !{null, !38, !44}151!44 = !DIDerivedType(tag: DW_TAG_rvalue_reference_type, baseType: !26)152!47 = !{!48}153!48 = !DITemplateTypeParameter(name: "_Functor", type: !26)154!51 = !DISubprogram(name: "function<function<void ()> >", line: 8, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !6, scope: !20, type: !52, templateParams: !54)155!52 = !DISubroutineType(types: !53)156!53 = !{null, !25, !20}157!54 = !{!55}158!55 = !DITemplateTypeParameter(name: "_Functor", type: !20)159!58 = !DISubprogram(name: "function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:23:36> >", line: 8, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !6, scope: !20, type: !59, templateParams: !82)160!59 = !DISubroutineType(types: !60)161!60 = !{null, !25, !61}162!61 = !DICompositeType(tag: DW_TAG_class_type, line: 23, size: 8, align: 8, file: !160, scope: !5, elements: !62)163!62 = !{!63, !70, !76}164!63 = !DISubprogram(name: "operator()", line: 23, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 23, file: !6, scope: !61, type: !64)165!64 = !DISubroutineType(types: !65)166!65 = !{null, !66}167!66 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, baseType: !67)168!67 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !61)169!70 = !DISubprogram(name: "~", line: 23, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 23, file: !6, scope: !61, type: !71)170!71 = !DISubroutineType(types: !72)171!72 = !{null, !73}172!73 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, baseType: !61)173!76 = !DISubprogram(name: "", line: 23, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 23, file: !6, scope: !61, type: !77)174!77 = !DISubroutineType(types: !78)175!78 = !{null, !73, !79}176!79 = !DIDerivedType(tag: DW_TAG_rvalue_reference_type, baseType: !61)177!82 = !{!83}178!83 = !DITemplateTypeParameter(name: "_Functor", type: !61)179!86 = !DISubprogram(name: "function", line: 6, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !6, scope: !20, type: !87)180!87 = !DISubroutineType(types: !88)181!88 = !{null, !25, !89}182!89 = !DIDerivedType(tag: DW_TAG_rvalue_reference_type, baseType: !20)183!92 = !DISubprogram(name: "~function", line: 6, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !6, scope: !20, type: !93)184!93 = !DISubroutineType(types: !94)185!94 = !{null, !25}186!97 = !{!98}187!98 = !DITemplateTypeParameter(name: "T", type: !99)188!99 = !DISubroutineType(types: !100)189!100 = !{null}190!103 = !DISubprogram(name: "writeExpr", linkageName: "_ZN17BPLFunctionWriter9writeExprEv", line: 17, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrivate | DIFlagPrototyped, isOptimized: false, scopeLine: 17, file: !6, scope: !10, type: !7)191!106 = distinct !DISubprogram(name: "function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:23:36> >", linkageName: "_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_", line: 8, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 8, file: !6, scope: null, type: !59, templateParams: !82, declaration: !58, retainedNodes: !1)192!107 = distinct !DISubprogram(name: "_M_not_empty_function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:23:36> >", linkageName: "_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_1_0EEvRKT_", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !6, scope: null, type: !108, templateParams: !111, declaration: !113, retainedNodes: !1)193!108 = !DISubroutineType(types: !109)194!109 = !{null, !110}195!110 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !61)196!111 = !{!112}197!112 = !DITemplateTypeParameter(name: "_Tp", type: !61)198!113 = !DISubprogram(name: "_M_not_empty_function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:23:36> >", linkageName: "_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_1_0EEvRKT_", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !6, scope: !114, type: !108, templateParams: !111)199!114 = !DICompositeType(tag: DW_TAG_class_type, name: "_Base_manager", line: 1, size: 8, align: 8, file: !160, elements: !115)200!115 = !{!116, !113}201!116 = !DISubprogram(name: "_M_not_empty_function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:20:36> >", linkageName: "_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_0EEvRKT_", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !6, scope: !114, type: !117, templateParams: !120)202!117 = !DISubroutineType(types: !118)203!118 = !{null, !119}204!119 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !26)205!120 = !{!121}206!121 = !DITemplateTypeParameter(name: "_Tp", type: !26)207!126 = distinct !DISubprogram(name: "function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:20:36> >", linkageName: "_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_0EET_", line: 8, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 8, file: !6, scope: null, type: !23, templateParams: !47, declaration: !22, retainedNodes: !1)208!127 = distinct !DISubprogram(name: "_M_not_empty_function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:20:36> >", linkageName: "_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_0EEvRKT_", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !6, scope: null, type: !117, templateParams: !120, declaration: !116, retainedNodes: !1)209!128 = !{!130}210!130 = !DIGlobalVariableExpression(var: !163, expr: !DIExpression(DW_OP_constu, 1, DW_OP_stack_value))211!131 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !132)212!132 = !DIBasicType(tag: DW_TAG_base_type, name: "bool", size: 8, align: 8, encoding: DW_ATE_boolean)213!133 = !DILocalVariable(name: "this", line: 19, arg: 1, flags: DIFlagArtificial, scope: !5, file: !6, type: !134)214!134 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !10)215!135 = !DILocation(line: 19, column: 39, scope: !5)216!136 = !DILocation(line: 20, column: 17, scope: !137)217!137 = distinct !DILexicalBlock(line: 19, column: 51, file: !6, scope: !5)218!138 = !DILocation(line: 23, column: 17, scope: !137)219!139 = !DILocation(line: 26, column: 15, scope: !137)220!140 = !DILocalVariable(name: "this", line: 8, arg: 1, flags: DIFlagArtificial, scope: !106, file: !6, type: !141)221!141 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !20)222!142 = !DILocation(line: 8, column: 45, scope: !106)223!143 = !DILocalVariable(name: "__f", line: 8, arg: 2, scope: !106, file: !6, type: !61)224!144 = !DILocation(line: 8, column: 63, scope: !106)225!145 = !DILocation(line: 9, column: 9, scope: !146)226!146 = distinct !DILexicalBlock(line: 8, column: 81, file: !6, scope: !106)227!147 = !DILocation(line: 10, column: 13, scope: !146)228!148 = !DILocation(line: 4, column: 5, scope: !149)229!149 = distinct !DILexicalBlock(line: 3, column: 105, file: !6, scope: !107)230!150 = !DILocalVariable(name: "this", line: 8, arg: 1, flags: DIFlagArtificial, scope: !126, file: !6, type: !141)231!151 = !DILocation(line: 8, column: 45, scope: !126)232!152 = !DILocalVariable(name: "__f", line: 8, arg: 2, scope: !126, file: !6, type: !26)233!153 = !DILocation(line: 8, column: 63, scope: !126)234!154 = !DILocation(line: 9, column: 9, scope: !155)235!155 = distinct !DILexicalBlock(line: 8, column: 81, file: !6, scope: !126)236!156 = !DILocation(line: 10, column: 13, scope: !155)237!157 = !DILocation(line: 4, column: 5, scope: !158)238!158 = distinct !DILexicalBlock(line: 3, column: 105, file: !6, scope: !127)239!159 = !DIFile(filename: "BPLFunctionWriter.cpp", directory: "/home/peter/crashdelta")240!160 = !DIFile(filename: "BPLFunctionWriter2.ii", directory: "/home/peter/crashdelta")241!161 = !DIFile(filename: "BPLFunctionWriter.cpp", directory: "/home/peter/crashdelta")242!162 = !{i32 1, !"Debug Info Version", i32 3}243!163 = distinct !DIGlobalVariable(name: "__stored_locally", linkageName: "__stored_locally", line: 2, isLocal: true, isDefinition: true, scope: !114, file: !6, type: !131)244