diff options
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Constant.h | 6 | ||||
-rw-r--r-- | include/llvm/Instructions.h | 12 |
2 files changed, 10 insertions, 8 deletions
diff --git a/include/llvm/Constant.h b/include/llvm/Constant.h index f7d4dd2..11a02e0 100644 --- a/include/llvm/Constant.h +++ b/include/llvm/Constant.h @@ -91,12 +91,6 @@ public: /// FIXME: This really should not be in VMCore. PossibleRelocationsTy getRelocationInfo() const; - /// getVectorElements - This method, which is only valid on constant of vector - /// type, returns the elements of the vector in the specified smallvector. - /// This handles breaking down a vector undef into undef elements, etc. For - /// constant exprs and other cases we can't handle, we return an empty vector. - void getVectorElements(SmallVectorImpl<Constant*> &Elts) const; - /// getAggregateElement - For aggregates (struct/array/vector) return the /// constant that corresponds to the specified element if possible, or null if /// not. This can return null if the element index is a ConstantExpr, or if diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index 35cb025..c27c6fa 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -1677,11 +1677,19 @@ public: /// getMaskValue - Return the index from the shuffle mask for the specified /// output result. This is either -1 if the element is undef or a number less /// than 2*numelements. - int getMaskValue(unsigned i) const; + static int getMaskValue(Constant *Mask, unsigned i); + + int getMaskValue(unsigned i) const { + return getMaskValue(getMask(), i); + } /// getShuffleMask - Return the full mask for this instruction, where each /// element is the element number and undef's are returned as -1. - void getShuffleMask(SmallVectorImpl<int> &Mask) const; + static void getShuffleMask(Constant *Mask, SmallVectorImpl<int> &Result); + + void getShuffleMask(SmallVectorImpl<int> &Result) const { + return getShuffleMask(getMask(), Result); + } SmallVector<int, 16> getShuffleMask() const { SmallVector<int, 16> Mask; |