From b91f572b7089726e94ef1e53a32f6f75b579cd00 Mon Sep 17 00:00:00 2001 From: Sebastian Neubauer Date: Wed, 15 Nov 2023 16:09:49 +0100 Subject: [PATCH] Add new argument to createStaticMemberType Makes llpc compatible with the change in https://github.com/llvm/llvm-project/pull/72234 --- llpc/translator/lib/SPIRV/SPIRVToLLVMDbgTran.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/llpc/translator/lib/SPIRV/SPIRVToLLVMDbgTran.cpp b/llpc/translator/lib/SPIRV/SPIRVToLLVMDbgTran.cpp index bf441cae9a..fb73d0509c 100644 --- a/llpc/translator/lib/SPIRV/SPIRVToLLVMDbgTran.cpp +++ b/llpc/translator/lib/SPIRV/SPIRVToLLVMDbgTran.cpp @@ -371,7 +371,15 @@ DINode *SPIRVToLLVMDbgTran::transTypeMember(const SPIRVExtInst *DebugInst) { SPIRVValue *ConstVal = BM->get(Ops[ValueIdx]); assert(isConstantOpCode(ConstVal->getOpCode()) && "Static member must be a constant"); llvm::Value *Val = SPIRVReader->transValue(ConstVal, nullptr, nullptr); - return Builder.createStaticMemberType(Scope, Name, File, LineNo, BaseType, Flags, cast(Val)); + return Builder.createStaticMemberType( + Scope, Name, File, LineNo, BaseType, Flags, + cast(Val) +#if !defined(LLVM_MAIN_REVISION) || LLVM_MAIN_REVISION >= 480812 + // New version of the code (also handles unknown version, which we treat as latest) + , + llvm::dwarf::DW_TAG_member +#endif + ); } uint64_t Size = getConstant(Ops[SizeIdx]); uint64_t Alignment = 0;