fix(FTBFS): clover: work around removal of PointerType::getElementType()

`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] <d593cf7945>
[1] <https://llvm.org/docs/OpaquePointers.html>

Closes: #6042
Cc: mesa-stable
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15091>
This commit is contained in:
Kai Wasserbäch 2022-02-19 13:03:08 +01:00 committed by Marge Bot
parent 3bbd404457
commit 948ad5ac23

View file

@ -30,6 +30,7 @@
/// understood by pipe drivers.
///
#include <llvm/IR/Type.h>
#include <llvm/Support/Allocator.h>
#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<unsigned>(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),