diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -39,6 +39,8 @@ #include #include +#define DEBUG_TYPE "dwarfdebug" + using namespace llvm; static dwarf::Tag GetCompileUnitType(UnitKind Kind, DwarfDebug *DW) { @@ -1172,9 +1174,19 @@ addDIEEntry(*Die, dwarf::DW_AT_abstract_origin, *AbsEntity->getDIE()); Label = dyn_cast(Entity); } else { - if (const DbgVariable *Var = dyn_cast(Entity)) + if (const DbgVariable *Var = dyn_cast(Entity)) { applyVariableAttributes(*Var, *Die); - else if ((Label = dyn_cast(Entity))) + // Check if this is a scoped variable, if so try creating/inserting + // DW_AT_start_scope. + if (dyn_cast_or_null( + Var->getVariable()->getScope())) + if (Var->getVarSymbol() && Var->getScopeBeginSymbol()) { + addLabelDelta(*Die, dwarf::DW_AT_start_scope, Var->getVarSymbol(), + Var->getScopeBeginSymbol()); + LLVM_DEBUG(dbgs() << "Inserted DW_AT_start_scope in variable : " + << Var->getName() << "\n";); + } + } else if ((Label = dyn_cast(Entity))) applyLabelAttributes(*Label, *Die); else llvm_unreachable("DbgEntity must be DbgVariable or DbgLabel."); diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -114,6 +114,10 @@ /// /// Variables that have been optimized out use none of these fields. class DbgVariable : public DbgEntity { + /// Symbol associated with the variable or a label. + const MCSymbol *Sym; + /// Symbol assoicated with the enclosing scope of the scoped variable. + const MCSymbol *ScopeBeginSym; /// Offset in DebugLocs. unsigned DebugLocListIndex = ~0u; /// DW_OP_LLVM_tag_offset value from DebugLocs. @@ -134,8 +138,11 @@ /// /// Creates a variable without any DW_AT_location. Call \a initializeMMI() /// for MMI entries, or \a initializeDbgValue() for DBG_VALUE instructions. - DbgVariable(const DILocalVariable *V, const DILocation *IA) - : DbgEntity(V, IA, DbgVariableKind) {} + DbgVariable(const DILocalVariable *V, const DILocation *IA, + const MCSymbol *Sym = nullptr, + const MCSymbol *ScopeBeginSym = nullptr) + : DbgEntity(V, IA, DbgVariableKind), Sym(Sym), + ScopeBeginSym(ScopeBeginSym) {} /// Initialize from the MMI table. void initializeMMI(const DIExpression *E, int FI) { @@ -183,6 +190,8 @@ ArrayRef getFrameIndexExprs() const; bool hasFrameIndexExprs() const { return !FrameIndexExprs.empty(); } void addMMIEntry(const DbgVariable &V); + const MCSymbol *getVarSymbol() const { return Sym; } + const MCSymbol *getScopeBeginSymbol() const { return ScopeBeginSym; } // Translate tag to proper Dwarf tag. dwarf::Tag getTag() const { @@ -436,11 +445,11 @@ const DINode *Node, const MDNode *Scope); - DbgEntity *createConcreteEntity(DwarfCompileUnit &TheCU, - LexicalScope &Scope, + DbgEntity *createConcreteEntity(DwarfCompileUnit &TheCU, LexicalScope &Scope, const DINode *Node, const DILocation *Location, - const MCSymbol *Sym = nullptr); + const MCSymbol *Sym = nullptr, + const MCSymbol *ScopeBeginSym = nullptr); /// Construct a DIE for this abstract scope. void constructAbstractSubprogramScopeDIE(DwarfCompileUnit &SrcCU, LexicalScope *Scope); diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1748,12 +1748,12 @@ LexicalScope &Scope, const DINode *Node, const DILocation *Location, - const MCSymbol *Sym) { + const MCSymbol *Sym, + const MCSymbol *ScopeBeginSym) { ensureAbstractEntityIsCreatedIfScoped(TheCU, Node, Scope.getScopeNode()); if (isa(Node)) { - ConcreteEntities.push_back( - std::make_unique(cast(Node), - Location)); + ConcreteEntities.push_back(std::make_unique( + cast(Node), Location, Sym, ScopeBeginSym)); InfoHolder.addScopeVariable(&Scope, cast(ConcreteEntities.back().get())); } else if (isa(Node)) { @@ -1801,12 +1801,28 @@ continue; Processed.insert(IV); - DbgVariable *RegVar = cast(createConcreteEntity(TheCU, - *Scope, LocalVar, IV.second)); const MachineInstr *MInsn = HistoryMapEntries.front().getInstr(); assert(MInsn->isDebugValue() && "History must begin with debug value"); + DbgVariable *RegVar = nullptr; + // For scoped variables, codegen has emitted DBG_VALUE instructions. + // let's use DBG_VALUE and associated info to create/intialize `Sym` + // and `ScopeBeginSym` symbols, these symbols will be utilized later + // while synthesizing `DW_AT_start_scope` for this scoped variable. + if (dyn_cast_or_null(LocalVar->getScope())) { + MCSymbol *ScopeBeginSym = nullptr; + for (const InsnRange &R : Scope->getRanges()) + ScopeBeginSym = getLabelBeforeInsn(R.first); + // FIXME: This causes loclist emission even at `-O0` is there way + // we can avoid this ? + RegVar = cast( + createConcreteEntity(TheCU, *Scope, LocalVar, IV.second, + getLabelBeforeInsn(MInsn), ScopeBeginSym)); + } else + RegVar = cast( + createConcreteEntity(TheCU, *Scope, LocalVar, IV.second)); + // Check if there is a single DBG_VALUE, valid throughout the var's scope. // If the history map contains a single debug value, there may be an // additional entry which clobbers the debug value. diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -1385,6 +1385,30 @@ << " (bad/undef address)\n"); return true; } + // Create FI based DBG_VALUE instruction for scoped variable. + if (dyn_cast_or_null(DI->getVariable()->getScope())) { + const Value *Address = DI->getVariableLocation(); + int FI = std::numeric_limits::max(); + if (const auto *AI = + dyn_cast(Address->stripInBoundsConstantOffsets())) { + if (AI->isStaticAlloca()) { + auto I = FuncInfo.StaticAllocaMap.find(AI); + if (I != FuncInfo.StaticAllocaMap.end()) + FI = I->second; + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, + TII.get(TargetOpcode::DBG_VALUE)) + .addFrameIndex(FI) + .addImm(0U) + .addMetadata(DI->getVariable()) + .addMetadata(DI->getExpression()); + LLVM_DEBUG(dbgs() + << "FastIsel: Created DBG_VALUE for scoped variable: " + << DI->getVariable()->getName() + << " with FrameIndex: " << FI << "\n";); + return true; + } + } + } // Byval arguments with frame indices were already handled after argument // lowering and before isel. diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -5902,10 +5902,21 @@ SDDbgValue *SDV = DAG.getFrameIndexDbgValue( Variable, Expression, FI, /*IsIndirect*/ true, dl, SDNodeOrder); DAG.AddDbgValue(SDV, getRoot().getNode(), isParameter); - } else { + } + // Create SDDbgValue node for scoped variable, this will be translated + // later as DBG_VALUE instructions by codegen pipeline. + else if (dyn_cast_or_null( + DI.getVariable()->getScope())) { + SDDbgValue *SDV = DAG.getFrameIndexDbgValue( + Variable, Expression, FI, /*IsIndirect*/ true, dl, SDNodeOrder); + DAG.AddDbgValue(SDV, getRoot().getNode(), isParameter); + LLVM_DEBUG( + dbgs() + << "SelectionDAG: Created SDDbgValue node for scoped variable: " + << DI.getVariable()->getName() << "\n";); + } else LLVM_DEBUG(dbgs() << "Skipping " << DI << " (variable info stashed in MF side table)\n"); - } return; } diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -1310,6 +1310,22 @@ // intrinsic and handle this during isel like dbg.value. int FI = std::numeric_limits::max(); if (const auto *AI = dyn_cast(Address)) { + + // Skip processing of scoped variables, these will be handled later + // in pipeline. + // Specifically we want to create DBG_VALUE instruction for each + // scoped variable, this will enable later pipeline stages in + // synthesizing `DW_AT_start_scope` for this variable. + if (dyn_cast_or_null( + DI->getVariable()->getScope())) { + const Value *Address = DI->getVariableLocation(); + if (!(!Address || isa(Address) || + (Address->use_empty() && !isa(Address)))) { + LLVM_DEBUG(dbgs() << "processDbgDeclares skipping " << *DI + << " (scoped variable)\n"); + continue; + } + } auto SI = FuncInfo.StaticAllocaMap.find(AI); if (SI != FuncInfo.StaticAllocaMap.end()) FI = SI->second; diff --git a/llvm/test/DebugInfo/X86/DW_AT_start_scope.ll b/llvm/test/DebugInfo/X86/DW_AT_start_scope.ll new file mode 100644 --- /dev/null +++ b/llvm/test/DebugInfo/X86/DW_AT_start_scope.ll @@ -0,0 +1,107 @@ +;; This test checks for emission DW_AT_start_scope for a +;; scoped variable. + +; RUN: %llc_dwarf %s -filetype=obj -o - | llvm-dwarfdump - | FileCheck %s + +; CHECK; DW_AT_name ("Local") +; CHECK: DW_AT_decl_line (7) +; CHECK: DW_AT_start_scope (0x{{.*}}) + +; c source code for this IR +; int main(int Argc, char **Argv) { +; int Local = 6; +; printf("%d\n",Local); +; +; { +; printf("%d\n",Local); +; int Local = 7; +; printf("%d\n",Local); +; Local = 8; +; printf("%d\n",Local); +; } +; +; return 0; +; } + +; ModuleID = 'MainScope.c' +source_filename = "MainScope.c" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 + +; Function Attrs: noinline nounwind optnone uwtable +define dso_local i32 @main(i32 %Argc, i8** %Argv) #0 !dbg !7 { +entry: + %retval = alloca i32, align 4 + %Argc.addr = alloca i32, align 4 + %Argv.addr = alloca i8**, align 8 + %Local = alloca i32, align 4 + %Local2 = alloca i32, align 4 + store i32 0, i32* %retval, align 4 + store i32 %Argc, i32* %Argc.addr, align 4 + call void @llvm.dbg.declare(metadata i32* %Argc.addr, metadata !14, metadata !DIExpression()), !dbg !15 + store i8** %Argv, i8*** %Argv.addr, align 8 + call void @llvm.dbg.declare(metadata i8*** %Argv.addr, metadata !16, metadata !DIExpression()), !dbg !17 + call void @llvm.dbg.declare(metadata i32* %Local, metadata !18, metadata !DIExpression()), !dbg !19 + store i32 6, i32* %Local, align 4, !dbg !19 + %0 = load i32, i32* %Local, align 4, !dbg !20 + %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0), !dbg !21 + %1 = load i32, i32* %Local, align 4, !dbg !22 + %call1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1), !dbg !24 + call void @llvm.dbg.declare(metadata i32* %Local2, metadata !25, metadata !DIExpression()), !dbg !26 + store i32 7, i32* %Local2, align 4, !dbg !26 + %2 = load i32, i32* %Local2, align 4, !dbg !27 + %call3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2), !dbg !28 + store i32 8, i32* %Local2, align 4, !dbg !29 + %3 = load i32, i32* %Local2, align 4, !dbg !30 + %call4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3), !dbg !31 + ret i32 0, !dbg !32 +} + +; Function Attrs: nounwind readnone speculatable willreturn +declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 + +declare dso_local i32 @printf(i8*, ...) #2 + +attributes #0 = { noinline nounwind optnone uwtable } +attributes #1 = { nounwind readnone speculatable willreturn } +attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "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 = !{!0} +!llvm.module.flags = !{!3, !4, !5} +!llvm.ident = !{!6} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 11.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None) +!1 = !DIFile(filename: "test.c", directory: "/") +!2 = !{} +!3 = !{i32 7, !"Dwarf Version", i32 4} +!4 = !{i32 2, !"Debug Info Version", i32 3} +!5 = !{i32 1, !"wchar_size", i32 4} +!6 = !{!"clang version 11.0.0"} +!7 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !8, scopeLine: 1, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2) +!8 = !DISubroutineType(types: !9) +!9 = !{!10, !10, !11} +!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64) +!12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 64) +!13 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char) +!14 = !DILocalVariable(name: "Argc", arg: 1, scope: !7, file: !1, line: 1, type: !10) +!15 = !DILocation(line: 1, column: 14, scope: !7) +!16 = !DILocalVariable(name: "Argv", arg: 2, scope: !7, file: !1, line: 1, type: !11) +!17 = !DILocation(line: 1, column: 27, scope: !7) +!18 = !DILocalVariable(name: "Local", scope: !7, file: !1, line: 2, type: !10) +!19 = !DILocation(line: 2, column: 6, scope: !7) +!20 = !DILocation(line: 3, column: 16, scope: !7) +!21 = !DILocation(line: 3, column: 2, scope: !7) +!22 = !DILocation(line: 6, column: 16, scope: !23) +!23 = distinct !DILexicalBlock(scope: !7, file: !1, line: 5, column: 2) +!24 = !DILocation(line: 6, column: 2, scope: !23) +!25 = !DILocalVariable(name: "Local", scope: !23, file: !1, line: 7, type: !10) +!26 = !DILocation(line: 7, column: 6, scope: !23) +!27 = !DILocation(line: 8, column: 16, scope: !23) +!28 = !DILocation(line: 8, column: 2, scope: !23) +!29 = !DILocation(line: 9, column: 8, scope: !23) +!30 = !DILocation(line: 10, column: 16, scope: !23) +!31 = !DILocation(line: 10, column: 2, scope: !23) +!32 = !DILocation(line: 13, column: 2, scope: !7) diff --git a/llvm/test/DebugInfo/X86/op_deref.ll b/llvm/test/DebugInfo/X86/op_deref.ll --- a/llvm/test/DebugInfo/X86/op_deref.ll +++ b/llvm/test/DebugInfo/X86/op_deref.ll @@ -12,7 +12,7 @@ ; DWARF3-NEXT: {{.*}}: DW_OP_breg2 RCX+0, DW_OP_deref ; CHECK-NOT: DW_TAG -; CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000067] = "vla") +; CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000065] = "vla") ; Check the DEBUG_VALUE comments for good measure. ; RUN: llc -O0 -mtriple=x86_64-apple-darwin %s -o - -filetype=asm | FileCheck %s -check-prefix=ASM-CHECK diff --git a/llvm/test/DebugInfo/dwarfdump-dataLocationExp.ll b/llvm/test/DebugInfo/dwarfdump-dataLocationExp.ll --- a/llvm/test/DebugInfo/dwarfdump-dataLocationExp.ll +++ b/llvm/test/DebugInfo/dwarfdump-dataLocationExp.ll @@ -8,7 +8,7 @@ ;; Test whether DW_AT_data_location is generated. ; CHECK-LABEL: DW_TAG_array_type -; CHECK: DW_AT_data_location (DW_OP_constu 0x1a85) +; CHECK: DW_AT_data_location (DW_OP_constu 0x1a81 ; CHECK: DW_TAG_subrange_type ;; Test case is hand written with the help of below testcase @@ -16,7 +16,7 @@ ;;program main ;;integer, allocatable :: arr(:) ;;allocate(arr(2:20)) -;;arr(2)=99 +;;arr(2)=55 ;;print *, arr ;;end program main ;;------------------------------ @@ -29,8 +29,8 @@ define void @MAIN_() !dbg !5 { L.entry: %.Z0640_333 = alloca i32*, align 8 - %"arr$sd1_349" = alloca [16 x i64], align 8 - call void @llvm.dbg.declare(metadata [16 x i64]* %"arr$sd1_349", metadata !8, metadata !DIExpression()), !dbg !14 + %"arr$sd1_345" = alloca [16 x i64], align 8 + call void @llvm.dbg.declare(metadata [16 x i64]* %"arr$sd1_345", metadata !8, metadata !DIExpression()), !dbg !14 call void @llvm.dbg.declare(metadata i32** %.Z0640_333, metadata !15, metadata !DIExpression()), !dbg !14 ret void, !dbg !17 } @@ -46,22 +46,21 @@ !0 = !{i32 2, !"Dwarf Version", i32 4} !1 = !{i32 2, !"Debug Info Version", i32 3} -!2 = distinct !DICompileUnit(language: DW_LANG_Fortran90, file: !3, producer: " F90 Flang - 1.5 2017-05-01", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !4, imports: !4) -!3 = !DIFile(filename: "fortsubrange.f90", directory: "/dir") +!2 = distinct !DICompileUnit(language: DW_LANG_Fortran90, file: !3, producer: " F50 Flang - 1.5 2017-05-01", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !4, imports: !4) +!3 = !DIFile(filename: "fortsubrange.f50", directory: "/dir") !4 = !{} !5 = distinct !DISubprogram(name: "main", scope: !2, file: !3, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagMainSubprogram, unit: !2) !6 = !DISubroutineType(cc: DW_CC_program, types: !7) !7 = !{null} -!8 = !DILocalVariable(name: "arr", scope: !9, file: !3, type: !10) -!9 = !DILexicalBlock(scope: !5, file: !3, line: 1, column: 1) +!8 = !DILocalVariable(name: "arr", scope: !5, file: !3, type: !10) ;; We intend to use DW_OP_push_object_address, since that is not available yet, ;; we are using meaning less expression ;;!10 = !DICompositeType(tag: DW_TAG_array_type, baseType: !11, size: 32, align: 32, elements: !12, dataLocation: !DIExpression(DW_OP_push_object_address, DW_OP_deref)) -!10 = !DICompositeType(tag: DW_TAG_array_type, baseType: !11, size: 32, align: 32, elements: !12, dataLocation: !DIExpression(DW_OP_constu, 6789)) +!10 = !DICompositeType(tag: DW_TAG_array_type, baseType: !11, size: 32, align: 32, elements: !12, dataLocation: !DIExpression(DW_OP_constu, 6785)) !11 = !DIBasicType(name: "integer", size: 32, align: 32, encoding: DW_ATE_signed) !12 = !{!13} -!13 = !DISubrange(count: 19, lowerBound: 2) -!14 = !DILocation(line: 0, scope: !9) -!15 = distinct !DILocalVariable(scope: !9, file: !3, type: !16, flags: DIFlagArtificial) +!13 = !DISubrange(count: 15, lowerBound: 2) +!14 = !DILocation(line: 0, scope: !5) +!15 = distinct !DILocalVariable(scope: !5, file: !3, type: !16, flags: DIFlagArtificial) !16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 32, align: 32) -!17 = !DILocation(line: 6, column: 1, scope: !9) +!17 = !DILocation(line: 6, column: 1, scope: !5) diff --git a/llvm/test/DebugInfo/dwarfdump-dataLocationVar.ll b/llvm/test/DebugInfo/dwarfdump-dataLocationVar.ll --- a/llvm/test/DebugInfo/dwarfdump-dataLocationVar.ll +++ b/llvm/test/DebugInfo/dwarfdump-dataLocationVar.ll @@ -18,7 +18,7 @@ ;;program main ;;integer, allocatable :: arr(:) ;;allocate(arr(2:20)) -;;arr(2)=99 +;;arr(2)=55 ;;print *, arr ;;end program main ;;------------------------------ @@ -31,8 +31,8 @@ define void @MAIN_() !dbg !5 { L.entry: %.Z0640_333 = alloca i32*, align 8 - %"arr$sd1_349" = alloca [16 x i64], align 8 - call void @llvm.dbg.declare(metadata [16 x i64]* %"arr$sd1_349", metadata !8, metadata !DIExpression()), !dbg !16 + %"arr$sd1_345" = alloca [16 x i64], align 8 + call void @llvm.dbg.declare(metadata [16 x i64]* %"arr$sd1_345", metadata !8, metadata !DIExpression()), !dbg !16 call void @llvm.dbg.declare(metadata i32** %.Z0640_333, metadata !14, metadata !DIExpression()), !dbg !16 ret void, !dbg !17 } @@ -48,19 +48,18 @@ !0 = !{i32 2, !"Dwarf Version", i32 4} !1 = !{i32 2, !"Debug Info Version", i32 3} -!2 = distinct !DICompileUnit(language: DW_LANG_Fortran90, file: !3, producer: " F90 Flang - 1.5 2017-05-01", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !4, imports: !4) -!3 = !DIFile(filename: "fortsubrange.f90", directory: "/dir") +!2 = distinct !DICompileUnit(language: DW_LANG_Fortran90, file: !3, producer: " F50 Flang - 1.5 2017-05-01", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !4, imports: !4) +!3 = !DIFile(filename: "fortsubrange.f50", directory: "/dir") !4 = !{} !5 = distinct !DISubprogram(name: "main", scope: !2, file: !3, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagMainSubprogram, unit: !2) !6 = !DISubroutineType(cc: DW_CC_program, types: !7) !7 = !{null} -!8 = !DILocalVariable(name: "arr", scope: !9, file: !3, type: !10) -!9 = !DILexicalBlock(scope: !5, file: !3, line: 1, column: 1) +!8 = !DILocalVariable(name: "arr", scope: !5, file: !3, type: !10) !10 = !DICompositeType(tag: DW_TAG_array_type, baseType: !11, size: 32, align: 32, elements: !12, dataLocation: !14) !11 = !DIBasicType(name: "integer", size: 32, align: 32, encoding: DW_ATE_signed) !12 = !{!13} -!13 = !DISubrange(count: 19, lowerBound: 2) -!14 = distinct !DILocalVariable(scope: !9, file: !3, type: !15, flags: DIFlagArtificial) +!13 = !DISubrange(count: 15, lowerBound: 2) +!14 = distinct !DILocalVariable(scope: !5, file: !3, type: !15, flags: DIFlagArtificial) !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 32, align: 32) -!16 = !DILocation(line: 0, scope: !9) -!17 = !DILocation(line: 6, column: 1, scope: !9) +!16 = !DILocation(line: 0, scope: !5) +!17 = !DILocation(line: 6, column: 1, scope: !5)