Skip to content

Commit

Permalink
Add new argument to createStaticMemberType
Browse files Browse the repository at this point in the history
Makes llpc compatible with the change in
llvm/llvm-project#72234
  • Loading branch information
Flakebi committed Nov 15, 2023
1 parent 59f30aa commit dc68085
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion llpc/translator/lib/SPIRV/SPIRVToLLVMDbgTran.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,15 @@ DINode *SPIRVToLLVMDbgTran::transTypeMember(const SPIRVExtInst *DebugInst) {
SPIRVValue *ConstVal = BM->get<SPIRVValue>(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<llvm::Constant>(Val));
return Builder.createStaticMemberType(
Scope, Name, File, LineNo, BaseType, Flags,
cast<llvm::Constant>(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;
Expand Down

0 comments on commit dc68085

Please sign in to comment.