From fee9dfde8e894aaf2fa57f7960a9a1cb3e42bec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Fri, 6 Oct 2023 22:51:06 +0200 Subject: [PATCH] llpc/dbginfo: remove dead code in transFunction isDefinition is always true, so createMethod could never be called. It is also unclear how useful calling createMethod is at this point. It seems the primary difference to createFunction is supporting vtable info and this-pointer adjustments, but neither concept seems to exist in NonSemantic.Shader.DebugInfo.100 --- llpc/translator/lib/SPIRV/SPIRVToLLVMDbgTran.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/llpc/translator/lib/SPIRV/SPIRVToLLVMDbgTran.cpp b/llpc/translator/lib/SPIRV/SPIRVToLLVMDbgTran.cpp index e6d4713528..e87bf8c7d4 100644 --- a/llpc/translator/lib/SPIRV/SPIRVToLLVMDbgTran.cpp +++ b/llpc/translator/lib/SPIRV/SPIRVToLLVMDbgTran.cpp @@ -504,12 +504,8 @@ DINode *SPIRVToLLVMDbgTran::transFunction(const SPIRVExtInst *DebugInst) { DINodeArray TParams = Builder.getOrCreateArray(Elts); llvm::DITemplateParameterArray TParamsArray = TParams.get(); - DISubprogram *DIS = nullptr; - if ((isa(Scope) || isa(Scope)) && !IsDefinition) - DIS = Builder.createMethod(Scope, Name, LinkageName, File, LineNo, Ty, 0, 0, nullptr, Flags, SPFlags, TParamsArray); - else - DIS = - Builder.createFunction(Scope, Name, LinkageName, File, LineNo, Ty, ScopeLine, Flags, SPFlags, TParamsArray, FD); + DISubprogram *DIS = + Builder.createFunction(Scope, Name, LinkageName, File, LineNo, Ty, ScopeLine, Flags, SPFlags, TParamsArray, FD); DebugInstCache[DebugInst] = DIS; SPIRVId RealFuncId = Ops[FunctionIdIdx]; FuncMap[RealFuncId] = DIS;