Skip to content

Commit

Permalink
llpc/dbginfo: remove dead code in transFunction
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nhaehnle committed Nov 8, 2023
1 parent bbe664b commit fee9dfd
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions llpc/translator/lib/SPIRV/SPIRVToLLVMDbgTran.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<DICompositeType>(Scope) || isa<DINamespace>(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;
Expand Down

0 comments on commit fee9dfd

Please sign in to comment.