diff options
author | Chris Lattner <sabre@nondot.org> | 2012-01-30 18:19:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2012-01-30 18:19:30 +0000 |
commit | 8cf27efe4000c194efec4004afa83d12031c6d55 (patch) | |
tree | cfef7db8ba452bae9599f1af49f6419f4a04b657 | |
parent | b2f1b5028c03cd16c2452e81544d2da51fb373f2 (diff) |
Various improvements suggested by Duncan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149255 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Constants.h | 29 | ||||
-rw-r--r-- | lib/VMCore/Constants.cpp | 2 |
2 files changed, 19 insertions, 12 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index f5d999b295..43f625a68f 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -561,10 +561,13 @@ public: }; //===----------------------------------------------------------------------===// -/// ConstantDataSequential - A vector or array of data that contains no -/// relocations, and whose element type is a simple 1/2/4/8-byte integer or -/// float/double. This is the common base class of ConstantDataArray and -/// ConstantDataVector. +/// ConstantDataSequential - A vector or array constant whose element type is a +/// simple 1/2/4/8-byte integer or float/double, and whose elements are just +/// simple data values (i.e. ConstantInt/ConstantFP). This Constant node has no +/// operands because it stores all of the elements of the constant as densely +/// packed data, instead of as Value*'s. +/// +/// This is the common base class of ConstantDataArray and ConstantDataVector. /// class ConstantDataSequential : public Constant { friend class LLVMContextImpl; @@ -612,7 +615,7 @@ public: float getElementAsFloat(unsigned i) const; /// getElementAsDouble - If this is an sequential container of doubles, return - /// the specified element as a float. + /// the specified element as a double. double getElementAsDouble(unsigned i) const; /// getElementAsConstant - Return a Constant for a specified index's element. @@ -683,9 +686,11 @@ private: }; //===----------------------------------------------------------------------===// -/// ConstantDataArray - An array of data that contains no relocations, and whose -/// element type is a simple 1/2/4/8-byte integer or float/double. -/// +/// ConstantDataArray - An array constant whose element type is a simple +/// 1/2/4/8-byte integer or float/double, and whose elements are just simple +/// data values (i.e. ConstantInt/ConstantFP). This Constant node has no +/// operands because it stores all of the elements of the constant as densely +/// packed data, instead of as Value*'s. class ConstantDataArray : public ConstantDataSequential { void *operator new(size_t, unsigned); // DO NOT IMPLEMENT ConstantDataArray(const ConstantDataArray &); // DO NOT IMPLEMENT @@ -734,9 +739,11 @@ public: }; //===----------------------------------------------------------------------===// -/// ConstantDataVector - A vector of data that contains no relocations, and -/// whose element type is a simple 1/2/4/8-byte integer or float/double. -/// +/// ConstantDataVector - A vector constant whose element type is a simple +/// 1/2/4/8-byte integer or float/double, and whose elements are just simple +/// data values (i.e. ConstantInt/ConstantFP). This Constant node has no +/// operands because it stores all of the elements of the constant as densely +/// packed data, instead of as Value*'s. class ConstantDataVector : public ConstantDataSequential { void *operator new(size_t, unsigned); // DO NOT IMPLEMENT ConstantDataVector(const ConstantDataVector &); // DO NOT IMPLEMENT diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index aa00917cf0..f7884c6862 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -2109,7 +2109,7 @@ static bool isAllZeros(StringRef Arr) { /// getImpl - This is the underlying implementation of all of the /// ConstantDataSequential::get methods. They all thunk down to here, providing -/// the correct element type. We take the bytes in as an StringRef because +/// the correct element type. We take the bytes in as a StringRef because /// we *want* an underlying "char*" to avoid TBAA type punning violations. Constant *ConstantDataSequential::getImpl(StringRef Elements, Type *Ty) { assert(isElementTypeCompatible(Ty->getSequentialElementType())); |