From 7b039c0cf0045d81da7e1575232a46266cff1e88 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Mon, 15 Apr 2024 13:15:27 +0100 Subject: [DebugInfo][RemoveDIs] Fix error from not tracking seen debug labels (#88718) Fixes the reported errors on: https://github.com/llvm/llvm-project/pull/87379 A previous patch updated the bitcode reading for debug intrinsics/records to not perform the expensive debug info format conversion from records to intrinsics in cases where no records were present, but the patch did not actually track when debug labels had been seen, resulting in errors when parsing bitcode where functions contained debug label records but no other debug records. This patch fixes that case and adds a test for it. --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp') diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index fe4f0d6..0b7fcd8 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -6454,6 +6454,7 @@ Error BitcodeReader::parseFunctionBody(Function *F) { case bitc::FUNC_CODE_DEBUG_RECORD_LABEL: { // DbgLabelRecords are placed after the Instructions that they are // attached to. + SeenDebugRecord = true; Instruction *Inst = getLastInstruction(); if (!Inst) return error("Invalid dbg record: missing instruction"); -- cgit v1.1