Skip to content

Commit bbbc98a

Browse files
airliedvmaksimo
authored andcommitted
Support LLVM 12 interface change for getTypeByName
fe43168 in llvm master changed how this API is used. Signed-off-by: Dave Airlie <airlied@redhat.com>
1 parent ed37b6d commit bbbc98a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm-spirv/lib/SPIRV/SPIRVReader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ Type *SPIRVToLLVM::transType(SPIRVType *T, bool IsClassMember) {
519519
auto ST = static_cast<SPIRVTypeStruct *>(T);
520520
auto Name = ST->getName();
521521
if (!Name.empty()) {
522-
if (auto OldST = StructType::getTypeByName(M->getContext(), Name))
522+
if (auto OldST = StructType::getTypeByName(*Context, Name))
523523
OldST->setName("");
524524
} else {
525525
Name = "structtype";
@@ -1472,7 +1472,7 @@ Value *SPIRVToLLVM::oclTransConstantPipeStorage(
14721472
kSPIRVTypeName::ConstantPipeStorage;
14731473

14741474
auto Int32Ty = IntegerType::getInt32Ty(*Context);
1475-
auto CPSTy = StructType::getTypeByName(M->getContext(), CPSName);
1475+
auto CPSTy = StructType::getTypeByName(*Context, CPSName);
14761476
if (!CPSTy) {
14771477
Type *CPSElemsTy[] = {Int32Ty, Int32Ty, Int32Ty};
14781478
CPSTy = StructType::create(*Context, CPSElemsTy, CPSName);

0 commit comments

Comments
 (0)