LLVM API Documentation
#include <Constants.h>
Public Member Functions | |
ArrayType * | getType () const |
Static Public Member Functions | |
static Constant * | get (LLVMContext &Context, ArrayRef< uint8_t > Elts) |
static Constant * | get (LLVMContext &Context, ArrayRef< uint16_t > Elts) |
static Constant * | get (LLVMContext &Context, ArrayRef< uint32_t > Elts) |
static Constant * | get (LLVMContext &Context, ArrayRef< uint64_t > Elts) |
static Constant * | get (LLVMContext &Context, ArrayRef< float > Elts) |
static Constant * | get (LLVMContext &Context, ArrayRef< double > Elts) |
static Constant * | getString (LLVMContext &Context, StringRef Initializer, bool AddNull=true) |
static bool | classof (const Value *V) |
Protected Member Functions | |
void * | operator new (size_t s) |
Friends | |
class | ConstantDataSequential |
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.
Definition at line 649 of file Constants.h.
static bool llvm::ConstantDataArray::classof | ( | const Value * | V | ) | [inline, static] |
Methods for support type inquiry through isa, cast, and dyn_cast:
Reimplemented from llvm::ConstantDataSequential.
Definition at line 690 of file Constants.h.
References llvm::Value::ConstantDataArrayVal, and llvm::Value::getValueID().
Constant * ConstantDataArray::get | ( | LLVMContext & | Context, |
ArrayRef< uint8_t > | Elts | ||
) | [static] |
get() constructors - Return a constant with array type with an element count and element type matching the ArrayRef passed in. Note that this can return a ConstantAggregateZero object.
Definition at line 2504 of file Constants.cpp.
References llvm::ArrayRef< T >::data(), llvm::ConstantDataSequential::getImpl(), llvm::Type::getInt8Ty(), and llvm::ArrayRef< T >::size().
Referenced by get().
Constant * ConstantDataArray::get | ( | LLVMContext & | Context, |
ArrayRef< uint16_t > | Elts | ||
) | [static] |
Definition at line 2509 of file Constants.cpp.
References llvm::ArrayRef< T >::data(), get(), llvm::ConstantDataSequential::getImpl(), llvm::Type::getInt16Ty(), and llvm::ArrayRef< T >::size().
Constant * ConstantDataArray::get | ( | LLVMContext & | Context, |
ArrayRef< uint32_t > | Elts | ||
) | [static] |
Definition at line 2514 of file Constants.cpp.
References llvm::ArrayRef< T >::data(), get(), llvm::ConstantDataSequential::getImpl(), llvm::Type::getInt32Ty(), and llvm::ArrayRef< T >::size().
Constant * ConstantDataArray::get | ( | LLVMContext & | Context, |
ArrayRef< uint64_t > | Elts | ||
) | [static] |
Definition at line 2519 of file Constants.cpp.
References llvm::ArrayRef< T >::data(), get(), llvm::ConstantDataSequential::getImpl(), llvm::Type::getInt64Ty(), and llvm::ArrayRef< T >::size().
Constant * ConstantDataArray::get | ( | LLVMContext & | Context, |
ArrayRef< float > | Elts | ||
) | [static] |
Definition at line 2524 of file Constants.cpp.
References llvm::ArrayRef< T >::data(), get(), llvm::Type::getFloatTy(), llvm::ConstantDataSequential::getImpl(), and llvm::ArrayRef< T >::size().
Constant * ConstantDataArray::get | ( | LLVMContext & | Context, |
ArrayRef< double > | Elts | ||
) | [static] |
Definition at line 2529 of file Constants.cpp.
References llvm::ArrayRef< T >::data(), get(), llvm::Type::getDoubleTy(), llvm::ConstantDataSequential::getImpl(), and llvm::ArrayRef< T >::size().
Constant * ConstantDataArray::getString | ( | LLVMContext & | Context, |
StringRef | Str, | ||
bool | AddNull = true |
||
) | [static] |
getString - This method constructs a CDS and initializes it with a text string. The default behavior (AddNull==true) causes a null terminator to be placed at the end of the array (increasing the length of the string by one more than the StringRef would normally indicate. Pass AddNull=false to disable this behavior.
Definition at line 2540 of file Constants.cpp.
References llvm::SmallVectorImpl< T >::append(), llvm::StringRef::begin(), llvm::StringRef::data(), llvm::StringRef::end(), llvm::makeArrayRef(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), and llvm::StringRef::size().
Referenced by llvm::IRBuilderBase::CreateGlobalString(), createPrivateGlobalForString(), createPrivateNonConstGlobalForString(), and LLVMConstStringInContext().
ArrayType* llvm::ConstantDataArray::getType | ( | ) | const [inline] |
getType - Specialize the getType() method to always return an ArrayType, which reduces the amount of casting needed in parts of the compiler.
Reimplemented from llvm::ConstantDataSequential.
Definition at line 684 of file Constants.h.
Referenced by llvm::getConstantStringInfo().
void* llvm::ConstantDataArray::operator new | ( | size_t | s | ) | [inline, protected] |
Reimplemented from llvm::ConstantDataSequential.
Definition at line 658 of file Constants.h.
References operator new().
friend class ConstantDataSequential [friend] |
Definition at line 653 of file Constants.h.