From 948ad5ac230c5434350fc988c147e28e1b9506ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20Wasserb=C3=A4ch?= Date: Sat, 19 Feb 2022 13:03:08 +0100 Subject: [PATCH] fix(FTBFS): clover: work around removal of PointerType::getElementType() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `PointerType::getElementType()` was deprected and is gone now [0]. The *temporary* workaround is using `Type::getPointerElementType()`, longterm this needs to use [1]. This commit fixes an FTBFS. [0] [1] Closes: #6042 Cc: mesa-stable Signed-off-by: Kai Wasserbäch Reviewed-by: Dave Airlie Part-of: --- src/gallium/frontends/clover/llvm/codegen/common.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gallium/frontends/clover/llvm/codegen/common.cpp b/src/gallium/frontends/clover/llvm/codegen/common.cpp index ff87d9c2a0a..c9f303a9924 100644 --- a/src/gallium/frontends/clover/llvm/codegen/common.cpp +++ b/src/gallium/frontends/clover/llvm/codegen/common.cpp @@ -30,6 +30,7 @@ /// understood by pipe drivers. /// +#include #include #include "llvm/codegen.hpp" @@ -203,7 +204,7 @@ namespace { // Other types. const auto actual_type = isa< ::llvm::PointerType>(arg_type) && arg.hasByValAttr() ? - cast< ::llvm::PointerType>(arg_type)->getElementType() : arg_type; + cast< ::llvm::PointerType>(arg_type)->getPointerElementType() : arg_type; if (actual_type->isPointerTy()) { const unsigned address_space = @@ -214,7 +215,7 @@ namespace { static_cast(clang::LangAS::opencl_local); if (address_space == map[offset]) { const auto pointee_type = cast< - ::llvm::PointerType>(actual_type)->getElementType(); + ::llvm::PointerType>(actual_type)->getPointerElementType(); args.emplace_back(binary::argument::local, arg_api_size, target_size, dl.getABITypeAlignment(pointee_type),