From 20ebc7ea8209cb8f1ff3916706b6e7d8232c9f3f Mon Sep 17 00:00:00 2001 From: Shubham Sandeep Rastogi Date: Sat, 22 Nov 2025 00:49:35 -0800 Subject: Add new llvm.dbg.declare_value intrinsic. (#168132) For swift async code, we need to use a debug intrinsic that behaves like an llvm.dbg.declare but can take any location type rather than just a pointer or integer. To solve this, a new debug instrinsic called llvm.dbg.declare_value has been created, which behaves exactly like an llvm.dbg.declare but can take non pointer and integer location types. More information here: https://discourse.llvm.org/t/rfc-introduce-new-llvm-dbg-coroframe-entry-intrinsic/88269 This is the first patch as part of a stack of patches, with the one succeeding it being: https://github.com/llvm/llvm-project/pull/168134 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp') diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 76494c792ac7..1d0461478b90 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -3844,6 +3844,9 @@ void ModuleBitcodeWriter::writeFunction( } else if (DVR.isDbgDeclare()) { Vals.push_back(VE.getMetadataID(DVR.getRawLocation())); Stream.EmitRecord(bitc::FUNC_CODE_DEBUG_RECORD_DECLARE, Vals); + } else if (DVR.isDbgDeclareValue()) { + Vals.push_back(VE.getMetadataID(DVR.getRawLocation())); + Stream.EmitRecord(bitc::FUNC_CODE_DEBUG_RECORD_DECLARE_VALUE, Vals); } else { assert(DVR.isDbgAssign() && "Unexpected DbgRecord kind"); Vals.push_back(VE.getMetadataID(DVR.getRawLocation())); -- cgit v1.2.3