[PATCH] D77425: [NFC] Make Type::isVectorTy call isa<VectorType>

Christopher Tetreault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 9 14:25:28 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG994d84b9192e: [NFC] Make Type::isVectorTy call isa<VectorType> (authored by ctetreau).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77425

Files:
  llvm/include/llvm/IR/DerivedTypes.h
  llvm/include/llvm/IR/Type.h


Index: llvm/include/llvm/IR/Type.h
===================================================================
--- llvm/include/llvm/IR/Type.h
+++ llvm/include/llvm/IR/Type.h
@@ -223,7 +223,7 @@
   bool isPtrOrPtrVectorTy() const { return getScalarType()->isPointerTy(); }
 
   /// True if this is an instance of VectorType.
-  bool isVectorTy() const { return getTypeID() == VectorTyID; }
+  inline bool isVectorTy() const;
 
   /// Return true if this type could be converted with a lossless BitCast to
   /// type 'Ty'. For example, i8* to i32*. BitCasts are valid for types of the
Index: llvm/include/llvm/IR/DerivedTypes.h
===================================================================
--- llvm/include/llvm/IR/DerivedTypes.h
+++ llvm/include/llvm/IR/DerivedTypes.h
@@ -543,6 +543,8 @@
   return cast<VectorType>(this)->getElementCount();
 }
 
+bool Type::isVectorTy() const { return isa<VectorType>(this); }
+
 /// Class to represent pointers.
 class PointerType : public Type {
   explicit PointerType(Type *ElType, unsigned AddrSpace);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77425.256414.patch
Type: text/x-patch
Size: 1041 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200409/b1075fd2/attachment.bin>


More information about the llvm-commits mailing list