Index: include/llvm-c/DebugInfo.h =================================================================== --- include/llvm-c/DebugInfo.h +++ include/llvm-c/DebugInfo.h @@ -50,15 +50,14 @@ LLVMDIFlagIntroducedVirtual = 1 << 18, LLVMDIFlagBitField = 1 << 19, LLVMDIFlagNoReturn = 1 << 20, - LLVMDIFlagMainSubprogram = 1 << 21, - LLVMDIFlagTypePassByValue = 1 << 22, - LLVMDIFlagTypePassByReference = 1 << 23, - LLVMDIFlagEnumClass = 1 << 24, + LLVMDIFlagTypePassByValue = 1 << 21, + LLVMDIFlagTypePassByReference = 1 << 22, + LLVMDIFlagEnumClass = 1 << 23, LLVMDIFlagFixedEnum = LLVMDIFlagEnumClass, // Deprecated. - LLVMDIFlagThunk = 1 << 25, - LLVMDIFlagTrivial = 1 << 26, - LLVMDIFlagBigEndian = 1 << 27, - LLVMDIFlagLittleEndian = 1 << 28, + LLVMDIFlagThunk = 1 << 24, + LLVMDIFlagTrivial = 1 << 25, + LLVMDIFlagBigEndian = 1 << 26, + LLVMDIFlagLittleEndian = 1 << 27, LLVMDIFlagIndirectVirtualBase = (1 << 2) | (1 << 5), LLVMDIFlagAccessibility = LLVMDIFlagPrivate | LLVMDIFlagProtected | LLVMDIFlagPublic, Index: include/llvm/IR/DebugInfoFlags.def =================================================================== --- include/llvm/IR/DebugInfoFlags.def +++ include/llvm/IR/DebugInfoFlags.def @@ -50,16 +50,15 @@ HANDLE_DI_FLAG((1 << 18), IntroducedVirtual) HANDLE_DI_FLAG((1 << 19), BitField) HANDLE_DI_FLAG((1 << 20), NoReturn) -HANDLE_DI_FLAG((1 << 21), MainSubprogram) -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 << 27), BigEndian) -HANDLE_DI_FLAG((1 << 28), LittleEndian) -HANDLE_DI_FLAG((1 << 29), AllCallsDescribed) -HANDLE_DI_FLAG((1 << 30), NonTrivial) +HANDLE_DI_FLAG((1 << 21), TypePassByValue) +HANDLE_DI_FLAG((1 << 22), TypePassByReference) +HANDLE_DI_FLAG((1 << 23), EnumClass) +HANDLE_DI_FLAG((1 << 24), Thunk) +HANDLE_DI_FLAG((1 << 25), Trivial) +HANDLE_DI_FLAG((1 << 26), BigEndian) +HANDLE_DI_FLAG((1 << 27), LittleEndian) +HANDLE_DI_FLAG((1 << 28), AllCallsDescribed) +HANDLE_DI_FLAG((1 << 29), NonTrivial) // To avoid needing a dedicated value for IndirectVirtualBase, we use // the bitwise or of Virtual and FwdDecl, which does not otherwise @@ -69,7 +68,7 @@ #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 @@ -85,11 +84,12 @@ HANDLE_DISP_FLAG((1u << 2), LocalToUnit) HANDLE_DISP_FLAG((1u << 3), Definition) HANDLE_DISP_FLAG((1u << 4), Optimized) +HANDLE_DISP_FLAG((1u << 5), MainSubprogram) #ifdef DISP_FLAG_LARGEST_NEEDED // Intended to be used with ADT/BitmaskEnum.h. // NOTE: Always must be equal to largest flag, check this when adding new flags. -HANDLE_DISP_FLAG((1 << 4), Largest) +HANDLE_DISP_FLAG((1 << 5), Largest) #undef DISP_FLAG_LARGEST_NEEDED #endif Index: include/llvm/IR/DebugInfoMetadata.h =================================================================== --- include/llvm/IR/DebugInfoMetadata.h +++ include/llvm/IR/DebugInfoMetadata.h @@ -1784,6 +1784,7 @@ bool isLocalToUnit() const { return getSPFlags() & SPFlagLocalToUnit; } bool isDefinition() const { return getSPFlags() & SPFlagDefinition; } bool isOptimized() const { return getSPFlags() & SPFlagOptimized; } + bool isMainSubprogram() const { return getSPFlags() & SPFlagMainSubprogram; } bool isArtificial() const { return getFlags() & FlagArtificial; } bool isPrivate() const { @@ -1800,7 +1801,6 @@ bool areAllCallsDescribed() const { return getFlags() & FlagAllCallsDescribed; } - bool isMainSubprogram() const { return getFlags() & FlagMainSubprogram; } /// Check if this is reference-qualified. /// Index: test/DebugInfo/Generic/containing-type-extension.ll =================================================================== --- test/DebugInfo/Generic/containing-type-extension.ll +++ test/DebugInfo/Generic/containing-type-extension.ll @@ -25,7 +25,7 @@ !0 = distinct !DICompileUnit(language: DW_LANG_Rust, producer: "clang version 3.4 (trunk 185475)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !15, imports: !2) !1 = !DIFile(filename: "CodeGen/dwarf-version.c", directory: "test") !2 = !{} -!4 = distinct !DISubprogram(name: "main", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped | DIFlagMainSubprogram, isOptimized: false, unit: !0, scopeLine: 6, file: !1, scope: !5, type: !6, retainedNodes: !2) +!4 = distinct !DISubprogram(name: "main", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagMainSubprogram, isOptimized: false, unit: !0, scopeLine: 6, file: !1, scope: !5, type: !6, retainedNodes: !2) !5 = !DIFile(filename: "CodeGen/dwarf-version.c", directory: "test") !6 = !DISubroutineType(types: !7) !7 = !{!8} Index: test/DebugInfo/Generic/discriminated-union.ll =================================================================== --- test/DebugInfo/Generic/discriminated-union.ll +++ test/DebugInfo/Generic/discriminated-union.ll @@ -53,7 +53,7 @@ !2 = distinct !DICompileUnit(language: DW_LANG_Rust, file: !3, producer: "clang LLVM (rustc version 1.24.0-dev)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4) !3 = !DIFile(filename: "e3.rs", directory: "/home/tromey/Rust") !4 = !{} -!5 = distinct !DISubprogram(name: "main", linkageName: "_ZN2e34mainE", scope: !6, file: !3, line: 2, type: !8, isLocal: true, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped | DIFlagMainSubprogram, isOptimized: false, unit: !2, templateParams: !4, retainedNodes: !4) +!5 = distinct !DISubprogram(name: "main", linkageName: "_ZN2e34mainE", scope: !6, file: !3, line: 2, type: !8, isLocal: true, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagMainSubprogram, isOptimized: false, unit: !2, templateParams: !4, retainedNodes: !4) !6 = !DINamespace(name: "e3", scope: null) !7 = !DIFile(filename: "", directory: "") !8 = !DISubroutineType(types: !9) Index: test/DebugInfo/Generic/mainsubprogram.ll =================================================================== --- test/DebugInfo/Generic/mainsubprogram.ll +++ test/DebugInfo/Generic/mainsubprogram.ll @@ -25,7 +25,7 @@ !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 185475)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2) !1 = !DIFile(filename: "CodeGen/dwarf-version.c", directory: "test") !2 = !{} -!4 = distinct !DISubprogram(name: "main", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped | DIFlagMainSubprogram, isOptimized: false, unit: !0, scopeLine: 6, file: !1, scope: !5, type: !6, retainedNodes: !2) +!4 = distinct !DISubprogram(name: "main", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagMainSubprogram, isOptimized: false, unit: !0, scopeLine: 6, file: !1, scope: !5, type: !6, retainedNodes: !2) !5 = !DIFile(filename: "CodeGen/dwarf-version.c", directory: "test") !6 = !DISubroutineType(types: !7) !7 = !{!8} Index: test/DebugInfo/Generic/univariant-discriminated-union.ll =================================================================== --- test/DebugInfo/Generic/univariant-discriminated-union.ll +++ test/DebugInfo/Generic/univariant-discriminated-union.ll @@ -40,7 +40,7 @@ !2 = distinct !DICompileUnit(language: DW_LANG_Rust, file: !3, producer: "clang LLVM (rustc version 1.24.0-dev)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4) !3 = !DIFile(filename: "e3.rs", directory: "/home/tromey/Rust") !4 = !{} -!5 = distinct !DISubprogram(name: "main", linkageName: "_ZN2e34mainE", scope: !6, file: !3, line: 2, type: !8, isLocal: true, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped | DIFlagMainSubprogram, isOptimized: false, unit: !2, templateParams: !4, retainedNodes: !4) +!5 = distinct !DISubprogram(name: "main", linkageName: "_ZN2e34mainE", scope: !6, file: !3, line: 2, type: !8, isLocal: true, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagMainSubprogram, isOptimized: false, unit: !2, templateParams: !4, retainedNodes: !4) !6 = !DINamespace(name: "e3", scope: null) !7 = !DIFile(filename: "", directory: "") !8 = !DISubroutineType(types: !9) Index: test/DebugInfo/X86/containing-type-extension-rust.ll =================================================================== --- test/DebugInfo/X86/containing-type-extension-rust.ll +++ test/DebugInfo/X86/containing-type-extension-rust.ll @@ -109,7 +109,7 @@ !22 = !DIExpression() !23 = !DILocation(line: 1, scope: !11) !24 = !DILocation(line: 59, scope: !11) -!25 = distinct !DISubprogram(name: "main", linkageName: "_ZN2t24mainE", scope: !26, file: !9, line: 9, type: !27, isLocal: true, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped | DIFlagMainSubprogram, isOptimized: false, unit: !8, templateParams: !4, retainedNodes: !4) +!25 = distinct !DISubprogram(name: "main", linkageName: "_ZN2t24mainE", scope: !26, file: !9, line: 9, type: !27, isLocal: true, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagMainSubprogram, isOptimized: false, unit: !8, templateParams: !4, retainedNodes: !4) !26 = !DINamespace(name: "t2", scope: null) !27 = !DISubroutineType(types: !28) !28 = !{null}