Skip to content

Commit 5adc7bc

Browse files
authored
WinPIX: Find correct filename for subroutines in included headers within namespaces (microsoft#5776)
From a customer bug report, the previous code would skip over a DISubProgram scope if that scope was contained in a DINamespace (as in the first test case herein, wherein an include file is enclosed in a namespace). This would result in DXIL being attributed to the includer file instead of the included file.
1 parent 755d111 commit 5adc7bc

File tree

2 files changed

+213
-55
lines changed

2 files changed

+213
-55
lines changed

lib/DxilDia/DxcPixDxilDebugInfo.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ dxil_debug_info::DxcPixDxilSourceLocations::DxcPixDxilSourceLocations(
202202
S = ContainingScope;
203203
else
204204
S = S->getFile();
205+
} else if (auto Subprogram = llvm::dyn_cast<llvm::DISubprogram>(S)) {
206+
S = Subprogram->getFile();
205207
} else
206208
S = S->getScope().resolve(EmptyMap);
207209
}

0 commit comments

Comments
 (0)