Skip to content

Commit

Permalink
[SYCL] Remove usage of deprecated getPointerTo() in offloading tools(i…
Browse files Browse the repository at this point in the history
…ntel#16333)

Replace deprecated `getPointerTo()` with
`llvm::PointerType::get(LLVMContext)`.
  • Loading branch information
maarquitos14 authored Dec 12, 2024
1 parent f0ee2da commit 1587ea5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ class BinaryWrapper {
std::pair<Constant *, Constant *>
addStructArrayToModule(ArrayRef<Constant *> ArrayData, Type *ElemTy) {

auto *PtrTy = ElemTy->getPointerTo();
auto *PtrTy = llvm::PointerType::getUnqual(C);

if (ArrayData.size() == 0) {
auto *NullPtr = Constant::getNullValue(PtrTy);
Expand Down Expand Up @@ -917,8 +917,7 @@ class BinaryWrapper {
PropRegistry = MySymPropReader->getPropRegistry();
} else {
if (PropRegistryFile.empty()) {
auto *NullPtr =
Constant::getNullValue(getSyclPropSetTy()->getPointerTo());
auto *NullPtr = Constant::getNullValue(llvm::PointerType::getUnqual(C));
return std::pair<Constant *, Constant *>(NullPtr, NullPtr);
}
// load the property registry file
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Frontend/Offloading/SYCLOffloadWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ struct Wrapper {
std::pair<Constant *, Constant *>
addStructArrayToModule(ArrayRef<Constant *> ArrayData, Type *ElemTy) {
if (ArrayData.empty()) {
auto *PtrTy = ElemTy->getPointerTo();
auto *PtrTy = llvm::PointerType::getUnqual(ElemTy->getContext());
auto *NullPtr = Constant::getNullValue(PtrTy);
return std::make_pair(NullPtr, NullPtr);
}
Expand Down

0 comments on commit 1587ea5

Please sign in to comment.