diff options
| author | Chris Lattner <sabre@nondot.org> | 2011-02-14 07:55:32 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2011-02-14 07:55:32 +0000 |
| commit | 283c8caccd093f8e1d4f0bdd01ac240b4edbd20a (patch) | |
| tree | bf56193b8f9bd39bcb2ffd3251e27f67d7953a2e /include | |
| parent | 2b9bc422a5e6840f5b925316bc06d5943deb610a (diff) | |
Switch ConstantVector::get to use ArrayRef instead of a pointer+size
idiom. Change various clients to simplify their code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125487 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
| -rw-r--r-- | include/llvm/ADT/ArrayRef.h | 4 | ||||
| -rw-r--r-- | include/llvm/Constants.h | 8 |
2 files changed, 5 insertions, 7 deletions
diff --git a/include/llvm/ADT/ArrayRef.h b/include/llvm/ADT/ArrayRef.h index b0162553ce..ce63d844de 100644 --- a/include/llvm/ADT/ArrayRef.h +++ b/include/llvm/ADT/ArrayRef.h @@ -17,8 +17,8 @@ namespace llvm { class APInt; /// ArrayRef - Represent a constant reference to an array (0 or more elements - /// consequtively in memory), i.e. a start pointer and a length. It allows - /// various APIs to take consequtive elements easily and conveniently. + /// consecutively in memory), i.e. a start pointer and a length. It allows + /// various APIs to take consecutive elements easily and conveniently. /// /// This class does not own the underlying data, it is expected to be used in /// situations where the data resides in some other buffer, whose lifetime diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index 50e64d4c8b..c4768f8423 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -25,7 +25,7 @@ #include "llvm/OperandTraits.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/APFloat.h" -#include <vector> +#include "llvm/ADT/ArrayRef.h" namespace llvm { @@ -39,8 +39,6 @@ template<class ConstantClass, class TypeClass, class ValType> struct ConstantCreator; template<class ConstantClass, class TypeClass> struct ConvertConstantType; -template<typename T, unsigned N> -class SmallVector; //===----------------------------------------------------------------------===// /// This is the shared class of boolean and integer constants. This class @@ -473,9 +471,9 @@ protected: ConstantVector(const VectorType *T, const std::vector<Constant*> &Val); public: // ConstantVector accessors + static Constant *get(ArrayRef<Constant*> V); + // FIXME: Eliminate this constructor form. static Constant *get(const VectorType *T, const std::vector<Constant*> &V); - static Constant *get(const std::vector<Constant*> &V); - static Constant *get(Constant *const *Vals, unsigned NumVals); /// Transparently provide more efficient getOperand methods. DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant); |
