summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Wasserbäch <kai@dev.carbon-project.org>2022-02-19 13:03:08 +0100
committerDylan Baker <dylan.c.baker@intel.com>2022-04-21 16:10:22 -0700
commitff2ecc72af8e9289563e88b2b5272888d70d7080 (patch)
tree072cac70484712b92f01883dc05cc7a37d2e9e50
parentfbaf4e8469911e3589188e59e92e5d601f7bb144 (diff)
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] <https://github.com/llvm/llvm-project/commit/d593cf79458a59d37e75c886a4fc3ac6a02b484d> [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> (cherry picked from commit 948ad5ac230c5434350fc988c147e28e1b9506ab)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/frontends/clover/llvm/codegen/common.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 60740029a27..f5dd2013759 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1972,7 +1972,7 @@
"description": "fix(FTBFS): clover: work around removal of PointerType::getElementType()",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"because_sha": null
},
{
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 <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),