LLVM API Documentation
#include <ArrayRef.h>

Public Types | |
| typedef const T * | iterator |
| typedef const T * | const_iterator |
| typedef size_t | size_type |
| typedef std::reverse_iterator < iterator > | reverse_iterator |
Public Member Functions | |
Constructors | |
| ArrayRef () | |
| Construct an empty ArrayRef. | |
| ArrayRef (NoneType) | |
| Construct an empty ArrayRef from None. | |
| ArrayRef (const T &OneElt) | |
| Construct an ArrayRef from a single element. | |
| ArrayRef (const T *data, size_t length) | |
| Construct an ArrayRef from a pointer and length. | |
| ArrayRef (const T *begin, const T *end) | |
| Construct an ArrayRef from a range. | |
| template<typename U > | |
| ArrayRef (const SmallVectorTemplateCommon< T, U > &Vec) | |
| template<typename A > | |
| ArrayRef (const std::vector< T, A > &Vec) | |
| Construct an ArrayRef from a std::vector. | |
| template<size_t N> | |
| ArrayRef (const T(&Arr)[N]) | |
| Construct an ArrayRef from a C array. | |
Simple Operations | |
| iterator | begin () const |
| iterator | end () const |
| reverse_iterator | rbegin () const |
| reverse_iterator | rend () const |
| bool | empty () const |
| empty - Check if the array is empty. | |
| const T * | data () const |
| size_t | size () const |
| size - Get the array size. | |
| const T & | front () const |
| front - Get the first element. | |
| const T & | back () const |
| back - Get the last element. | |
| bool | equals (ArrayRef RHS) const |
| equals - Check for element-wise equality. | |
| ArrayRef< T > | slice (unsigned N) const |
| slice(n) - Chop off the first N elements of the array. | |
| ArrayRef< T > | slice (unsigned N, unsigned M) const |
Operator Overloads | |
| const T & | operator[] (size_t Index) const |
Expensive Operations | |
| std::vector< T > | vec () const |
Conversion operators | |
| operator std::vector< T > () const | |
ArrayRef - Represent a constant reference to an array (0 or more elements 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 extends past that of the ArrayRef. For this reason, it is not in general safe to store an ArrayRef.
This is intended to be trivially copyable, so it should be passed by value.
Definition at line 31 of file ArrayRef.h.
| typedef const T* llvm::ArrayRef< T >::const_iterator |
Definition at line 34 of file ArrayRef.h.
| typedef const T* llvm::ArrayRef< T >::iterator |
Reimplemented in llvm::MutableArrayRef< T >.
Definition at line 33 of file ArrayRef.h.
| typedef std::reverse_iterator<iterator> llvm::ArrayRef< T >::reverse_iterator |
Definition at line 37 of file ArrayRef.h.
| typedef size_t llvm::ArrayRef< T >::size_type |
Definition at line 35 of file ArrayRef.h.
| llvm::ArrayRef< T >::ArrayRef | ( | ) | [inline] |
Construct an empty ArrayRef.
Definition at line 51 of file ArrayRef.h.
| llvm::ArrayRef< T >::ArrayRef | ( | NoneType | ) | [inline] |
Construct an empty ArrayRef from None.
Definition at line 54 of file ArrayRef.h.
| llvm::ArrayRef< T >::ArrayRef | ( | const T & | OneElt | ) | [inline] |
Construct an ArrayRef from a single element.
Definition at line 57 of file ArrayRef.h.
| llvm::ArrayRef< T >::ArrayRef | ( | const T * | data, |
| size_t | length | ||
| ) | [inline] |
Construct an ArrayRef from a pointer and length.
Definition at line 61 of file ArrayRef.h.
| llvm::ArrayRef< T >::ArrayRef | ( | const T * | begin, |
| const T * | end | ||
| ) | [inline] |
Construct an ArrayRef from a range.
Definition at line 65 of file ArrayRef.h.
| llvm::ArrayRef< T >::ArrayRef | ( | const SmallVectorTemplateCommon< T, U > & | Vec | ) | [inline] |
Construct an ArrayRef from a SmallVector. This is templated in order to avoid instantiating SmallVectorTemplateCommon<T> whenever we copy-construct an ArrayRef.
Definition at line 72 of file ArrayRef.h.
| llvm::ArrayRef< T >::ArrayRef | ( | const std::vector< T, A > & | Vec | ) | [inline] |
Construct an ArrayRef from a std::vector.
Definition at line 78 of file ArrayRef.h.
Construct an ArrayRef from a C array.
Definition at line 83 of file ArrayRef.h.
| const T& llvm::ArrayRef< T >::back | ( | ) | const [inline] |
back - Get the last element.
Reimplemented in llvm::MutableArrayRef< T >.
Definition at line 111 of file ArrayRef.h.
Referenced by llvm::ConstantFoldInstOperands().
| iterator llvm::ArrayRef< T >::begin | ( | ) | const [inline] |
Reimplemented in llvm::MutableArrayRef< T >.
Definition at line 90 of file ArrayRef.h.
Referenced by llvm::SpillPlacement::addConstraints(), llvm::SpillPlacement::addLinks(), llvm::SpillPlacement::addPrefSpill(), llvm::AllocationOrder::AllocationOrder(), buildExtractionBlockSet(), buildFixItLine(), BuildSubAggregate(), llvm::LiveIntervals::checkRegMaskInterference(), llvm::SchedDFSResult::compute(), llvm::ComputeLinearIndex(), llvm::ConstantArray::ConstantArray(), ConstantFoldGetElementPtrImpl(), llvm::ConstantStruct::ConstantStruct(), llvm::ConstantVector::ConstantVector(), containsReg(), llvm::DIBuilder::createComplexVariable(), llvm::discoverAndMapSubloop(), llvm::TargetLoweringObjectFileMachO::emitModuleFlags(), llvm::TargetLoweringObjectFileCOFF::emitModuleFlags(), llvm::FindInsertedValue(), llvm::gep_type_begin(), llvm::AttributeSetNode::get(), llvm::AttributeSet::get(), llvm::ConstantArray::get(), llvm::AnonStructTypeKeyInfo::getHashValue(), llvm::FunctionTypeKeyInfo::getHashValue(), llvm::ARMBaseRegisterInfo::getRegAllocationHints(), llvm::TargetRegisterInfo::getRegAllocationHints(), llvm::ScheduleDAGMI::initQueues(), isHorizontalBinOp(), LowerVECTOR_SHUFFLEv8i8(), ProfileBitsInit(), ProfileDagInit(), ProfileListInit(), ReadWideAPInt(), llvm::ArrayRef< HashDataContents * >::rend(), llvm::MachineModuleInfo::setCallSiteLandingPad(), llvm::PMTopLevelManager::setLastUser(), llvm::MachineInstr::setPhysRegsDeadExcept(), llvm::SimplifyCall(), llvm::SelectionDAG::TransferDbgValues(), and UpdateAnalysisInformation().
| const T* llvm::ArrayRef< T >::data | ( | ) | const [inline] |
Reimplemented in llvm::MutableArrayRef< T >.
Definition at line 99 of file ArrayRef.h.
Referenced by llvm::ConstantDataArray::get(), llvm::ConstantDataVector::get(), llvm::ConstantExpr::getGetElementPtr(), llvm::SelectionDAG::getMachineNode(), llvm::object::COFFObjectFile::getSectionContents(), llvm::object::MachOObjectFile::getSectionFinalSegmentName(), llvm::object::MachOObjectFile::getSectionName(), llvm::StructType::setBody(), llvm::ArrayRef< HashDataContents * >::slice(), and SymbolicallyEvaluateGEP().
| bool llvm::ArrayRef< T >::empty | ( | ) | const [inline] |
empty - Check if the array is empty.
Definition at line 97 of file ArrayRef.h.
Referenced by llvm::SpillPlacement::addLinks(), llvm::ArrayRef< HashDataContents * >::back(), llvm::MutableArrayRef< T >::back(), buildFixItLine(), llvm::ConstantFoldExtractValueInstruction(), ConstantFoldGetElementPtrImpl(), llvm::ConstantFoldInsertValueInstruction(), llvm::StructType::create(), llvm::FindInsertedValue(), llvm::ArrayRef< HashDataContents * >::front(), llvm::MutableArrayRef< T >::front(), llvm::AttributeSetNode::get(), llvm::AttributeSet::get(), llvm::ConstantArray::get(), llvm::ConstantStruct::get(), llvm::ConstantVector::get(), getIndexedTypeInternal(), llvm::Intrinsic::getName(), llvm::DIBuilder::getOrCreateArray(), llvm::Intrinsic::getType(), llvm::ConstantStruct::getTypeForElements(), isInBoundsIndices(), and llvm::PrintMessage().
| iterator llvm::ArrayRef< T >::end | ( | ) | const [inline] |
Reimplemented in llvm::MutableArrayRef< T >.
Definition at line 91 of file ArrayRef.h.
Referenced by llvm::SpillPlacement::addConstraints(), llvm::SpillPlacement::addLinks(), llvm::SpillPlacement::addPrefSpill(), llvm::AllocationOrder::AllocationOrder(), buildExtractionBlockSet(), buildFixItLine(), BuildSubAggregate(), llvm::LiveIntervals::checkRegMaskInterference(), llvm::SchedDFSResult::compute(), llvm::ComputeLinearIndex(), llvm::ConstantArray::ConstantArray(), ConstantFoldGetElementPtrImpl(), llvm::ConstantStruct::ConstantStruct(), llvm::ConstantVector::ConstantVector(), containsReg(), llvm::DIBuilder::createComplexVariable(), llvm::discoverAndMapSubloop(), llvm::TargetLoweringObjectFileMachO::emitModuleFlags(), llvm::TargetLoweringObjectFileCOFF::emitModuleFlags(), llvm::FindInsertedValue(), llvm::gep_type_end(), llvm::AttributeSetNode::get(), llvm::AttributeSet::get(), llvm::ConstantArray::get(), llvm::AnonStructTypeKeyInfo::getHashValue(), llvm::FunctionTypeKeyInfo::getHashValue(), llvm::ARMBaseRegisterInfo::getRegAllocationHints(), llvm::TargetRegisterInfo::getRegAllocationHints(), llvm::ScheduleDAGMI::initQueues(), isHorizontalBinOp(), LowerVECTOR_SHUFFLEv8i8(), ProfileBitsInit(), ProfileDagInit(), ProfileListInit(), llvm::ArrayRef< HashDataContents * >::rbegin(), ReadWideAPInt(), llvm::MachineModuleInfo::setCallSiteLandingPad(), llvm::PMTopLevelManager::setLastUser(), llvm::MachineInstr::setPhysRegsDeadExcept(), llvm::SimplifyCall(), llvm::SelectionDAG::TransferDbgValues(), and UpdateAnalysisInformation().
| bool llvm::ArrayRef< T >::equals | ( | ArrayRef< T > | RHS | ) | const [inline] |
equals - Check for element-wise equality.
Definition at line 117 of file ArrayRef.h.
Referenced by llvm::operator==().
| const T& llvm::ArrayRef< T >::front | ( | ) | const [inline] |
front - Get the first element.
Reimplemented in llvm::MutableArrayRef< T >.
Definition at line 105 of file ArrayRef.h.
Referenced by DecodeFixedType(), llvm::ConstantVector::get(), and llvm::PrintMessage().
| llvm::ArrayRef< T >::operator std::vector< T > | ( | ) | const [inline] |
Definition at line 157 of file ArrayRef.h.
| const T& llvm::ArrayRef< T >::operator[] | ( | size_t | Index | ) | const [inline] |
Reimplemented in llvm::MutableArrayRef< T >.
Definition at line 142 of file ArrayRef.h.
| reverse_iterator llvm::ArrayRef< T >::rbegin | ( | ) | const [inline] |
Definition at line 93 of file ArrayRef.h.
Referenced by llvm::ScheduleDAGMI::initQueues().
| reverse_iterator llvm::ArrayRef< T >::rend | ( | ) | const [inline] |
Definition at line 94 of file ArrayRef.h.
Referenced by llvm::ScheduleDAGMI::initQueues().
| size_t llvm::ArrayRef< T >::size | ( | ) | const [inline] |
size - Get the array size.
Definition at line 102 of file ArrayRef.h.
Referenced by llvm::MachineModuleInfo::addCatchTypeInfo(), llvm::MachineModuleInfo::addFilterTypeInfo(), llvm::RegPressureTracker::addLiveRegs(), llvm::MutableArrayRef< T >::back(), llvm::PBQPBuilder::build(), CastGEPIndices(), llvm::ComputeEditDistance(), computeExcessPressureDelta(), computeMaxPressureDelta(), llvm::ConstantArray::ConstantArray(), llvm::ConstantFoldCall(), ConstantFoldGetElementPtrImpl(), llvm::ConstantFoldInstOperands(), llvm::ConstantFoldLoadThroughGEPIndices(), llvm::ConstantStruct::ConstantStruct(), llvm::ConstantVector::ConstantVector(), ConvertToString(), llvm::GetElementPtrConstantExpr::Create(), llvm::ConstantArrayCreator< ConstantClass, TypeClass >::create(), llvm::GetElementPtrInst::Create(), llvm::CallInst::Create(), llvm::InvokeInst::Create(), llvm::MDBuilder::createBranchWeights(), llvm::IRBuilder< true, TargetFolder >::CreateGEP(), llvm::IRBuilder< true, TargetFolder >::CreateInBoundsGEP(), createPHIsForSplitLoopExit(), llvm::MDBuilder::createTBAAStructNode(), DecodeIITType(), llvm::RegPressureTracker::decreaseRegPressure(), llvm::LiveRangeEdit::eliminateDeadDefs(), llvm::MCDwarfFrameEmitter::Emit(), llvm::MutableArrayRef< T >::end(), llvm::DwarfDebug::endFunction(), llvm::LiveIntervals::extendToIndices(), llvm::FindInsertedValue(), FitWeights(), llvm::FunctionType::get(), llvm::AttributeSet::get(), llvm::ConstantArray::get(), llvm::ConstantStruct::get(), llvm::ConstantVector::get(), llvm::ConstantDataArray::get(), llvm::ConstantDataVector::get(), llvm::ConstantExpr::getGetElementPtr(), llvm::DataLayout::getIndexedOffset(), llvm::ExtractValueInst::getIndexedType(), getIndexedTypeInternal(), llvm::Intrinsic::getIntrinsicInfoTableEntries(), llvm::SelectionDAG::getMachineNode(), llvm::SourceMgr::GetMessage(), llvm::Intrinsic::getName(), llvm::SelectionDAG::getNode(), llvm::ARMBaseRegisterInfo::getRegAllocationHints(), llvm::MachineTraceMetrics::Trace::getResourceDepth(), llvm::MachineTraceMetrics::Trace::getResourceLength(), llvm::BoUpSLP::getScalarizationCost(), llvm::object::COFFObjectFile::getSectionContents(), llvm::MDNode::getTemporary(), llvm::BoUpSLP::getTreeCost(), llvm::ConstantStruct::getTypeForElements(), llvm::ConstantExpr::getWithOperands(), llvm::RegPressureTracker::increaseRegPressure(), isInBoundsIndices(), isReverseMask(), isVTBLMask(), llvm::AllocationOrder::next(), llvm::MutableArrayRef< T >::operator[](), llvm::PrintMessage(), ProcessSDDbgValues(), llvm::AttributeSetNode::Profile(), ProfileBitsInit(), ProfileListInit(), ReadWideAPInt(), llvm::LiveIntervals::repairIntervalsInRange(), llvm::StructType::setBody(), SimplifyGEPInst(), llvm::ArrayRef< HashDataContents * >::slice(), llvm::MutableArrayRef< T >::slice(), llvm::SplitBlockPredecessors(), llvm::SplitLandingPadPredecessors(), SymbolicallyEvaluateGEP(), UpdatePHINodes(), llvm::BoUpSLP::vectorizeArith(), llvm::BoUpSLP::vectorizeStores(), and llvm::BoUpSLP::vectorizeTree().
| ArrayRef<T> llvm::ArrayRef< T >::slice | ( | unsigned | N | ) | const [inline] |
slice(n) - Chop off the first N elements of the array.
Reimplemented in llvm::MutableArrayRef< T >.
Definition at line 127 of file ArrayRef.h.
Referenced by CastGEPIndices(), llvm::ConstantFoldExtractValueInstruction(), llvm::ConstantFoldInsertValueInstruction(), llvm::ConstantFoldInstOperands(), DecodeFixedType(), llvm::FindInsertedValue(), llvm::ConstantExpr::getAsInstruction(), llvm::ConstantExpr::getWithOperands(), and SimplifyGEPInst().
| ArrayRef<T> llvm::ArrayRef< T >::slice | ( | unsigned | N, |
| unsigned | M | ||
| ) | const [inline] |
slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array.
Reimplemented in llvm::MutableArrayRef< T >.
Definition at line 134 of file ArrayRef.h.
| std::vector<T> llvm::ArrayRef< T >::vec | ( | ) | const [inline] |
Definition at line 150 of file ArrayRef.h.