Index: docs/LangRef.rst =================================================================== --- docs/LangRef.rst +++ docs/LangRef.rst @@ -4405,6 +4405,7 @@ - ``DW_OP_deref`` dereferences the top of the expression stack. - ``DW_OP_plus, 93`` adds ``93`` to the working expression. +- ``DW_OP_plus_uconst, 93`` adds ``93`` to the working expression. - ``DW_OP_LLVM_fragment, 16, 8`` specifies the offset and size (``16`` and ``8`` here, respectively) of the variable fragment from the working expression. Note that contrary to DW_OP_bit_piece, the offset is describing the the location @@ -4426,7 +4427,7 @@ .. code-block:: llvm !0 = !DIExpression(DW_OP_deref) - !1 = !DIExpression(DW_OP_plus, 3) + !1 = !DIExpression(DW_OP_plus_uconst, 3) !2 = !DIExpression(DW_OP_bit_piece, 3, 7) !3 = !DIExpression(DW_OP_deref, DW_OP_plus, 3, DW_OP_LLVM_fragment, 3, 7) !4 = !DIExpression(DW_OP_constu, 2, DW_OP_swap, DW_OP_xderef) Index: lib/Bitcode/Reader/MetadataLoader.cpp =================================================================== --- lib/Bitcode/Reader/MetadataLoader.cpp +++ lib/Bitcode/Reader/MetadataLoader.cpp @@ -533,6 +533,43 @@ } } + void upgradeMetadataExpression(uint64_t FromVersion, + MutableArrayRef Expr, + SmallVectorImpl &NewExpr) { + // Move DW_OP_plus to DW_OP_plus_uconst + auto SubExpr = MutableArrayRef(Expr); + while (!SubExpr.empty()) { + // Skip past other operators with their operands + // for this version of the IR, obtained from + // from historic DIExpression::ExprOperand::getSize() + unsigned HistoricSize = 1; + switch (SubExpr.front()) { + default: + break; + case dwarf::DW_OP_LLVM_fragment: + HistoricSize = 3; + break; + case dwarf::DW_OP_constu: + case dwarf::DW_OP_minus: + case dwarf::DW_OP_plus: + HistoricSize = 2; + break; + } + + switch(SubExpr.front()) { + case dwarf::DW_OP_plus: + NewExpr.append({dwarf::DW_OP_plus_uconst, SubExpr[1]}); + break; + default: + NewExpr.append(SubExpr.begin(), SubExpr.begin() + HistoricSize); + break; + } + + // Continue with remaining elements + SubExpr = SubExpr.slice(HistoricSize); + } + } + void upgradeDebugInfo() { upgradeCUSubprograms(); upgradeCUVariables(); @@ -1550,8 +1587,10 @@ IsDistinct = Record[0] & 1; uint64_t Version = Record[0] >> 1; + SmallVector UpgradedExpr; auto Elts = MutableArrayRef(Record).slice(1); unsigned N = Elts.size(); + // Perform various upgrades. switch (Version) { case 0: @@ -1570,6 +1609,10 @@ NeedDeclareExpressionUpgrade = true; LLVM_FALLTHROUGH; case 2: + upgradeMetadataExpression(Version, Elts, UpgradedExpr); + Elts = MutableArrayRef(UpgradedExpr); + LLVM_FALLTHROUGH; + case 3: // Up-to-date! break; default: @@ -1577,7 +1620,7 @@ } MetadataList.assignValue( - GET_OR_DISTINCT(DIExpression, (Context, makeArrayRef(Record).slice(1))), + GET_OR_DISTINCT(DIExpression, (Context, Elts)), NextMetadataNo); NextMetadataNo++; break; Index: lib/Bitcode/Writer/BitcodeWriter.cpp =================================================================== --- lib/Bitcode/Writer/BitcodeWriter.cpp +++ lib/Bitcode/Writer/BitcodeWriter.cpp @@ -1657,7 +1657,7 @@ SmallVectorImpl &Record, unsigned Abbrev) { Record.reserve(N->getElements().size() + 1); - const uint64_t Version = 2 << 1; + const uint64_t Version = 3 << 1; Record.push_back((uint64_t)N->isDistinct() | Version); Record.append(N->elements_begin(), N->elements_end()); Index: lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp =================================================================== --- lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -552,7 +552,7 @@ int Offset = TFI->getFrameIndexReference(*Asm->MF, Fragment.FI, FrameReg); DwarfExpr.addFragmentOffset(Expr); SmallVector Ops; - Ops.push_back(dwarf::DW_OP_plus); + Ops.push_back(dwarf::DW_OP_plus_uconst); Ops.push_back(Offset); Ops.append(Expr->elements_begin(), Expr->elements_end()); DIExpressionCursor Cursor(Ops); @@ -821,7 +821,7 @@ SmallVector Ops; if (Location.isIndirect() && Location.getOffset()) { - Ops.push_back(dwarf::DW_OP_plus); + Ops.push_back(dwarf::DW_OP_plus_uconst); Ops.push_back(Location.getOffset()); } DIExpressionCursor Cursor(Ops); @@ -850,7 +850,7 @@ SmallVector Ops; if (Location.isIndirect() && Location.getOffset()) { - Ops.push_back(dwarf::DW_OP_plus); + Ops.push_back(dwarf::DW_OP_plus_uconst); Ops.push_back(Location.getOffset()); } Ops.append(DIExpr->elements_begin(), DIExpr->elements_end()); Index: lib/CodeGen/AsmPrinter/DwarfDebug.cpp =================================================================== --- lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1511,7 +1511,7 @@ DwarfExpr.setMemoryLocationKind(); SmallVector Ops; if (Location.isIndirect() && Location.getOffset()) { - Ops.push_back(dwarf::DW_OP_plus); + Ops.push_back(dwarf::DW_OP_plus_uconst); Ops.push_back(Location.getOffset()); } Ops.append(DIExpr->elements_begin(), DIExpr->elements_end()); Index: lib/CodeGen/AsmPrinter/DwarfExpression.cpp =================================================================== --- lib/CodeGen/AsmPrinter/DwarfExpression.cpp +++ lib/CodeGen/AsmPrinter/DwarfExpression.cpp @@ -248,13 +248,15 @@ assert(Reg.Size == 0 && "subregister has same size as superregister"); // Pattern-match combinations for which more efficient representations exist. - // [Reg, Offset, DW_OP_plus] --> [DW_OP_breg, Offset]. - // [Reg, Offset, DW_OP_minus] --> [DW_OP_breg, -Offset]. + // [Reg, DW_OP_minus, Offset] --> [DW_OP_breg, -Offset]. + // [Reg, DW_OP_plus, Offset] --> [DW_OP_breg, Offset]. + // [Reg, DW_OP_plus_uconst, Offset] --> [DW_OP_breg, Offset]. // If Reg is a subregister we need to mask it out before subtracting. - if (Op && ((Op->getOp() == dwarf::DW_OP_plus) || + if (Op && ((Op->getOp() == dwarf::DW_OP_plus || + Op->getOp() == dwarf::DW_OP_plus_uconst) || (Op->getOp() == dwarf::DW_OP_minus && !SubRegisterSizeInBits))) { int Offset = Op->getArg(0); - SignedOffset = (Op->getOp() == dwarf::DW_OP_plus) ? Offset : -Offset; + SignedOffset = (Op->getOp() == dwarf::DW_OP_minus) ? -Offset : Offset; ExprCursor.take(); } if (FBReg) @@ -321,6 +323,7 @@ return; } case dwarf::DW_OP_plus: + case dwarf::DW_OP_plus_uconst: assert(LocationKind != Register); emitOp(dwarf::DW_OP_plus_uconst); emitUnsigned(Op->getArg(0)); Index: lib/CodeGen/AsmPrinter/DwarfUnit.cpp =================================================================== --- lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -475,7 +475,7 @@ SmallVector Ops; if (Location.isIndirect() && Location.getOffset()) { - Ops.push_back(dwarf::DW_OP_plus); + Ops.push_back(dwarf::DW_OP_plus_uconst); Ops.push_back(Location.getOffset()); } // If we started with a pointer to the __Block_byref... struct, then @@ -487,7 +487,7 @@ // DW_OP_plus_uconst ForwardingFieldOffset. Note there's no point in // adding the offset if it's 0. if (forwardingFieldOffset > 0) { - Ops.push_back(dwarf::DW_OP_plus); + Ops.push_back(dwarf::DW_OP_plus_uconst); Ops.push_back(forwardingFieldOffset); } @@ -499,7 +499,7 @@ // for the variable's field to get to the location of the actual variable: // DW_OP_plus_uconst varFieldOffset. Again, don't add if it's 0. if (varFieldOffset > 0) { - Ops.push_back(dwarf::DW_OP_plus); + Ops.push_back(dwarf::DW_OP_plus_uconst); Ops.push_back(varFieldOffset); } Index: lib/IR/DebugInfoMetadata.cpp =================================================================== --- lib/IR/DebugInfoMetadata.cpp +++ lib/IR/DebugInfoMetadata.cpp @@ -600,6 +600,7 @@ case dwarf::DW_OP_constu: case dwarf::DW_OP_plus: case dwarf::DW_OP_minus: + case dwarf::DW_OP_plus_uconst: return 2; default: return 1; @@ -641,6 +642,7 @@ break; } case dwarf::DW_OP_constu: + case dwarf::DW_OP_plus_uconst: case dwarf::DW_OP_plus: case dwarf::DW_OP_minus: case dwarf::DW_OP_deref: @@ -664,7 +666,7 @@ void DIExpression::appendOffset(SmallVectorImpl &Ops, int64_t Offset) { if (Offset > 0) { - Ops.push_back(dwarf::DW_OP_plus); + Ops.push_back(dwarf::DW_OP_plus_uconst); Ops.push_back(Offset); } else if (Offset < 0) { Ops.push_back(dwarf::DW_OP_minus); @@ -679,7 +681,8 @@ } if (getNumElements() != 2) return false; - if (Elements[0] == dwarf::DW_OP_plus) { + if (Elements[0] == dwarf::DW_OP_plus || + Elements[0] == dwarf::DW_OP_plus_uconst) { Offset = Elements[1]; return true; } Index: lib/IR/Metadata.cpp =================================================================== --- lib/IR/Metadata.cpp +++ lib/IR/Metadata.cpp @@ -1470,7 +1470,7 @@ if (E) OrigElements = E->getElements(); std::vector Elements(OrigElements.size() + 2); - Elements[0] = dwarf::DW_OP_plus; + Elements[0] = dwarf::DW_OP_plus_uconst; Elements[1] = Offset; std::copy(OrigElements.begin(), OrigElements.end(), Elements.begin() + 2); E = DIExpression::get(getContext(), Elements); Index: test/Assembler/diexpression.ll =================================================================== --- test/Assembler/diexpression.ll +++ test/Assembler/diexpression.ll @@ -6,13 +6,13 @@ ; CHECK: !0 = !DIExpression() ; CHECK-NEXT: !1 = !DIExpression(DW_OP_deref) -; CHECK-NEXT: !2 = !DIExpression(DW_OP_plus, 3) +; CHECK-NEXT: !2 = !DIExpression(DW_OP_plus_uconst, 3) ; CHECK-NEXT: !3 = !DIExpression(DW_OP_LLVM_fragment, 3, 7) -; CHECK-NEXT: !4 = !DIExpression(DW_OP_deref, DW_OP_plus, 3, DW_OP_LLVM_fragment, 3, 7) +; CHECK-NEXT: !4 = !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 3, DW_OP_LLVM_fragment, 3, 7) ; CHECK-NEXT: !5 = !DIExpression(DW_OP_constu, 2, DW_OP_swap, DW_OP_xderef) !0 = !DIExpression() !1 = !DIExpression(DW_OP_deref) -!2 = !DIExpression(DW_OP_plus, 3) +!2 = !DIExpression(DW_OP_plus_uconst, 3) !3 = !DIExpression(DW_OP_LLVM_fragment, 3, 7) -!4 = !DIExpression(DW_OP_deref, DW_OP_plus, 3, DW_OP_LLVM_fragment, 3, 7) +!4 = !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 3, DW_OP_LLVM_fragment, 3, 7) !5 = !DIExpression(DW_OP_constu, 2, DW_OP_swap, DW_OP_xderef) Index: test/Bitcode/DIExpression-deref.ll =================================================================== --- test/Bitcode/DIExpression-deref.ll +++ test/Bitcode/DIExpression-deref.ll @@ -11,12 +11,12 @@ !5 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) ; DW_OP_deref should be moved to the back of the expression. ; -; CHECK: !DIExpression(DW_OP_plus, 0, DW_OP_deref, DW_OP_LLVM_fragment, 8, 32) -!6 = !DIExpression(DW_OP_deref, DW_OP_plus, 0, DW_OP_LLVM_fragment, 8, 32) -; CHECK: !DIExpression(DW_OP_plus, 0, DW_OP_deref) -!7 = !DIExpression(DW_OP_deref, DW_OP_plus, 0) -; CHECK: !DIExpression(DW_OP_plus, 1, DW_OP_deref) -!8 = !DIExpression(DW_OP_plus, 1, DW_OP_deref) +; CHECK: !DIExpression(DW_OP_plus_uconst, 0, DW_OP_deref, DW_OP_LLVM_fragment, 8, 32) +!6 = !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 0, DW_OP_LLVM_fragment, 8, 32) +; CHECK: !DIExpression(DW_OP_plus_uconst, 0, DW_OP_deref) +!7 = !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 0) +; CHECK: !DIExpression(DW_OP_plus_uconst, 1, DW_OP_deref) +!8 = !DIExpression(DW_OP_plus_uconst, 1, DW_OP_deref) ; CHECK: !DIExpression(DW_OP_deref) !9 = !DIExpression(DW_OP_deref) !10 = !DIGlobalVariableExpression(var: !0, expr: !6) Index: test/Bitcode/DIGlobalVariableExpression.ll =================================================================== --- test/Bitcode/DIGlobalVariableExpression.ll +++ test/Bitcode/DIGlobalVariableExpression.ll @@ -14,7 +14,7 @@ ; CHECK: ![[HVAR:[0-9]+]] = distinct !DIGlobalVariable(name: "h", ; CHECK: ![[IMPORTS]] = !{![[CIMPORT:[0-9]+]]} ; CHECK: ![[CIMPORT]] = !DIImportedEntity({{.*}}entity: ![[HVAR]] -; CHECK: ![[GEXPR]] = !DIExpression(DW_OP_plus, 1) +; CHECK: ![[GEXPR]] = !DIExpression(DW_OP_plus_uconst, 1) ; CHECK: ![[H]] = {{.*}}!DIGlobalVariableExpression(var: ![[HVAR]]) @g = common global i32 0, align 4, !dbg !0 @@ -24,7 +24,7 @@ !llvm.module.flags = !{!6, !7, !8} !llvm.ident = !{!9} -!0 = distinct !DIGlobalVariable(name: "g", scope: !1, file: !2, line: 1, type: !5, isLocal: false, isDefinition: true, expr: !DIExpression(DW_OP_plus, 1)) +!0 = distinct !DIGlobalVariable(name: "g", scope: !1, file: !2, line: 1, type: !5, isLocal: false, isDefinition: true, expr: !DIExpression(DW_OP_plus_uconst, 1)) !1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 4.0.0 (trunk 286129) (llvm/trunk 286128)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !4, imports: !3) !2 = !DIFile(filename: "a.c", directory: "/") !3 = !{!12} Index: test/CodeGen/ARM/debug-info-blocks.ll =================================================================== --- test/CodeGen/ARM/debug-info-blocks.ll +++ test/CodeGen/ARM/debug-info-blocks.ll @@ -273,6 +273,6 @@ !160 = !DIFile(filename: "header.h", directory: "/Volumes/Sandbox/llvm") !161 = !{!"header2.h", !"/Volumes/Sandbox/llvm"} !162 = !{i32 1, !"Debug Info Version", i32 3} -!163 = !DIExpression(DW_OP_plus, 20, DW_OP_deref, DW_OP_plus, 4, DW_OP_deref, DW_OP_plus, 24) -!164 = !DIExpression(DW_OP_deref, DW_OP_plus, 24) -!165 = !DIExpression(DW_OP_deref, DW_OP_plus, 28) +!163 = !DIExpression(DW_OP_plus_uconst, 20, DW_OP_deref, DW_OP_plus_uconst, 4, DW_OP_deref, DW_OP_plus_uconst, 24) +!164 = !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 24) +!165 = !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 28) Index: test/CodeGen/X86/lea-opt-with-debug.mir =================================================================== --- test/CodeGen/X86/lea-opt-with-debug.mir +++ test/CodeGen/X86/lea-opt-with-debug.mir @@ -49,7 +49,7 @@ !5 = !{i32 2, !"Dwarf Version", i32 4} !6 = !{i32 2, !"Debug Info Version", i32 3} !7 = !{i32 1, !"PIC Level", i32 2} - !8 = !DIExpression(DW_OP_plus, 8, DW_OP_stack_value) + !8 = !DIExpression(DW_OP_plus_uconst, 8, DW_OP_stack_value) !9 = distinct !DISubprogram(name: "fn1", scope: !1, file: !1, line: 7, type: !10, isLocal: false, isDefinition: true, scopeLine: 7, isOptimized: true, unit: !0, variables: !11) !10 = !DISubroutineType(types: !3) !11 = !{!12} Index: test/DebugInfo/Generic/block-asan.ll =================================================================== --- test/DebugInfo/Generic/block-asan.ll +++ test/DebugInfo/Generic/block-asan.ll @@ -13,7 +13,7 @@ ; Check that the location of the ASAN instrumented __block variable is ; correct. -; CHECK: !DIExpression(DW_OP_plus, 8, DW_OP_deref, DW_OP_plus, 24) +; CHECK: !DIExpression(DW_OP_plus_uconst, 8, DW_OP_deref, DW_OP_plus_uconst, 24) target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" @@ -79,7 +79,7 @@ !19 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !20 = !DIDerivedType(tag: DW_TAG_member, name: "__size", size: 32, align: 32, offset: 160, file: !1, scope: !5, baseType: !19) !21 = !DIDerivedType(tag: DW_TAG_member, name: "x", size: 32, align: 32, offset: 192, file: !1, scope: !5, baseType: !19) -!22 = !DIExpression(DW_OP_plus, 8, DW_OP_deref, DW_OP_plus, 24) +!22 = !DIExpression(DW_OP_plus_uconst, 8, DW_OP_deref, DW_OP_plus_uconst, 24) !23 = !DILocation(line: 4, column: 15, scope: !4) !24 = !DILocation(line: 4, column: 3, scope: !4) !25 = !DILocation(line: 5, column: 3, scope: !4) Index: test/DebugInfo/X86/block-capture.ll =================================================================== --- test/DebugInfo/X86/block-capture.ll +++ test/DebugInfo/X86/block-capture.ll @@ -123,7 +123,7 @@ !66 = !DILocation(line: 2, column: 20, scope: !8) !67 = !DILocation(line: 2, column: 21, scope: !8) !68 = !DILocalVariable(name: "block", line: 2, scope: !8, file: !5, type: !25) -!69 = !DIExpression(DW_OP_deref, DW_OP_plus, 32) +!69 = !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 32) !70 = !DILocation(line: 2, column: 9, scope: !8) !71 = !DILocation(line: 2, column: 23, scope: !72) !72 = distinct !DILexicalBlock(line: 2, column: 21, file: !1, scope: !8) Index: test/DebugInfo/X86/debug-info-block-captured-self.ll =================================================================== --- test/DebugInfo/X86/debug-info-block-captured-self.ll +++ test/DebugInfo/X86/debug-info-block-captured-self.ll @@ -107,5 +107,5 @@ !106 = !DILocation(line: 40, scope: !42) !107 = !DIFile(filename: "llvm/tools/clang/test/CodeGenObjC/debug-info-block-captured-self.m", directory: "") !108 = !{i32 1, !"Debug Info Version", i32 3} -!109 = !DIExpression(DW_OP_plus, 32, DW_OP_deref) -!110 = !DIExpression(DW_OP_plus, 32, DW_OP_deref) +!109 = !DIExpression(DW_OP_plus_uconst, 32, DW_OP_deref) +!110 = !DIExpression(DW_OP_plus_uconst, 32, DW_OP_deref) Index: test/DebugInfo/X86/debug-info-blocks.ll =================================================================== --- test/DebugInfo/X86/debug-info-blocks.ll +++ test/DebugInfo/X86/debug-info-blocks.ll @@ -380,4 +380,4 @@ !108 = !DILocation(line: 61, scope: !36) !109 = !DILocation(line: 62, scope: !36) !110 = !{i32 1, !"Debug Info Version", i32 3} -!111 = !DIExpression(DW_OP_deref, DW_OP_plus, 32) +!111 = !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 32) Index: test/DebugInfo/X86/stack-value-dwarf2.ll =================================================================== --- test/DebugInfo/X86/stack-value-dwarf2.ll +++ test/DebugInfo/X86/stack-value-dwarf2.ll @@ -93,4 +93,4 @@ !15 = !DISubprogram(name: "<(lambda at test.ii:87:58)>", scope: !0, file: !1, line: 27, type: !6, isLocal: false, isDefinition: false, scopeLine: 27, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: true, templateParams: !2) !16 = distinct !DILocation(line: 99, column: 21, scope: !17) !17 = !DILexicalBlockFile(scope: !5, file: !1, discriminator: 2) -!18 = !DIExpression(DW_OP_plus, 4, DW_OP_stack_value, DW_OP_LLVM_fragment, 64, 32) +!18 = !DIExpression(DW_OP_plus_uconst, 4, DW_OP_stack_value, DW_OP_LLVM_fragment, 64, 32) Index: test/DebugInfo/X86/unattached-global.ll =================================================================== --- test/DebugInfo/X86/unattached-global.ll +++ test/DebugInfo/X86/unattached-global.ll @@ -12,7 +12,7 @@ !1 = !{!2} !2 = !DIGlobalVariableExpression(var: !3, expr: !4) !3 = distinct !DIGlobalVariable(name: "a", scope: null, isLocal: false, isDefinition: true, type: !6) -!4 = !DIExpression(DW_OP_plus, 4) +!4 = !DIExpression(DW_OP_plus_uconst, 4) !5 = !DIFile(filename: "", directory: "/") !6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) Index: test/Transforms/GlobalMerge/debug-info.ll =================================================================== --- test/Transforms/GlobalMerge/debug-info.ll +++ test/Transforms/GlobalMerge/debug-info.ll @@ -17,7 +17,7 @@ ; CHECK: [[AVAR]] = !DIGlobalVariable(name: "a", scope: null, isLocal: false, isDefinition: true) ; CHECK: [[B]] = !DIGlobalVariableExpression(var: [[BVAR:![0-9]+]], expr: [[EXPR:![0-9]+]]) ; CHECK: [[BVAR]] = !DIGlobalVariable(name: "b", scope: null, isLocal: false, isDefinition: true) -; CHECK: [[EXPR]] = !DIExpression(DW_OP_plus, 4) +; CHECK: [[EXPR]] = !DIExpression(DW_OP_plus_uconst, 4) !llvm.module.flags = !{!4, !5} Index: test/Transforms/InstCombine/debuginfo-dce.ll =================================================================== --- test/Transforms/InstCombine/debuginfo-dce.ll +++ test/Transforms/InstCombine/debuginfo-dce.ll @@ -93,9 +93,9 @@ ret void, !dbg !32 } -; CHECK: ![[LOAD_EXPR]] = !DIExpression(DW_OP_deref, DW_OP_plus, 0) -; CHECK: ![[BITCAST_EXPR]] = !DIExpression(DW_OP_plus, 0) -; CHECK: ![[GEP0_EXPR]] = !DIExpression(DW_OP_minus, 8, DW_OP_plus, 0, DW_OP_stack_value) +; CHECK: ![[LOAD_EXPR]] = !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 0) +; CHECK: ![[BITCAST_EXPR]] = !DIExpression(DW_OP_plus_uconst, 0) +; CHECK: ![[GEP0_EXPR]] = !DIExpression(DW_OP_minus, 8, DW_OP_plus_uconst, 0, DW_OP_stack_value) ; CHECK: ![[GEP1_EXPR]] = !DIExpression(DW_OP_minus, 8, DW_OP_stack_value, ; CHECK-SAME: DW_OP_LLVM_fragment, 0, 32) ; CHECK: ![[GEP2_EXPR]] = !DIExpression(DW_OP_minus, 8, DW_OP_stack_value) @@ -130,7 +130,7 @@ !17 = !{!18} !18 = !DILocalVariable(name: "entry", scope: !14, file: !1, line: 6, type: !4) !19 = !DILocation(line: 6, column: 17, scope: !14) -!20 = !DIExpression(DW_OP_plus, 0) +!20 = !DIExpression(DW_OP_plus_uconst, 0) !21 = !DILocation(line: 11, column: 1, scope: !14) !22 = distinct !DISubprogram(name: "scan", scope: !1, file: !1, line: 4, type: !15, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !17) !23 = !DILocation(line: 6, column: 17, scope: !22) Index: unittests/IR/MetadataTest.cpp =================================================================== --- unittests/IR/MetadataTest.cpp +++ unittests/IR/MetadataTest.cpp @@ -2043,20 +2043,22 @@ // Valid constructions. EXPECT_VALID(dwarf::DW_OP_plus, 6); + EXPECT_VALID(dwarf::DW_OP_plus_uconst, 6); EXPECT_VALID(dwarf::DW_OP_deref); EXPECT_VALID(dwarf::DW_OP_LLVM_fragment, 3, 7); - EXPECT_VALID(dwarf::DW_OP_plus, 6, dwarf::DW_OP_deref); - EXPECT_VALID(dwarf::DW_OP_deref, dwarf::DW_OP_plus, 6); + EXPECT_VALID(dwarf::DW_OP_plus_uconst, 6, dwarf::DW_OP_deref); + EXPECT_VALID(dwarf::DW_OP_deref, dwarf::DW_OP_plus_uconst, 6); EXPECT_VALID(dwarf::DW_OP_deref, dwarf::DW_OP_LLVM_fragment, 3, 7); - EXPECT_VALID(dwarf::DW_OP_deref, dwarf::DW_OP_plus, 6, + EXPECT_VALID(dwarf::DW_OP_deref, dwarf::DW_OP_plus_uconst, 6, dwarf::DW_OP_LLVM_fragment, 3, 7); // Invalid constructions. EXPECT_INVALID(~0u); EXPECT_INVALID(dwarf::DW_OP_plus); + EXPECT_INVALID(dwarf::DW_OP_plus_uconst); EXPECT_INVALID(dwarf::DW_OP_LLVM_fragment); EXPECT_INVALID(dwarf::DW_OP_LLVM_fragment, 3); - EXPECT_INVALID(dwarf::DW_OP_LLVM_fragment, 3, 7, dwarf::DW_OP_plus, 3); + EXPECT_INVALID(dwarf::DW_OP_LLVM_fragment, 3, 7, dwarf::DW_OP_plus_uconst, 3); EXPECT_INVALID(dwarf::DW_OP_LLVM_fragment, 3, 7, dwarf::DW_OP_deref); #undef EXPECT_VALID