================ @@ -197,10 +198,9 @@ class Address { /// Return the type of the pointer value. llvm::PointerType *getType() const { - return llvm::PointerType::get( - ElementType, - llvm::cast<llvm::PointerType>(Pointer.getPointer()->getType()) - ->getAddressSpace()); + auto AS = llvm::cast<llvm::PointerType>(Pointer.getPointer()->getType()) + ->getAddressSpace(); + return llvm::PointerType::get(ElementType->getContext(), AS); ---------------- nikic wrote:
Can't you directly return `Pointer.getPointer()->getType()`? No need to reconstruct it via addrspace. https://github.com/llvm/llvm-project/pull/124771 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits