|
@@ -1197,6 +1197,7 @@ HRESULT dxil_dia::hlsl_symbols::SymbolManagerInit::CreateFunctionBlocksForFuncti
|
|
|
}
|
|
|
|
|
|
HRESULT dxil_dia::hlsl_symbols::SymbolManagerInit::CreateFunctionsForCU(llvm::DICompileUnit *CU) {
|
|
|
+ bool FoundFunctions = false;
|
|
|
for (llvm::DISubprogram *SubProgram : CU->getSubprograms()) {
|
|
|
DWORD dwNewFunID;
|
|
|
const DWORD dwParentID = SubProgram->isLocalToUnit() ? HlslCompilandId : HlslProgramId;
|
|
@@ -1207,9 +1208,20 @@ HRESULT dxil_dia::hlsl_symbols::SymbolManagerInit::CreateFunctionsForCU(llvm::DI
|
|
|
|
|
|
if (llvm::Function *F = SubProgram->getFunction()) {
|
|
|
IFR(CreateFunctionBlocksForFunction(F));
|
|
|
+ FoundFunctions = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (!FoundFunctions) {
|
|
|
+ // This works around an old bug in dxcompiler whose effects are still
|
|
|
+ // sometimes present in PIX users' traces. (The bug was that the subprogram(s)
|
|
|
+ // weren't pointing to their contained function.)
|
|
|
+ llvm::Module *M = &m_Session.ModuleRef();
|
|
|
+ auto &DM = M->GetDxilModule();
|
|
|
+ llvm::Function *EntryPoint = DM.GetEntryFunction();
|
|
|
+ IFR(CreateFunctionBlocksForFunction(EntryPoint));
|
|
|
+ }
|
|
|
+
|
|
|
return S_OK;
|
|
|
}
|
|
|
|