Skip to content

Commit

Permalink
Stop using opaque pointer API for LLVM 18+ (#60)
Browse files Browse the repository at this point in the history
LLVM 17 will be the last version with opaque pointer API support.
  • Loading branch information
mariusz-sikora-at-amd authored Jul 26, 2023
1 parent 1b17b82 commit 54af66f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Dialect/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,14 @@ static std::string getMangledTypeStr(Type *Ty, bool &HasUnnamedType) {
std::string Result;
if (PointerType *PTyp = dyn_cast<PointerType>(Ty)) {
Result += "p" + utostr(PTyp->getAddressSpace());
#if HAVE_LLVM_VERSION_MAJOR <= 17
// Opaque pointer doesn't have pointee type information, so we just mangle
// address space for opaque pointer.
// After llvm-18+ opaque pointer API will be removed from LLVM.
if (!PTyp->isOpaque())
Result += getMangledTypeStr(PTyp->getNonOpaquePointerElementType(),
HasUnnamedType);
#endif
} else if (ArrayType *ATyp = dyn_cast<ArrayType>(Ty)) {
Result += "a" + utostr(ATyp->getNumElements()) +
getMangledTypeStr(ATyp->getElementType(), HasUnnamedType);
Expand Down

0 comments on commit 54af66f

Please sign in to comment.