[RemoveDIs][Clang] Resolve DILocalVariables used by DbgRecords (#90882)

This patch fixes debug records in clang, by adding support for debug
records to the only remaining place that refers to DbgVariableIntrinsics
directly and does not handle DbgVariableRecords.
This commit is contained in:
Stephen Tozer authored and GitHub committed 2024-05-02 20:20:40 +01:00
1 parent dcf376aae7
commit 8805465e1d
2 files changed
+8

No files matched your search

+6
View File
@@ -131,6 +131,12 @@ static void resolveTopLevelMetadata(llvm::Function *Fn,
// they are referencing.
for (auto &BB : *Fn) {
for (auto &I : BB) {
for (llvm::DbgVariableRecord &DVR :
llvm::filterDbgVars(I.getDbgRecordRange())) {
auto *DILocal = DVR.getVariable();
if (!DILocal->isResolved())
DILocal->resolve();
}
if (auto *DII = dyn_cast<llvm::DbgVariableIntrinsic>(&I)) {
auto *DILocal = DII->getVariable();
if (!DILocal->isResolved())
+2
View File
@@ -1,6 +1,8 @@
// REQUIRES: asserts
// RUN: %clang_cc1 -O0 -triple %itanium_abi_triple -debug-info-kind=limited -S -emit-llvm %s -o - | \
// RUN: FileCheck %s
// RUN: %clang_cc1 -O0 -triple %itanium_abi_triple -debug-info-kind=limited -S -emit-llvm -mllvm --experimental-debuginfo-iterators=true %s -o - | \
// RUN: FileCheck %s
// This test simply checks that the varargs thunk is created. The failing test
// case asserts.