[PATCH] D136768: Make typed pointers to be yet again recognized as pointers

Dmitry Sidorov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 27 04:57:03 PDT 2022


sidorovd updated this revision to Diff 471128.
Herald added a subscriber: hiraditya.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136768/new/

https://reviews.llvm.org/D136768

Files:
  llvm/lib/IR/Type.cpp
  llvm/lib/IR/Value.cpp


Index: llvm/lib/IR/Value.cpp
===================================================================
--- llvm/lib/IR/Value.cpp
+++ llvm/lib/IR/Value.cpp
@@ -44,7 +44,7 @@
 //===----------------------------------------------------------------------===//
 static inline Type *checkType(Type *Ty) {
   assert(Ty && "Value defined with a null type: Error!");
-  assert(!isa<TypedPointerType>(Ty) &&
+  assert(!isa<TypedPointerType>(Ty->getScalarType()) &&
          "Cannot have values with typed pointer types");
   return Ty;
 }
Index: llvm/lib/IR/Type.cpp
===================================================================
--- llvm/lib/IR/Type.cpp
+++ llvm/lib/IR/Type.cpp
@@ -674,7 +674,7 @@
 
 bool VectorType::isValidElementType(Type *ElemTy) {
   return ElemTy->isIntegerTy() || ElemTy->isFloatingPointTy() ||
-         ElemTy->isPointerTy();
+         ElemTy->isPointerTy() || ElemTy->getTypeID() == TypedPointerTyID;
 }
 
 //===----------------------------------------------------------------------===//


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136768.471128.patch
Type: text/x-patch
Size: 1006 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221027/fbe1e486/attachment.bin>


More information about the llvm-commits mailing list