[PATCH] D79122: [NFC] Make ConstantVector/ConstantDataVector::getType() return a FixedVectorType

Christopher Tetreault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 29 14:34:44 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG7ef15c869a55: [NFC] Make ConstantVector/ConstantDataVector::getType() return a FixedVectorType (authored by ctetreau).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79122

Files:
  llvm/include/llvm/IR/Constants.h


Index: llvm/include/llvm/IR/Constants.h
===================================================================
--- llvm/include/llvm/IR/Constants.h
+++ llvm/include/llvm/IR/Constants.h
@@ -516,12 +516,13 @@
 
 public:
   /// Return a ConstantVector with the specified constant in each element.
+  /// Note that this might not return an instance of ConstantVector
   static Constant *getSplat(ElementCount EC, Constant *Elt);
 
-  /// Specialize the getType() method to always return a VectorType,
+  /// Specialize the getType() method to always return a FixedVectorType,
   /// which reduces the amount of casting needed in parts of the compiler.
-  inline VectorType *getType() const {
-    return cast<VectorType>(Value::getType());
+  inline FixedVectorType *getType() const {
+    return cast<FixedVectorType>(Value::getType());
   }
 
   /// If all elements of the vector constant have the same value, return that
@@ -801,10 +802,10 @@
   /// same value, return that value. Otherwise return NULL.
   Constant *getSplatValue() const;
 
-  /// Specialize the getType() method to always return a VectorType,
+  /// Specialize the getType() method to always return a FixedVectorType,
   /// which reduces the amount of casting needed in parts of the compiler.
-  inline VectorType *getType() const {
-    return cast<VectorType>(Value::getType());
+  inline FixedVectorType *getType() const {
+    return cast<FixedVectorType>(Value::getType());
   }
 
   /// Methods for support type inquiry through isa, cast, and dyn_cast:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79122.261040.patch
Type: text/x-patch
Size: 1525 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200429/a9d50507/attachment.bin>


More information about the llvm-commits mailing list