Skip to content

Commit 3c3e084

Browse files
committed
Add new argument to createStaticMemberType
Makes llpc compatible with the change in llvm/llvm-project#72234
1 parent 59f30aa commit 3c3e084

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

llpc/translator/lib/SPIRV/SPIRVToLLVMDbgTran.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,12 @@ 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(Scope, Name, File, LineNo, BaseType, Flags, cast<llvm::Constant>(Val)
375+
#if !defined(LLVM_MAIN_REVISION) || LLVM_MAIN_REVISION >= 480812
376+
// New version of the code (also handles unknown version, which we treat as latest)
377+
, llvm::dwarf::DW_TAG_member
378+
#endif
379+
);
375380
}
376381
uint64_t Size = getConstant(Ops[SizeIdx]);
377382
uint64_t Alignment = 0;

0 commit comments

Comments
 (0)