LLVM  8.0.1
Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::Optional< T > Class Template Reference

#include "llvm/ADT/APInt.h"

Public Types

using value_type = T
 

Public Member Functions

constexpr Optional ()
 
constexpr Optional (NoneType)
 
 Optional (const T &y)
 
 Optional (const Optional &O)=default
 
 Optional (T &&y)
 
 Optional (Optional &&O)=default
 
Optionaloperator= (T &&y)
 
Optionaloperator= (Optional &&O)=default
 
template<typename... ArgTypes>
void emplace (ArgTypes &&... Args)
 Create a new object by constructing it in place with the given arguments. More...
 
Optionaloperator= (const T &y)
 
Optionaloperator= (const Optional &O)=default
 
void reset ()
 
const TgetPointer () const
 
TgetPointer ()
 
const TgetValue () const LLVM_LVALUE_FUNCTION
 
TgetValue () LLVM_LVALUE_FUNCTION
 
 operator bool () const
 
bool hasValue () const
 
const Toperator-> () const
 
Toperator-> ()
 
const Toperator* () const LLVM_LVALUE_FUNCTION
 
Toperator* () LLVM_LVALUE_FUNCTION
 
template<typename U >
constexpr T getValueOr (U &&value) const LLVM_LVALUE_FUNCTION
 

Static Public Member Functions

static Optional create (const T *y)
 

Detailed Description

template<typename T>
class llvm::Optional< T >

Definition at line 34 of file APInt.h.

Member Typedef Documentation

◆ value_type

template<typename T>
using llvm::Optional< T >::value_type = T

Definition at line 117 of file Optional.h.

Constructor & Destructor Documentation

◆ Optional() [1/6]

template<typename T>
constexpr llvm::Optional< T >::Optional ( )
inline

Definition at line 119 of file Optional.h.

◆ Optional() [2/6]

template<typename T>
constexpr llvm::Optional< T >::Optional ( NoneType  )
inline

Definition at line 120 of file Optional.h.

◆ Optional() [3/6]

template<typename T>
llvm::Optional< T >::Optional ( const T y)
inline

Definition at line 122 of file Optional.h.

◆ Optional() [4/6]

template<typename T>
llvm::Optional< T >::Optional ( const Optional< T > &  O)
default

◆ Optional() [5/6]

template<typename T>
llvm::Optional< T >::Optional ( T &&  y)
inline

Definition at line 125 of file Optional.h.

◆ Optional() [6/6]

template<typename T>
llvm::Optional< T >::Optional ( Optional< T > &&  O)
default

Member Function Documentation

◆ create()

template<typename T>
static Optional llvm::Optional< T >::create ( const T y)
inlinestatic

Definition at line 141 of file Optional.h.

◆ emplace()

template<typename T>
template<typename... ArgTypes>
void llvm::Optional< T >::emplace ( ArgTypes &&...  Args)
inline

Create a new object by constructing it in place with the given arguments.

Definition at line 135 of file Optional.h.

Referenced by FunctionNumber(), llvm::DIFile::ChecksumInfo< T >::getKindAsString(), llvm::ValueMap< const Function *, FuncInfo >::MD(), llvm::LegacyAARGetter::operator()(), and llvm::NamedMDNode::print().

◆ getPointer() [1/2]

template<typename T>
const T* llvm::Optional< T >::getPointer ( ) const
inline

◆ getPointer() [2/2]

template<typename T>
T* llvm::Optional< T >::getPointer ( )
inline

Definition at line 157 of file Optional.h.

◆ getValue() [1/2]

template<typename T>
const T& llvm::Optional< T >::getValue ( ) const
inline

Definition at line 161 of file Optional.h.

Referenced by llvm::vfs::YAMLVFSWriter::addFileMapping(), assertBranchOrSelectConditionHoisted(), llvm::VPlanSlp::buildGraph(), calculateOffsetDiff(), llvm::slpvectorizer::BoUpSLP::canMapToVector(), cloneConstantExprWithNewAddressSpace(), CloneLoopBlocks(), llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton(), llvm::DWARFFormValue::dump(), dumpAttribute(), llvm::InstructionSelector::executeMatchTable(), llvm::BitstreamWriter::ExitBlock(), llvm::sys::Process::FindInEnvPath(), llvm::ProfileSummaryInfo::getColdCountThreshold(), getComparePred(), getCopyFromPartsVector(), llvm::RegsForValue::getCopyFromRegs(), getCopyToPartsVector(), llvm::RegsForValue::getCopyToRegs(), GetDeoptBundleOperands(), llvm::MCSymbolWasm::getEventType(), llvm::SCEVExpander::getExactExistingExpansion(), llvm::MCSymbolWasm::getGlobalType(), llvm::ProfileSummaryInfo::getHotCountThreshold(), llvm::MCSymbolWasm::getImportModule(), llvm::MCSymbolWasm::getImportName(), llvm::ProfileSummaryInfo::getOrCompColdCountThreshold(), llvm::ProfileSummaryInfo::getOrCompHotCountThreshold(), llvm::slpvectorizer::BoUpSLP::getORE(), GetRangeFromMetadata(), llvm::MCSchedModel::getReciprocalThroughput(), llvm::ProfileSummaryInfo::hasHugeWorkingSetSize(), llvm::hasUnrollAndJamTransformation(), llvm::hasUnrollTransformation(), IntersectSignedRange(), IntersectUnsignedRange(), llvm::ProfileSummaryInfo::isColdCount(), llvm::ProfileSummaryInfo::isHotCount(), isObjectDereferencedInBlock(), llvm::raw_ostream::operator<<(), parseV5DirFileTables(), pickOpcodeForVT(), llvm::LoopVectorizationPlanner::plan(), llvm::MachineBasicBlock::print(), processAdd(), llvm::LoopVectorizePass::processLoop(), PushDefUseChildren(), llvm::RegsForValue::RegsForValue(), llvm::IRCEPass::run(), llvm::InlinerPass::run(), tryToUnrollAndJamLoop(), and tryToUnrollLoop().

◆ getValue() [2/2]

template<typename T>
T& llvm::Optional< T >::getValue ( )
inline

Definition at line 162 of file Optional.h.

◆ getValueOr()

template<typename T>
template<typename U >
constexpr T llvm::Optional< T >::getValueOr ( U &&  value) const
inline

◆ hasValue()

template<typename T>
bool llvm::Optional< T >::hasValue ( ) const
inline

Definition at line 165 of file Optional.h.

Referenced by llvm::vfs::YAMLVFSWriter::addFileMapping(), llvm::DIExpression::appendToStack(), llvm::DWARFAbbreviationDeclaration::AttributeSpec::AttributeSpec(), llvm::codeview::ContinuationRecordBuilder::begin(), llvm::slpvectorizer::BoUpSLP::canMapToVector(), cloneConstantExprWithNewAddressSpace(), CloneLoopBlocks(), collectContributionData(), llvm::pdb::PDBFileBuilder::commit(), computeKnownBitsFromShiftOperator(), llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton(), llvm::DWARFFormValue::dump(), llvm::MCObjectStreamer::EmitRelocDirective(), EvaluateConstantChrecAtConstant(), llvm::InstructionSelector::executeMatchTable(), llvm::sys::Process::FindInEnvPath(), findPreviousSpillSlot(), llvm::codeview::TypeCollection::ForEachRecord(), llvm::format_provider< T, typename std::enable_if< detail::use_double_formatter< T >::value >::type >::format(), llvm::gatherUnrollingPreferences(), llvm::Attribute::getAsString(), getCopyFromPartsVector(), getCopyToPartsVector(), GetDeoptBundleOperands(), llvm::getEffectiveRelocModel(), getEffectiveRelocModel(), llvm::MCSymbolWasm::getEventType(), llvm::MCSymbolWasm::getGlobalType(), llvm::MCSymbolWasm::getImportModule(), llvm::MCSymbolWasm::getImportName(), llvm::BinaryStreamRefBase< WritableBinaryStreamRef, WritableBinaryStream >::getLength(), llvm::slpvectorizer::BoUpSLP::getORE(), getRangeForAffineARHelper(), GetRangeFromMetadata(), llvm::MCSchedModel::getReciprocalThroughput(), getRelocModel(), getSearchPaths(), llvm::hasUnrollAndJamTransformation(), llvm::hasUnrollTransformation(), IntersectSignedRange(), IntersectUnsignedRange(), llvm::RegsForValue::isABIMangled(), isObjectDereferencedInBlock(), llvm::codeview::CodeViewRecordIO::mapVectorTail(), llvm::codeview::CodeViewRecordIO::maxFieldLength(), llvm::MCDwarfDwoLineTable::maybeSetRootFile(), MinOptional(), llvm::raw_ostream::operator<<(), llvm::operator==(), packAllocSizeArgs(), llvm::DWARFDebugFrame::parse(), llvm::LoopVectorizationPlanner::plan(), llvm::LoopVectorizePass::processLoop(), PushDefUseChildren(), reservePreviousStackSlotForValue(), llvm::IRCEPass::run(), llvm::LoopRotatePass::run(), llvm::LoopInstSimplifyPass::run(), llvm::LoopSimplifyCFGPass::run(), llvm::SimpleLoopUnswitchPass::run(), llvm::InlinerPass::run(), llvm::MCDwarfLineTable::setRootFile(), simplifyLoopInst(), SolveQuadraticAddRecExact(), SolveQuadraticAddRecRange(), TruncIfPossible(), tryToUnrollAndJamLoop(), tryToUnrollLoop(), llvm::codeview::SymbolSerializer::visitSymbolBegin(), llvm::codeview::SymbolSerializer::visitSymbolEnd(), and llvm::codeview::ContinuationRecordBuilder::writeMemberType().

◆ operator bool()

template<typename T>
llvm::Optional< T >::operator bool ( ) const
inlineexplicit

Definition at line 164 of file Optional.h.

◆ operator*() [1/2]

template<typename T>
const T& llvm::Optional< T >::operator* ( ) const
inline

Definition at line 168 of file Optional.h.

◆ operator*() [2/2]

template<typename T>
T& llvm::Optional< T >::operator* ( )
inline

Definition at line 169 of file Optional.h.

◆ operator->() [1/2]

template<typename T>
const T* llvm::Optional< T >::operator-> ( ) const
inline

Definition at line 166 of file Optional.h.

◆ operator->() [2/2]

template<typename T>
T* llvm::Optional< T >::operator-> ( )
inline

Definition at line 167 of file Optional.h.

◆ operator=() [1/4]

template<typename T>
Optional& llvm::Optional< T >::operator= ( T &&  y)
inline

Definition at line 128 of file Optional.h.

◆ operator=() [2/4]

template<typename T>
Optional& llvm::Optional< T >::operator= ( Optional< T > &&  O)
default

◆ operator=() [3/4]

template<typename T>
Optional& llvm::Optional< T >::operator= ( const T y)
inline

Definition at line 145 of file Optional.h.

◆ operator=() [4/4]

template<typename T>
Optional& llvm::Optional< T >::operator= ( const Optional< T > &  O)
default

◆ reset()

template<typename T>
void llvm::Optional< T >::reset ( )
inline

The documentation for this class was generated from the following files: