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

#include "llvm/ADT/Optional.h"

Inheritance diagram for llvm::Optional< T >:
Inheritance graph
[legend]

Public Types

using value_type = T
 

Public Member Functions

 Optional (NoneType)
 
 Optional ()
 
 Optional (const T &y)
 
 Optional (const Optional &O)
 
 Optional (T &&y)
 
 Optional (Optional< T > &&O)
 
 ~Optional ()
 
Optionaloperator= (T &&y)
 
Optionaloperator= (Optional &&O)
 
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)
 
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 31 of file Optional.h.

Member Typedef Documentation

◆ value_type

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

Definition at line 36 of file Optional.h.

Constructor & Destructor Documentation

◆ Optional() [1/6]

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

Definition at line 38 of file Optional.h.

◆ Optional() [2/6]

template<typename T>
llvm::Optional< T >::Optional ( )
inlineexplicit

Definition at line 39 of file Optional.h.

Referenced by llvm::Optional< uint64_t >::create().

◆ Optional() [3/6]

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

Definition at line 41 of file Optional.h.

◆ Optional() [4/6]

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

Definition at line 45 of file Optional.h.

◆ Optional() [5/6]

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

Definition at line 50 of file Optional.h.

◆ Optional() [6/6]

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

Definition at line 54 of file Optional.h.

◆ ~Optional()

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

Definition at line 61 of file Optional.h.

Member Function Documentation

◆ create()

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

Definition at line 93 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 87 of file Optional.h.

Referenced by llvm::pdb::NamedStreamMap::finalize(), llvm::ValueMap< GlobalValue *, uint64_t, Config >::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 128 of file Optional.h.

◆ getValue() [1/2]

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

◆ getValue() [2/2]

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

Definition at line 130 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 133 of file Optional.h.

Referenced by llvm::DWARFAbbreviationDeclaration::AttributeSpec::AttributeSpec(), llvm::buildModuleSummaryIndex(), llvm::slpvectorizer::BoUpSLP::canMapToVector(), cloneConstantExprWithNewAddressSpace(), llvm::pdb::NamedStreamMap::commit(), computeKnownBitsFromShiftOperator(), createSchedInfoStr(), llvm::DWARFFormValue::dump(), EvaluateConstantChrecAtConstant(), llvm::InstructionSelector::executeMatchTable(), llvm::CodeExtractor::extractCodeRegion(), llvm::pdb::NamedStreamMap::finalize(), llvm::sys::Process::FindInEnvPath(), findPreviousSpillSlot(), llvm::format_provider< T, typename std::enable_if< detail::use_double_formatter< T >::value >::type >::format(), gatherUnrollingPreferences(), llvm::Attribute::getAsString(), GetDeoptBundleOperands(), llvm::getEffectiveRelocModel(), getEffectiveRelocModel(), llvm::slpvectorizer::BoUpSLP::getORE(), getRangeForAffineARHelper(), GetRangeFromMetadata(), getRelocModel(), getRThroughputFromInstrSchedModel(), getRThroughputFromItineraries(), getSearchPaths(), llvm::Optional< uint64_t >::getValueOr(), llvm::MachineFunction::hasWinCFI(), llvm::codeview::TypeSerializer::insertRecord(), llvm::codeview::TypeSerializer::insertRecordBytes(), IntersectRange(), llvm::yaml::IO::mapOptionalWithContext(), llvm::codeview::CodeViewRecordIO::mapVectorTail(), llvm::codeview::CodeViewRecordIO::maxFieldLength(), llvm::raw_ostream::operator<<(), llvm::operator==(), packAllocSizeArgs(), llvm::DWARFDebugFrame::parse(), llvm::LoopVectorizationPlanner::plan(), reservePreviousStackSlotForValue(), llvm::JumpThreadingPass::run(), SumCanReachMin(), updateCalleeCount(), updateCallProfile(), updatePredecessorProfileMetadata(), llvm::codeview::TypeSerializer::visitMemberBegin(), llvm::codeview::SymbolSerializer::visitSymbolBegin(), llvm::codeview::SymbolSerializer::visitSymbolEnd(), llvm::codeview::TypeSerializer::visitTypeBegin(), llvm::codeview::TypeSerializer::visitTypeEndGetIndex(), and writeFunctionTypeMetadataRecords().

◆ operator bool()

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

Definition at line 132 of file Optional.h.

◆ operator*() [1/2]

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

Definition at line 136 of file Optional.h.

Referenced by llvm::Optional< uint64_t >::getValueOr().

◆ operator*() [2/2]

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

Definition at line 137 of file Optional.h.

◆ operator->() [1/2]

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

Definition at line 134 of file Optional.h.

◆ operator->() [2/2]

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

Definition at line 135 of file Optional.h.

◆ operator=() [1/4]

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

Definition at line 65 of file Optional.h.

◆ operator=() [2/4]

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

Definition at line 75 of file Optional.h.

◆ operator=() [3/4]

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

Definition at line 102 of file Optional.h.

◆ operator=() [4/4]

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

Definition at line 112 of file Optional.h.

◆ reset()

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

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