LLVM  7.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"

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 131 of file Optional.h.

Member Typedef Documentation

◆ value_type

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

Definition at line 135 of file Optional.h.

Constructor & Destructor Documentation

◆ Optional() [1/6]

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

Definition at line 137 of file Optional.h.

◆ Optional() [2/6]

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

Definition at line 138 of file Optional.h.

◆ Optional() [3/6]

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

Definition at line 140 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 143 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 159 of file Optional.h.

◆ emplace()

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

◆ getPointer() [1/2]

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

Definition at line 171 of file Optional.h.

◆ getPointer() [2/2]

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

Definition at line 175 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 180 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 183 of file Optional.h.

Referenced by llvm::DWARFAbbreviationDeclaration::AttributeSpec::AttributeSpec(), llvm::codeview::ContinuationRecordBuilder::begin(), llvm::slpvectorizer::BoUpSLP::canMapToVector(), cloneConstantExprWithNewAddressSpace(), llvm::pdb::PDBFileBuilder::commit(), computeKnownBitsFromShiftOperator(), llvm::DWARFFormValue::dump(), 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(), gatherUnrollingPreferences(), llvm::Attribute::getAsString(), GetDeoptBundleOperands(), llvm::getEffectiveRelocModel(), getEffectiveRelocModel(), llvm::BinaryStreamRefBase< WritableBinaryStreamRef, WritableBinaryStream >::getLength(), llvm::slpvectorizer::BoUpSLP::getORE(), getRangeForAffineARHelper(), GetRangeFromMetadata(), llvm::MCSchedModel::getReciprocalThroughput(), getRelocModel(), getSearchPaths(), llvm::MachineFunction::hasWinCFI(), IntersectSignedRange(), IntersectUnsignedRange(), isKnownNegativeInLoop(), llvm::codeview::CodeViewRecordIO::mapVectorTail(), llvm::codeview::CodeViewRecordIO::maxFieldLength(), llvm::MCDwarfDwoLineTable::maybeSetRootFile(), llvm::raw_ostream::operator<<(), llvm::operator==(), packAllocSizeArgs(), llvm::DWARFDebugFrame::parse(), llvm::LoopVectorizationPlanner::plan(), PushDefUseChildren(), reservePreviousStackSlotForValue(), llvm::IRCEPass::run(), llvm::MCDwarfLineTable::setRootFile(), 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 182 of file Optional.h.

◆ operator*() [1/2]

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

Definition at line 186 of file Optional.h.

◆ operator*() [2/2]

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

Definition at line 187 of file Optional.h.

◆ operator->() [1/2]

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

Definition at line 184 of file Optional.h.

◆ operator->() [2/2]

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

Definition at line 185 of file Optional.h.

◆ operator=() [1/4]

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

Definition at line 146 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 163 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 file: