Skip to content

Commit

Permalink
[DebugInfo] Combine Trivial and NonTrivial flags
Browse files Browse the repository at this point in the history
Summary:
Companion to https://reviews.llvm.org/D59347


Reviewers: rnk, zturner, probinson, dblaikie, deadalnix

Subscribers: aprantl, jdoerfert, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59348

llvm-svn: 358220
  • Loading branch information
aaronsm committed Apr 11, 2019
1 parent fa7745b commit 994023a
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 35 deletions.
2 changes: 1 addition & 1 deletion llvm/include/llvm-c/DebugInfo.h
Expand Up @@ -55,7 +55,7 @@ typedef enum {
LLVMDIFlagEnumClass = 1 << 24,
LLVMDIFlagFixedEnum = LLVMDIFlagEnumClass, // Deprecated.
LLVMDIFlagThunk = 1 << 25,
LLVMDIFlagTrivial = 1 << 26,
LLVMDIFlagNonTrivial = 1 << 26,
LLVMDIFlagBigEndian = 1 << 27,
LLVMDIFlagLittleEndian = 1 << 28,
LLVMDIFlagIndirectVirtualBase = (1 << 2) | (1 << 5),
Expand Down
5 changes: 2 additions & 3 deletions llvm/include/llvm/IR/DebugInfoFlags.def
Expand Up @@ -54,11 +54,10 @@ HANDLE_DI_FLAG((1 << 22), TypePassByValue)
HANDLE_DI_FLAG((1 << 23), TypePassByReference)
HANDLE_DI_FLAG((1 << 24), EnumClass)
HANDLE_DI_FLAG((1 << 25), Thunk)
HANDLE_DI_FLAG((1 << 26), Trivial)
HANDLE_DI_FLAG((1 << 26), NonTrivial)
HANDLE_DI_FLAG((1 << 27), BigEndian)
HANDLE_DI_FLAG((1 << 28), LittleEndian)
HANDLE_DI_FLAG((1 << 29), AllCallsDescribed)
HANDLE_DI_FLAG((1 << 30), NonTrivial)

// To avoid needing a dedicated value for IndirectVirtualBase, we use
// the bitwise or of Virtual and FwdDecl, which does not otherwise
Expand All @@ -68,7 +67,7 @@ HANDLE_DI_FLAG((1 << 2) | (1 << 5), IndirectVirtualBase)
#ifdef DI_FLAG_LARGEST_NEEDED
// intended to be used with ADT/BitmaskEnum.h
// NOTE: always must be equal to largest flag, check this when adding new flag
HANDLE_DI_FLAG((1 << 30), Largest)
HANDLE_DI_FLAG((1 << 29), Largest)
#undef DI_FLAG_LARGEST_NEEDED
#endif

Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/X86/pr39243.ll
Expand Up @@ -116,7 +116,7 @@ declare void @llvm.dbg.value(metadata, metadata, metadata) #2
!18 = distinct !DISubprogram(name: "echo", linkageName: "_Z4echo5onion", scope: !3, file: !3, line: 14, type: !19, isLocal: false, isDefinition: true, scopeLine: 14, flags: DIFlagPrototyped, isOptimized: true, unit: !2, retainedNodes: !29)
!19 = !DISubroutineType(types: !20)
!20 = !{!6, !21}
!21 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "onion", file: !3, line: 1, size: 64, flags: DIFlagTypePassByValue | DIFlagTrivial, elements: !22, identifier: "_ZTS5onion")
!21 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "onion", file: !3, line: 1, size: 64, flags: DIFlagTypePassByValue, elements: !22, identifier: "_ZTS5onion")
!22 = !{!23, !25}
!23 = !DIDerivedType(tag: DW_TAG_member, name: "dd", scope: !21, file: !3, line: 2, baseType: !24, size: 64)
!24 = !DIBasicType(name: "double", size: 64, encoding: DW_ATE_float)
Expand Down
24 changes: 12 additions & 12 deletions llvm/test/DebugInfo/COFF/class-options-common.ll
Expand Up @@ -849,7 +849,7 @@ attributes #1 = { nounwind readnone speculatable }
!10 = !{!11}
!11 = !DIDerivedType(tag: DW_TAG_member, name: "m", scope: !9, file: !8, line: 64, baseType: !12, size: 32)
!12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!13 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", file: !8, line: 55, size: 32, flags: DIFlagTypePassByValue | DIFlagTrivial, elements: !14, identifier: ".?AUFoo@@")
!13 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", file: !8, line: 55, size: 32, flags: DIFlagTypePassByValue, elements: !14, identifier: ".?AUFoo@@")
!14 = !{!15, !16, !20}
!15 = !DIDerivedType(tag: DW_TAG_member, name: "m", scope: !13, file: !8, line: 59, baseType: !12, size: 32)
!16 = !DISubprogram(name: "Foo", scope: !13, file: !8, line: 57, type: !17, isLocal: false, isDefinition: false, scopeLine: 57, flags: DIFlagPrototyped, isOptimized: false)
Expand All @@ -869,7 +869,7 @@ attributes #1 = { nounwind readnone speculatable }
!30 = distinct !DISubprogram(name: "Func_EmptyClass", linkageName: "?Func_EmptyClass@@YA?AVEmptyClass@@AEAV1@@Z", scope: !8, file: !8, line: 9, type: !31, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !2, retainedNodes: !4)
!31 = !DISubroutineType(types: !32)
!32 = !{!33, !34}
!33 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "EmptyClass", file: !8, line: 7, size: 8, flags: DIFlagTypePassByValue | DIFlagTrivial, elements: !4, identifier: ".?AVEmptyClass@@")
!33 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "EmptyClass", file: !8, line: 7, size: 8, flags: DIFlagTypePassByValue, elements: !4, identifier: ".?AVEmptyClass@@")
!34 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !33, size: 64)
!35 = !DILocalVariable(name: "arg", arg: 1, scope: !30, file: !8, line: 9, type: !34)
!36 = !DILocation(line: 9, scope: !30)
Expand All @@ -888,7 +888,7 @@ attributes #1 = { nounwind readnone speculatable }
!49 = distinct !DISubprogram(name: "Func_DefaultedCtorClass", linkageName: "?Func_DefaultedCtorClass@@YA?AVDefaultedCtorClass@@AEAV1@@Z", scope: !8, file: !8, line: 23, type: !50, isLocal: false, isDefinition: true, scopeLine: 23, flags: DIFlagPrototyped, isOptimized: false, unit: !2, retainedNodes: !4)
!50 = !DISubroutineType(types: !51)
!51 = !{!52, !58}
!52 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "DefaultedCtorClass", file: !8, line: 18, size: 8, flags: DIFlagTypePassByValue | DIFlagTrivial, elements: !53, identifier: ".?AVDefaultedCtorClass@@")
!52 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "DefaultedCtorClass", file: !8, line: 18, size: 8, flags: DIFlagTypePassByValue, elements: !53, identifier: ".?AVDefaultedCtorClass@@")
!53 = !{!54}
!54 = !DISubprogram(name: "DefaultedCtorClass", scope: !52, file: !8, line: 21, type: !55, isLocal: false, isDefinition: false, scopeLine: 21, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false)
!55 = !DISubroutineType(types: !56)
Expand Down Expand Up @@ -924,7 +924,7 @@ attributes #1 = { nounwind readnone speculatable }
!85 = distinct !DISubprogram(name: "Func_DefaultedDtorClass", linkageName: "?Func_DefaultedDtorClass@@YA?AVDefaultedDtorClass@@AEAV1@@Z", scope: !8, file: !8, line: 44, type: !86, isLocal: false, isDefinition: true, scopeLine: 44, flags: DIFlagPrototyped, isOptimized: false, unit: !2, retainedNodes: !4)
!86 = !DISubroutineType(types: !87)
!87 = !{!88, !94}
!88 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "DefaultedDtorClass", file: !8, line: 39, size: 8, flags: DIFlagTypePassByValue | DIFlagTrivial, elements: !89, identifier: ".?AVDefaultedDtorClass@@")
!88 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "DefaultedDtorClass", file: !8, line: 39, size: 8, flags: DIFlagTypePassByValue, elements: !89, identifier: ".?AVDefaultedDtorClass@@")
!89 = !{!90}
!90 = !DISubprogram(name: "~DefaultedDtorClass", scope: !88, file: !8, line: 42, type: !91, isLocal: false, isDefinition: false, scopeLine: 42, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false)
!91 = !DISubroutineType(types: !92)
Expand All @@ -945,7 +945,7 @@ attributes #1 = { nounwind readnone speculatable }
!106 = distinct !DISubprogram(name: "Func_BClass", linkageName: "?Func_BClass@@YA?AVBClass@@AEAV1@@Z", scope: !8, file: !8, line: 53, type: !107, isLocal: false, isDefinition: true, scopeLine: 53, flags: DIFlagPrototyped, isOptimized: false, unit: !2, retainedNodes: !4)
!107 = !DISubroutineType(types: !108)
!108 = !{!109, !112}
!109 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "BClass", file: !8, line: 51, size: 8, flags: DIFlagTypePassByValue | DIFlagTrivial, elements: !110, identifier: ".?AVBClass@@")
!109 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "BClass", file: !8, line: 51, size: 8, flags: DIFlagTypePassByValue, elements: !110, identifier: ".?AVBClass@@")
!110 = !{!111}
!111 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !109, file: !8, line: 51, baseType: !12, flags: DIFlagStaticMember)
!112 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !109, size: 64)
Expand All @@ -954,7 +954,7 @@ attributes #1 = { nounwind readnone speculatable }
!115 = distinct !DISubprogram(name: "Func_AStruct", linkageName: "?Func_AStruct@@YA?AUAStruct@@AEAU1@@Z", scope: !8, file: !8, line: 69, type: !116, isLocal: false, isDefinition: true, scopeLine: 69, flags: DIFlagPrototyped, isOptimized: false, unit: !2, retainedNodes: !4)
!116 = !DISubroutineType(types: !117)
!117 = !{!118, !119}
!118 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "AStruct", file: !8, line: 67, size: 8, flags: DIFlagTypePassByValue | DIFlagTrivial, elements: !4, identifier: ".?AUAStruct@@")
!118 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "AStruct", file: !8, line: 67, size: 8, flags: DIFlagTypePassByValue, elements: !4, identifier: ".?AUAStruct@@")
!119 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !118, size: 64)
!120 = !DILocalVariable(name: "arg", arg: 1, scope: !115, file: !8, line: 69, type: !119)
!121 = !DILocation(line: 69, scope: !115)
Expand All @@ -974,23 +974,23 @@ attributes #1 = { nounwind readnone speculatable }
!135 = !DISubroutineType(types: !136)
!136 = !{null}
!137 = !DILocalVariable(name: "s", scope: !134, file: !8, line: 85, type: !138)
!138 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "ComplexStruct", scope: !134, file: !8, line: 76, size: 8, flags: DIFlagTypePassByValue | DIFlagTrivial, elements: !139, identifier: ".?AUComplexStruct@?1??S@@YAXXZ@")
!138 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "ComplexStruct", scope: !134, file: !8, line: 76, size: 8, flags: DIFlagTypePassByValue, elements: !139, identifier: ".?AUComplexStruct@?1??S@@YAXXZ@")
!139 = !{!140, !141}
!140 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", scope: !138, file: !8, line: 80, size: 8, flags: DIFlagTypePassByValue | DIFlagTrivial, elements: !4, identifier: ".?AUS@ComplexStruct@?1??0@YAXXZ@")
!140 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", scope: !138, file: !8, line: 80, size: 8, flags: DIFlagTypePassByValue, elements: !4, identifier: ".?AUS@ComplexStruct@?1??0@YAXXZ@")
!141 = !DIDerivedType(tag: DW_TAG_member, name: "s", scope: !138, file: !8, line: 83, baseType: !140, size: 8)
!142 = !DILocation(line: 85, scope: !134)
!143 = !DILocation(line: 86, scope: !134)
!144 = distinct !DISubprogram(name: "Func_AUnion", linkageName: "?Func_AUnion@@YA?ATAUnion@@AEAT1@@Z", scope: !8, file: !8, line: 90, type: !145, isLocal: false, isDefinition: true, scopeLine: 90, flags: DIFlagPrototyped, isOptimized: false, unit: !2, retainedNodes: !4)
!145 = !DISubroutineType(types: !146)
!146 = !{!147, !148}
!147 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "AUnion", file: !8, line: 88, size: 8, flags: DIFlagTypePassByValue | DIFlagTrivial, elements: !4, identifier: ".?ATAUnion@@")
!147 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "AUnion", file: !8, line: 88, size: 8, flags: DIFlagTypePassByValue, elements: !4, identifier: ".?ATAUnion@@")
!148 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !147, size: 64)
!149 = !DILocalVariable(name: "arg", arg: 1, scope: !144, file: !8, line: 90, type: !148)
!150 = !DILocation(line: 90, scope: !144)
!151 = distinct !DISubprogram(name: "Func_BUnion", linkageName: "?Func_BUnion@@YA?ATBUnion@@AEAT1@@Z", scope: !8, file: !8, line: 94, type: !152, isLocal: false, isDefinition: true, scopeLine: 94, flags: DIFlagPrototyped, isOptimized: false, unit: !2, retainedNodes: !4)
!152 = !DISubroutineType(types: !153)
!153 = !{!154, !160}
!154 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "BUnion", file: !8, line: 92, size: 8, flags: DIFlagTypePassByValue | DIFlagTrivial, elements: !155, identifier: ".?ATBUnion@@")
!154 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "BUnion", file: !8, line: 92, size: 8, flags: DIFlagTypePassByValue, elements: !155, identifier: ".?ATBUnion@@")
!155 = !{!156}
!156 = !DISubprogram(name: "BUnion", scope: !154, file: !8, line: 92, type: !157, isLocal: false, isDefinition: false, scopeLine: 92, flags: DIFlagPrototyped, isOptimized: false)
!157 = !DISubroutineType(types: !158)
Expand All @@ -1001,9 +1001,9 @@ attributes #1 = { nounwind readnone speculatable }
!162 = !DILocation(line: 94, scope: !151)
!163 = distinct !DISubprogram(name: "U", linkageName: "?U@@YAXXZ", scope: !8, file: !8, line: 96, type: !135, isLocal: false, isDefinition: true, scopeLine: 96, flags: DIFlagPrototyped, isOptimized: false, unit: !2, retainedNodes: !4)
!164 = !DILocalVariable(name: "c", scope: !163, file: !8, line: 105, type: !165)
!165 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "ComplexUnion", scope: !163, file: !8, line: 97, size: 32, flags: DIFlagTypePassByValue | DIFlagTrivial, elements: !166, identifier: ".?ATComplexUnion@?1??U@@YAXXZ@")
!165 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "ComplexUnion", scope: !163, file: !8, line: 97, size: 32, flags: DIFlagTypePassByValue, elements: !166, identifier: ".?ATComplexUnion@?1??U@@YAXXZ@")
!166 = !{!167, !170, !171}
!167 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "NestedUnion", scope: !165, file: !8, line: 100, size: 32, flags: DIFlagTypePassByValue | DIFlagTrivial, elements: !168, identifier: ".?ATNestedUnion@ComplexUnion@?1??U@@YAXXZ@")
!167 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "NestedUnion", scope: !165, file: !8, line: 100, size: 32, flags: DIFlagTypePassByValue, elements: !168, identifier: ".?ATNestedUnion@ComplexUnion@?1??U@@YAXXZ@")
!168 = !{!169}
!169 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !167, file: !8, line: 100, baseType: !12, size: 32)
!170 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !165, file: !8, line: 102, baseType: !167, size: 32)
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/DebugInfo/COFF/enum-co.ll
Expand Up @@ -149,8 +149,8 @@ attributes #1 = { nounwind readnone speculatable }
!16 = !{null}
!17 = !{}
!18 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "NestedEnum", scope: !19, file: !1, line: 16, baseType: !4, size: 32, elements: !24, identifier: ".?AW4NestedEnum@Union@Struct@?1??Func@@YAXXZ@")
!19 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "Union", scope: !20, file: !1, line: 15, size: 8, flags: DIFlagTypePassByValue | DIFlagTrivial, elements: !23, identifier: ".?ATUnion@Struct@?1??Func@@YAXXZ@")
!20 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Struct", scope: !14, file: !1, line: 14, size: 8, flags: DIFlagTypePassByValue | DIFlagTrivial, elements: !21, identifier: ".?AUStruct@?1??Func@@YAXXZ@")
!19 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "Union", scope: !20, file: !1, line: 15, size: 8, flags: DIFlagTypePassByValue, elements: !23, identifier: ".?ATUnion@Struct@?1??Func@@YAXXZ@")
!20 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Struct", scope: !14, file: !1, line: 14, size: 8, flags: DIFlagTypePassByValue, elements: !21, identifier: ".?AUStruct@?1??Func@@YAXXZ@")
!21 = !{!19, !22}
!22 = !DIDerivedType(tag: DW_TAG_member, name: "U", scope: !20, file: !1, line: 18, baseType: !19, size: 8)
!23 = !{!18}
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/DebugInfo/COFF/frameproc-flags.ll
Expand Up @@ -298,7 +298,7 @@ attributes #12 = { noinline }
!8 = !{!0}
!9 = !DIDerivedType(tag: DW_TAG_typedef, name: "jmp_buf", file: !3, line: 7, baseType: !10)
!10 = !DICompositeType(tag: DW_TAG_array_type, baseType: !11, size: 2048, elements: !18)
!11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_jmp_buf_str", file: !3, line: 4, size: 128, align: 128, flags: DIFlagTypePassByValue | DIFlagTrivial, elements: !12, identifier: ".?AU_jmp_buf_str@@")
!11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "_jmp_buf_str", file: !3, line: 4, size: 128, align: 128, flags: DIFlagTypePassByValue, elements: !12, identifier: ".?AU_jmp_buf_str@@")
!12 = !{!13}
!13 = !DIDerivedType(tag: DW_TAG_member, name: "Part", scope: !11, file: !3, line: 5, baseType: !14, size: 128)
!14 = !DICompositeType(tag: DW_TAG_array_type, baseType: !15, size: 128, elements: !16)
Expand Down

0 comments on commit 994023a

Please sign in to comment.