Skip to content

Commit 8805465

Browse files
authored
[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.
1 parent dcf376a commit 8805465

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

clang/lib/CodeGen/CGVTables.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@ static void resolveTopLevelMetadata(llvm::Function *Fn,
131131
// they are referencing.
132132
for (auto &BB : *Fn) {
133133
for (auto &I : BB) {
134+
for (llvm::DbgVariableRecord &DVR :
135+
llvm::filterDbgVars(I.getDbgRecordRange())) {
136+
auto *DILocal = DVR.getVariable();
137+
if (!DILocal->isResolved())
138+
DILocal->resolve();
139+
}
134140
if (auto *DII = dyn_cast<llvm::DbgVariableIntrinsic>(&I)) {
135141
auto *DILocal = DII->getVariable();
136142
if (!DILocal->isResolved())

clang/test/CodeGenCXX/tmp-md-nodes2.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// REQUIRES: asserts
22
// RUN: %clang_cc1 -O0 -triple %itanium_abi_triple -debug-info-kind=limited -S -emit-llvm %s -o - | \
33
// RUN: FileCheck %s
4+
// RUN: %clang_cc1 -O0 -triple %itanium_abi_triple -debug-info-kind=limited -S -emit-llvm -mllvm --experimental-debuginfo-iterators=true %s -o - | \
5+
// RUN: FileCheck %s
46

57
// This test simply checks that the varargs thunk is created. The failing test
68
// case asserts.

0 commit comments

Comments
 (0)