Skip to content

Commit b91f572

Browse files
committed
Add new argument to createStaticMemberType
Makes llpc compatible with the change in llvm/llvm-project#72234
1 parent 317bdfb commit b91f572

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

llpc/translator/lib/SPIRV/SPIRVToLLVMDbgTran.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,15 @@ DINode *SPIRVToLLVMDbgTran::transTypeMember(const SPIRVExtInst *DebugInst) {
371371
SPIRVValue *ConstVal = BM->get<SPIRVValue>(Ops[ValueIdx]);
372372
assert(isConstantOpCode(ConstVal->getOpCode()) && "Static member must be a constant");
373373
llvm::Value *Val = SPIRVReader->transValue(ConstVal, nullptr, nullptr);
374-
return Builder.createStaticMemberType(Scope, Name, File, LineNo, BaseType, Flags, cast<llvm::Constant>(Val));
374+
return Builder.createStaticMemberType(
375+
Scope, Name, File, LineNo, BaseType, Flags,
376+
cast<llvm::Constant>(Val)
377+
#if !defined(LLVM_MAIN_REVISION) || LLVM_MAIN_REVISION >= 480812
378+
// New version of the code (also handles unknown version, which we treat as latest)
379+
,
380+
llvm::dwarf::DW_TAG_member
381+
#endif
382+
);
375383
}
376384
uint64_t Size = getConstant(Ops[SizeIdx]);
377385
uint64_t Alignment = 0;

0 commit comments

Comments
 (0)