From 8998f8ab6630ef173cd1f57f0e57b4c16566db6f Mon Sep 17 00:00:00 2001 From: Sourabh Singh Tomar Date: Thu, 23 Jul 2020 14:43:24 +0530 Subject: [PATCH] [DebugInfo] Attempt to fix regression test failure after 59a76d957a2603ee0 Test case `test/CodeGen/WebAssembly/stackified-debug.ll` was failing due to malformed DwarfExpression. This failure has been seen in lot of bots, for instance in: http://lab.llvm.org:8011/builders/lld-x86_64-ubuntu-fast/builds/18794 : 'RUN: at line 1' /home/buildbot/as-builder-4/lld-x86_64-ubuntu-fast/build/bin/llc /home/buildbot/as-builder-4/lld-x86_64-ubuntu-fast/build/bin/FileCheck /home/buildbot/as-builder-4/lld-x86_64-ubuntu-fast/llvm-project/llvm/test/CodeGen/WebAssembly/stackified-debug.ll home/buildbot/as-builder-4/lld-x86_64-ubuntu-fast/llvm-project/llvm/test/CodeGen/WebAssembly/stackified-debug.ll:26:10: error: CHECK: expected string not found in input CHECK: .int16 4 # Loc expr size ^ :34:2: note: scanning from here .int16 3 # Loc expr size Differential Revision: https://reviews.llvm.org/D83560 --- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 32a974b45d7d..a705fa4eec34 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2512,6 +2512,8 @@ void DwarfDebug::emitDebugLocValue(const AsmPrinter &AP, const DIBasicType *BT, // TODO TargetIndexLocation is a target-independent. Currently only the WebAssembly-specific // encoding is supported. DwarfExpr.addWasmLocation(Loc.Index, static_cast(Loc.Offset)); + DwarfExpr.addExpression(std::move(ExprCursor)); + return; } else if (Value.isConstantFP()) { if (AP.getDwarfVersion() >= 4 && AP.getDwarfDebug()->tuneForGDB()) { DwarfExpr.addConstantFP(Value.getConstantFP()->getValueAPF()); -- 2.34.1