LLVM 17.0.0git
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
llvm::Error Class Reference

Lightweight error class with error context and mandatory checking. More...

#include "llvm/Support/Error.h"

Inheritance diagram for llvm::Error:
Inheritance graph
[legend]

Public Member Functions

 Error (const Error &Other)=delete
 
 Error (Error &&Other)
 Move-construct an error value.
 
 Error (std::unique_ptr< ErrorInfoBase > Payload)
 Create an error value.
 
Erroroperator= (const Error &Other)=delete
 
Erroroperator= (Error &&Other)
 Move-assign an error value.
 
 ~Error ()
 Destroy a Error.
 
 operator bool ()
 Bool conversion.
 
template<typename ErrT >
bool isA () const
 Check whether one error is a subclass of another.
 
const void * dynamicClassID () const
 Returns the dynamic class id of this error, or null if this is a success value.
 

Static Public Member Functions

static ErrorSuccess success ()
 Create a success value.
 

Protected Member Functions

 Error ()
 Create a success value. Prefer using 'Error::success()' for readability.
 

Friends

class ErrorList
 
template<typename T >
class Expected
 
template<typename... HandlerTs>
Error handleErrors (Error E, HandlerTs &&... Handlers)
 Pass the ErrorInfo(s) contained in E to their respective handlers.
 
LLVMErrorRef wrap (Error)
 Conversion from Error to LLVMErrorRef for C error bindings.
 
raw_ostreamoperator<< (raw_ostream &OS, const Error &E)
 

Detailed Description

Lightweight error class with error context and mandatory checking.

Instances of this class wrap a ErrorInfoBase pointer. Failure states are represented by setting the pointer to a ErrorInfoBase subclass instance containing information describing the failure. Success is represented by a null pointer value.

Instances of Error also contains a 'Checked' flag, which must be set before the destructor is called, otherwise the destructor will trigger a runtime error. This enforces at runtime the requirement that all Error instances be checked or returned to the caller.

There are two ways to set the checked flag, depending on what state the Error instance is in. For Error instances indicating success, it is sufficient to invoke the boolean conversion operator. E.g.:

Error foo(<...>);
if (auto E = foo(<...>))
return E; // <- Return E if it is in the error state.
// We have verified that E was in the success state. It can now be safely
// destroyed.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Lightweight error class with error context and mandatory checking.
Definition: Error.h:156

A success value can not be dropped. For example, just calling 'foo(<...>)' without testing the return value will raise a runtime error, even if foo returns success.

For Error instances representing failure, you must use either the handleErrors or handleAllErrors function with a typed handler. E.g.:

class MyErrorInfo : public ErrorInfo<MyErrorInfo> {
// Custom error info.
};
Error foo(<...>) { return make_error<MyErrorInfo>(...); }
auto E = foo(<...>); // <- foo returns failure with MyErrorInfo.
auto NewE =
[](const MyErrorInfo &M) {
// Deal with the error.
},
[](std::unique_ptr<OtherError> M) -> Error {
if (canHandle(*M)) {
// handle error.
return Error::success();
}
// Couldn't handle this error instance. Pass it up the stack.
return Error(std::move(M));
);
// Note - we must check or return NewE in case any of the handlers
// returned a new error.
Base class for user error types.
Definition: Error.h:348
friend Error handleErrors(Error E, HandlerTs &&... Handlers)
Pass the ErrorInfo(s) contained in E to their respective handlers.
Definition: Error.h:943
static ErrorSuccess success()
Create a success value.
Definition: Error.h:330
Error()
Create a success value. Prefer using 'Error::success()' for readability.
Definition: Error.h:175

The handleAllErrors function is identical to handleErrors, except that it has a void return type, and requires all errors to be handled and no new errors be returned. It prevents errors (assuming they can all be handled) from having to be bubbled all the way to the top-level.

All Error instances must be checked before destruction, even if they're moved-assigned or constructed from Success values that have already been checked. This enforces checking through all levels of the call stack.

Definition at line 156 of file Error.h.

Constructor & Destructor Documentation

◆ Error() [1/4]

llvm::Error::Error ( )
inlineprotected

Create a success value. Prefer using 'Error::success()' for readability.

Definition at line 175 of file Error.h.

◆ Error() [2/4]

llvm::Error::Error ( const Error Other)
delete

◆ Error() [3/4]

llvm::Error::Error ( Error &&  Other)
inline

Move-construct an error value.

The newly constructed error is considered unchecked, even if the source error had been checked. The original error becomes a checked Success value, regardless of its original state.

Definition at line 190 of file Error.h.

References Other.

◆ Error() [4/4]

llvm::Error::Error ( std::unique_ptr< ErrorInfoBase Payload)
inline

Create an error value.

Prefer using the 'make_error' function, but this constructor can be useful when "re-throwing" errors from handlers.

Definition at line 197 of file Error.h.

◆ ~Error()

llvm::Error::~Error ( )
inline

Destroy a Error.

Fails with a call to abort() if the error is unchecked.

Definition at line 226 of file Error.h.

References getPtr().

Referenced by llvm::JITSymbol::~JITSymbol().

Member Function Documentation

◆ dynamicClassID()

const void * llvm::Error::dynamicClassID ( ) const
inline

Returns the dynamic class id of this error, or null if this is a success value.

Definition at line 246 of file Error.h.

References getPtr().

◆ isA()

template<typename ErrT >
bool llvm::Error::isA ( ) const
inline

Check whether one error is a subclass of another.

Definition at line 240 of file Error.h.

References getPtr().

◆ operator bool()

llvm::Error::operator bool ( )
inlineexplicit

Bool conversion.

Returns true if this Error is in a failure state, and false if it is in an accept state. If the error is in a Success state it will be considered checked.

Definition at line 234 of file Error.h.

References getPtr().

◆ operator=() [1/2]

Error & llvm::Error::operator= ( const Error Other)
delete

◆ operator=() [2/2]

Error & llvm::Error::operator= ( Error &&  Other)
inline

Move-assign an error value.

The current error must represent success, you you cannot overwrite an unhandled error. The current error is then considered unchecked. The source error becomes a checked success value, regardless of its original state.

Definition at line 209 of file Error.h.

References Other.

◆ success()

ErrorSuccess llvm::Error::success ( )
inlinestatic

Create a success value.

Definition at line 330 of file Error.h.

Referenced by llvm::jitlink::InProcessMemoryManager::IPInFlightAlloc::abandon(), llvm::OverlapStats::accumulateCounts(), llvm::lto::LTO::add(), llvm::xray::Profile::addBlock(), llvm::jitlink::BlockAddressMap::addBlock(), llvm::jitlink::BlockAddressMap::addBlocks(), llvm::CodeGenPassBuilder< DerivedT >::addCoreISelPasses(), llvm::pdb::DbiStreamBuilder::addDbgStream(), llvm::InstrProfSymtab::addFuncName(), llvm::orc::addFunctionPointerRelocationsToCurrentSymbol(), llvm::objcopy::coff::addGnuDebugLink(), llvm::CodeGenPassBuilder< DerivedT >::addMachinePasses(), llvm::objcopy::NameMatcher::addMatcher(), llvm::pdb::DbiStreamBuilder::addModuleSourceFile(), llvm::pdb::PDBFileBuilder::addNamedStream(), llvm::objcopy::elf::Object::addNewSymbolTable(), llvm::CodeGenPassBuilder< DerivedT >::addRegAssignmentFast(), llvm::CodeGenPassBuilder< DerivedT >::addRegAssignmentOptimized(), llvm::lto::Config::addSaveTemps(), addSection(), advanceToMetaBlock(), llvm::BitcodeAnalyzer::analyze(), appendFile(), llvm::jitlink::BasicLayout::apply(), llvm::ErrorHandlerTraits< void(&)(ErrT &)>::apply(), llvm::ErrorHandlerTraits< void(&)(std::unique_ptr< ErrT >)>::apply(), llvm::FilePermissionsApplier::apply(), llvm::orc::LLJIT::applyDataLayout(), llvm::jitlink::aarch64::applyFixup(), llvm::jitlink::loongarch::applyFixup(), llvm::jitlink::i386::applyFixup(), llvm::jitlink::x86_64::applyFixup(), llvm::object::Archive::Archive(), llvm::BitcodeReaderValueList::assignValue(), llvm::lto::backend(), llvm::codeview::CodeViewRecordIO::beginRecord(), llvm::object::BigArchive::BigArchive(), llvm::CodeGenPassBuilder< DerivedT >::buildPipeline(), llvm::jitlink::buildTables_MachO_arm64(), llvm::orc::shared::WrapperFunction< SPSRetTagT(SPSTagTs...)>::callAsync(), llvm::DWARFContext::checkAddressSizeSupported(), checkChars(), llvm::FileCheckString::CheckDag(), checkDyldCommand(), checkDyldInfoCommand(), checkDylibCommand(), checkDylibIdCommand(), checkDysymtabCommand(), checkEncryptCommand(), llvm::gsym::Header::checkForError(), checkHashHdrVersion(), checkLinkeditDataCommand(), checkLinkerOptCommand(), checkNoteCommand(), llvm::object::Binary::checkOffset(), llvm::BinaryStream::checkOffsetForRead(), llvm::BinaryStreamRefBase< RefType, StreamType >::checkOffsetForRead(), llvm::WritableBinaryStream::checkOffsetForWrite(), checkOperandCount(), checkOverlappingElement(), checkRecord(), checkRpathCommand(), checkSubCommand(), llvm::object::MachOObjectFile::checkSymbolTable(), checkSymtabCommand(), checkThreadCommand(), checkTwoLevelHintsCommand(), checkVersCommand(), llvm::orc::JITDylib::clear(), llvm::collectPGOFuncNameStrings(), llvm::pdb::ModuleDebugStreamRef::commit(), llvm::pdb::SymbolStream::commit(), llvm::pdb::TpiStream::commit(), llvm::MutableBinaryByteStream::commit(), llvm::AppendingBinaryByteStream::commit(), llvm::pdb::DbiModuleDescriptorBuilder::commit(), llvm::pdb::GSIHashStreamBuilder::commit(), llvm::pdb::HashTable< ValueT >::commit(), llvm::pdb::NamedStreamMap::commit(), llvm::pdb::PDBStringTableBuilder::commit(), llvm::codeview::DebugChecksumsSubsection::commit(), llvm::codeview::DebugCrossModuleExportsSubsection::commit(), llvm::codeview::DebugCrossModuleImportsSubsection::commit(), llvm::codeview::DebugFrameDataSubsection::commit(), llvm::codeview::DebugInlineeLinesSubsection::commit(), llvm::codeview::DebugLinesSubsection::commit(), llvm::codeview::DebugStringTableSubsection::commit(), llvm::codeview::DebugSymbolsSubsection::commit(), llvm::codeview::DebugSubsectionRecordBuilder::commit(), llvm::pdb::GSIStreamBuilder::commit(), llvm::pdb::TpiStreamBuilder::commit(), llvm::pdb::InfoStreamBuilder::commit(), llvm::pdb::DbiStreamBuilder::commit(), llvm::pdb::DbiModuleDescriptorBuilder::commitSymbolStream(), llvm::RuntimeDyldImpl::computeTotalAllocSize(), llvm::codeview::consume(), llvm::xray::LogBuilderConsumer::consume(), llvm::xray::PipelineConsumer::consume(), llvm::codeview::consume_numeric(), llvm::gsym::ObjectFileTransformer::convert(), llvm::gsym::DwarfTransformer::convert(), llvm::orc::LLJITBuilderSetters< JITType, SetterImpl, State >::create(), llvm::object::Slice::create(), llvm::object::XCOFFTracebackTable::create(), llvm::orc::LocalJITCompileCallbackManager< ORCABI >::Create(), llvm::orc::COFFPlatform::Create(), llvm::orc::ELFNixPlatform::Create(), llvm::orc::MachOPlatform::Create(), llvm::object::MachOObjectFile::create(), llvm::coverage::BinaryCoverageReader::create(), llvm::object::Archive::create(), llvm::object::MachOUniversalBinary::create(), llvm::object::TapiUniversal::create(), llvm::orc::StaticLibraryDefinitionGenerator::Create(), llvm::orc::LocalTrampolinePool< ORCABI >::Create(), llvm::InstrProfSymtab::create(), llvm::object::TBVectorExt::create(), llvm::jitlink::createEHFrameRecorderPass(), llvm::pdb::DIASession::createFromExe(), llvm::pdb::NativeSession::createFromExe(), llvm::pdb::NativeSession::createFromPdb(), llvm::pdb::DIASession::createFromPdb(), llvm::pdb::NativeSession::createFromPdbPath(), llvm::logicalview::LVBinaryReader::createInstructions(), llvm::objcopy::createNewArchiveMembers(), llvm::logicalview::LVReader::createScopes(), llvm::logicalview::LVELFReader::createScopes(), llvm::logicalview::LVSplitContext::createSplitFolder(), llvm::orc::LocalIndirectStubsManager< TargetT >::createStub(), llvm::orc::LocalIndirectStubsManager< TargetT >::createStubs(), llvm::object::ObjectFile::createWasmObjectFile(), llvm::orc::rt_bootstrap::SimpleExecutorMemoryManager::deallocate(), llvm::jitlink::InProcessMemoryManager::deallocate(), llvm::orc::MapperJITLinkMemoryManager::deallocate(), llvm::object::ELFFile< ELFT >::decodeBBAddrMap(), llvm::objcopy::deepWriteArchive(), llvm::orc::JITDylib::define(), llvm::FileCheckPatternContext::defineCmdlineVariables(), llvm::orc::InProcessMemoryMapper::deinitialize(), llvm::orc::rt_bootstrap::ExecutorSharedMemoryMapperService::deinitialize(), llvm::orc::deregisterFrameWrapper(), llvm::codeview::serialize_conditional_impl< T, U >::deserialize(), llvm::codeview::serialize_vector_tail_impl< T >::deserialize(), llvm::orc::shared::detail::ResultDeserializer< SPSError, Error >::deserialize(), llvm::orc::shared::detail::ResultDeserializer< SPSExpected< SPSTagT >, Expected< T > >::deserialize(), llvm::orc::shared::detail::ResultDeserializer< SPSRetTagT, RetT >::deserialize(), llvm::codeview::SymbolDeserializer::deserializeAs(), llvm::codeview::TypeDeserializer::deserializeAs(), llvm::orc::UnsupportedExecutorProcessControl::disconnect(), llvm::orc::SelfExecutorProcessControl::disconnect(), doList(), llvm::logicalview::LVReader::doLoad(), llvm::logicalview::LVReader::doPrint(), llvm::logicalview::LVObject::doPrint(), llvm::logicalview::LVScope::doPrint(), llvm::logicalview::LVScopeRoot::doPrintMatches(), llvm::DWARFContext::dump(), dumpSectionToFile(), llvm::objcopy::wasm::dumpSectionToFile(), llvm::InstrProfCorrelatorImpl< IntPtrT >::dumpYaml(), llvm::RuntimeDyldImpl::emitCommonSymbols(), llvm::DWARFYAML::emitDebugAbbrev(), llvm::DWARFYAML::emitDebugAddr(), llvm::DWARFYAML::emitDebugAranges(), llvm::DWARFYAML::emitDebugInfo(), llvm::DWARFYAML::emitDebugLine(), llvm::DWARFYAML::emitDebugRanges(), emitDebugSectionImpl(), llvm::DWARFYAML::emitDebugSections(), llvm::DWARFYAML::emitDebugStr(), llvm::DWARFYAML::emitDebugStrOffsets(), llvm::lto::ThinBackendProc::emitFiles(), emitPubSection(), llvm::gsym::Header::encode(), llvm::gsym::InlineInfo::encode(), llvm::gsym::LineTable::encode(), llvm::codeview::CodeViewRecordIO::endRecord(), llvm::orc::ExecutionSession::endSession(), llvm::BitstreamCursor::EnterSubBlock(), llvm::remarks::YAMLRemarkParser::error(), llvm::InstrProfReader::error(), llvm::BinaryOperation::eval(), llvm::logicalview::LVCompare::execute(), llvm::objcopy::coff::executeObjcopyOnBinary(), llvm::objcopy::elf::executeObjcopyOnBinary(), llvm::objcopy::wasm::executeObjcopyOnBinary(), llvm::objcopy::xcoff::executeObjcopyOnBinary(), llvm::objcopy::macho::executeObjcopyOnMachOUniversalBinary(), llvm::cl::ExpansionContext::expandResponseFiles(), llvm::DWARFDebugNames::NameIndex::extract(), llvm::AppleAcceleratorTable::extract(), llvm::DWARFDebugNames::extract(), llvm::DWARFDebugRangeList::extract(), llvm::DWARFUnitHeader::extract(), llvm::DWARFDebugArangeSet::extract(), llvm::RangeListEntry::extract(), llvm::DWARFListTableHeader::extract(), llvm::DWARFListTableBase< DWARFListType >::extract(), llvm::DWARFListType< ListEntryType >::extract(), llvm::object::extractOffloadBinaries(), llvm::DWARFDebugAddrTable::extractV5(), llvm::DWARFFormValue::extractValue(), llvm::SimpleBitstreamCursor::fillCurWord(), llvm::ifs::filterIFSSyms(), llvm::objcopy::elf::ELFWriter< ELFT >::finalize(), llvm::objcopy::elf::BinaryWriter::finalize(), llvm::objcopy::elf::IHexWriter::finalize(), llvm::orc::rt_bootstrap::SimpleExecutorMemoryManager::finalize(), llvm::RuntimeDyldImpl::finalizeAsync(), llvm::RuntimeDyldCOFFX86_64::finalizeLoad(), llvm::RuntimeDyldELF::finalizeLoad(), llvm::RuntimeDyldMachOCRTPBase< Impl >::finalizeLoad(), llvm::RuntimeDyldImpl::finalizeLoad(), llvm::orc::EPCGenericRTDyldMemoryManager::finalizeMemory(), llvm::pdb::DbiModuleDescriptorBuilder::finalizeMsfLayout(), llvm::pdb::DbiStreamBuilder::finalizeMsfLayout(), llvm::pdb::GSIStreamBuilder::finalizeMsfLayout(), llvm::pdb::InfoStreamBuilder::finalizeMsfLayout(), llvm::pdb::TpiStreamBuilder::finalizeMsfLayout(), llvm::lto::finalizeOptimizationRemarks(), llvm::RuntimeDyldMachOAArch64::finalizeSection(), llvm::RuntimeDyldMachOARM::finalizeSection(), llvm::RuntimeDyldMachOI386::finalizeSection(), llvm::RuntimeDyldMachOX86_64::finalizeSection(), llvm::DWARFUnit::findLoclistFromOffset(), finishVisitation(), llvm::xray::BlockIndexer::flush(), llvm::xray::TraceExpander::flush(), llvm::codeview::forEachCodeViewRecord(), llvm::jitlink::ELFLinkGraphBuilder< ELFT >::forEachRelaRelocation(), llvm::jitlink::COFFLinkGraphBuilder::forEachRelocation(), llvm::jitlink::ELFLinkGraphBuilder< ELFT >::forEachRelRelocation(), llvm::orc::SymbolLookupSet::forEachWithRemoval(), llvm::CodeViewYAML::detail::UnknownSymbolRecord::fromCodeViewSymbol(), llvm::orc::shared::detail::fromSPSSerializable(), getAddrSpace(), llvm::object::COFFObjectFile::getAuxSymbol(), llvm::orc::ExecutorProcessControl::getBootstrapSymbols(), llvm::object::ELFObjectFile< ELFT >::getBuildAttributes(), llvm::object::COFFObjectFile::getDebugPDBInfo(), llvm::object::DelayImportDirectoryEntryRef::getDelayImportTable(), llvm::object::ExportDirectoryEntryRef::getDllName(), llvm::InstrProfReader::getError(), llvm::object::ExportDirectoryEntryRef::getExportRVA(), getExtensionVersion(), llvm::object::ExportDirectoryEntryRef::getForwardTo(), llvm::coverage::CovMapFunctionRecordV1< IntPtrT >::getFuncName(), llvm::coverage::accessors::getFuncNameViaRef(), llvm::object::COFFObjectFile::getHintName(), llvm::object::ImportedSymbolRef::getHintNameRVA(), llvm::BinaryOperation::getImplicitFormat(), llvm::object::DelayImportDirectoryEntryRef::getImportAddress(), llvm::object::ImportDirectoryEntryRef::getImportAddressTableRVA(), llvm::object::ImportDirectoryEntryRef::getImportLookupTableRVA(), getInt(), getIntInBytes(), llvm::object::Archive::Symbol::getMember(), llvm::object::ImportDirectoryEntryRef::getName(), llvm::object::DelayImportDirectoryEntryRef::getName(), llvm::object::Archive::Child::getNext(), getObject(), llvm::getOffset(), llvm::object::ImportedSymbolRef::getOrdinal(), llvm::object::ExportDirectoryEntryRef::getOrdinal(), llvm::object::ExportDirectoryEntryRef::getOrdinalBase(), llvm::InstrProfReaderIndex< HashTableImpl >::getRecords(), llvm::InstrProfReaderItaniumRemapper< HashTableImpl >::getRecords(), llvm::object::BaseRelocRef::getRVA(), llvm::object::COFFObjectFile::getRvaAndSizeAsBytes(), llvm::object::COFFObjectFile::getRvaPtr(), llvm::object::COFFObjectFile::getSectionContents(), llvm::object::ExportDirectoryEntryRef::getSymbolName(), llvm::object::ImportedSymbolRef::getSymbolName(), llvm::object::BaseRelocRef::getType(), llvm::jitlink::COFFLinkGraphBuilder::graphifySections(), llvm::jitlink::ELFLinkGraphBuilder< ELFT >::graphifySections(), llvm::jitlink::COFFLinkGraphBuilder::graphifySymbols(), llvm::jitlink::ELFLinkGraphBuilder< ELFT >::graphifySymbols(), llvm::objcopy::coff::handleArgs(), handleArgs(), llvm::objcopy::wasm::handleArgs(), llvm::objcopy::xcoff::handleArgs(), handleCompressedSection(), handleMaybeNoDataFoundError(), llvm::handleSection(), hasInvalidBitcodeHeader(), ignoreStrippedErrors(), llvm::object::Archive::ChildFallibleIterator::inc(), llvm::object::Binary::initContent(), llvm::object::ELFObjectFile< ELFT >::initContent(), llvm::codeview::DebugChecksumsSubsectionRef::initialize(), llvm::codeview::DebugFrameDataSubsectionRef::initialize(), llvm::codeview::DebugInlineeLinesSubsectionRef::initialize(), llvm::codeview::DebugLinesSubsectionRef::initialize(), llvm::codeview::DebugStringTableSubsectionRef::initialize(), llvm::pdb::DbiModuleList::initialize(), llvm::pdb::DbiModuleDescriptor::initialize(), llvm::codeview::DebugSubsectionRecord::initialize(), llvm::objcopy::elf::SectionBase::initialize(), llvm::objcopy::elf::Section::initialize(), llvm::objcopy::elf::SectionIndexSection::initialize(), llvm::objcopy::elf::SymbolTableSection::initialize(), llvm::objcopy::elf::RelocSectionWithSymtabBase< SymTabType >::initialize(), llvm::pdb::PDBFileBuilder::initialize(), llvm::orc::COFFVCRuntimeBootstrapper::initializeStaticVCRuntime(), initRelocations(), llvm::objcopy::elf::BasicELFBuilder::initSections(), llvm::ELFAttributeParser::integerAttribute(), llvm::interpretDecimal(), llvm::object::ExportDirectoryEntryRef::isForwarder(), llvm::object::isNotObjectErrorInvalidFileType(), llvm::object::ImportedSymbolRef::isOrdinal(), isValidMachOCannonicalName(), llvm::pdb::iterateModuleSubsections(), llvm::pdb::iterateSymbolGroups(), llvm::SimpleBitstreamCursor::JumpToBit(), llvm::sys::fs::TempFile::keep(), llvm::DWARFLinker::link(), llvm::remarks::RemarkLinker::link(), llvm_orc_registerJITLoaderGDBAllocAction(), llvm_orc_registerJITLoaderGDBWrapper(), llvm::pdb::HashTable< ValueT >::load(), llvm::object::ResourceSectionRef::load(), LoadDIA(), llvm::logicalview::LVBinaryReader::loadGenericTargetInfo(), loadObj(), loadSectionContribs(), loadYAML(), llvm::localCache(), llvm::gsym::InlineInfo::lookup(), llvm::orc::ExecutionSession::lookup(), llvm::orc::lookupAndRecordAddrs(), llvm::orc::ExecutionSession::lookupFlags(), llvm::orc::Platform::lookupInitSymbols(), llvm::object::MachOUniversalBinary::MachOUniversalBinary(), llvm::orc::shared::detail::ResultDeserializer< SPSError, Error >::makeValue(), llvm::codeview::CodeViewRecordIO::mapByteVectorTail(), llvm::codeview::CodeViewRecordIO::mapEncodedInteger(), llvm::codeview::CodeViewRecordIO::mapEnum(), llvm::codeview::CodeViewRecordIO::mapGuid(), llvm::codeview::CodeViewRecordIO::mapInteger(), mapLocalVariableAddrRange(), mapNameAndUniqueName(), llvm::codeview::CodeViewRecordIO::mapObject(), llvm::codeview::CodeViewRecordIO::mapStringZ(), llvm::codeview::CodeViewRecordIO::mapStringZVectorZ(), llvm::codeview::CodeViewRecordIO::mapVectorN(), llvm::codeview::CodeViewRecordIO::mapVectorTail(), llvm::jitlink::markAllSymbolsLive(), llvm::objcopy::coff::Object::markSymbols(), llvm::Pattern::match(), llvm::Module::materialize(), llvm::Module::materializeAll(), llvm::Module::materializeMetadata(), llvm::InstrProfWriter::mergeProfileKind(), llvm::jitlink::JITLinkContext::modifyPassConfig(), llvm::orc::ObjectLinkingLayerJITLinkContext::modifyPassConfig(), llvm::orc::DebugObjectManagerPlugin::modifyPassConfig(), llvm::object::ResourceEntryRef::moveNext(), llvm::orc::COFFPlatform::notifyAdding(), llvm::orc::ELFNixPlatform::notifyAdding(), llvm::orc::MachOPlatform::notifyAdding(), llvm::orc::ObjectLinkingLayer::Plugin::notifyEmitted(), llvm::orc::DebugObjectManagerPlugin::notifyEmitted(), llvm::orc::EHFrameRegistrationPlugin::notifyEmitted(), llvm::orc::GDBJITDebugInfoRegistrationPlugin::notifyFailed(), llvm::orc::DebugObjectManagerPlugin::notifyFailed(), llvm::orc::EHFrameRegistrationPlugin::notifyFailed(), llvm::orc::GDBJITDebugInfoRegistrationPlugin::notifyRemovingResources(), llvm::orc::DebugObjectManagerPlugin::notifyRemovingResources(), llvm::orc::EHFrameRegistrationPlugin::notifyRemovingResources(), llvm::orc::LazyCallThroughManager::notifyResolved(), llvm::orc::ObjectLinkingLayerJITLinkContext::notifyResolved(), llvm::VarStreamArrayExtractor< codeview::CVRecord< Kind > >::operator()(), llvm::codeview::LineColumnExtractor::operator()(), llvm::VarStreamArrayExtractor< T >::operator()(), llvm::VarStreamArrayExtractor< codeview::DebugSubsectionRecord >::operator()(), llvm::VarStreamArrayExtractor< pdb::DbiModuleDescriptor >::operator()(), llvm::jitlink::DWARFRecordSectionSplitter::operator()(), llvm::jitlink::DefineExternalSectionStartAndEndSymbols< SymbolIdentifierFunction >::operator()(), llvm::jitlink::EHFrameEdgeFixer::operator()(), llvm::jitlink::EHFrameNullTerminator::operator()(), llvm::jitlink::CompactUnwindSplitter::operator()(), llvm::jitlink::SEHFrameKeepAlivePass::operator()(), llvm::jitlink::i386::optimizeGOTAndStubAccesses(), llvm::jitlink::x86_64::optimizeGOTAndStubAccesses(), llvm::ifs::overrideIFSTarget(), llvm::BinaryStreamWriter::padToAlignment(), llvm::parallelForEachError(), parse(), llvm::DWARFDebugLine::LineTable::parse(), llvm::DWARFDebugFrame::parse(), llvm::DWARFDebugLine::Prologue::parse(), llvm::object::DirectX::PSVRuntimeInfo::parse(), llvm::object::WindowsResourceParser::parse(), llvm::PassBuilder::parseAAPipeline(), llvm::ELFAttributeParser::parseAttributeList(), parseBlock(), llvm::remarks::BitstreamParserHelper::parseBlockInfoBlock(), parseBuildVersionCommand(), llvm::pdb::PDBFile::parseFileHeaders(), llvm::parseInfoSectionUnitHeader(), llvm::MetadataLoader::MetadataLoaderImpl::parseMetadata(), llvm::MetadataLoader::MetadataLoaderImpl::parseMetadataAttachment(), llvm::MetadataLoader::MetadataLoaderImpl::parseMetadataKinds(), llvm::PassBuilder::parsePassPipeline(), parseRecord(), llvm::MCSectionMachO::ParseSectionSpecifier(), parseSegmentLoadCommand(), llvm::pdb::PDBFile::parseStreamData(), llvm::ELFAttributeParser::parseStringAttribute(), llvm::ELFAttributeParser::parseSubsection(), parseV2DirFileTables(), parseV5DirFileTables(), parseV5EntryFormat(), llvm::ifs::populateDynamic(), llvm::RuntimeDyldMachO::populateIndirectSymbolPointersSection(), llvm::InstrProfReaderRemapper::populateRemappings(), llvm::InstrProfReaderItaniumRemapper< HashTableImpl >::populateRemappings(), llvm::ifs::populateSymbols(), llvm::jitlink::ELFLinkGraphBuilder< ELFT >::prepare(), llvm::orc::LLJITBuilderState::prepareForConstruction(), llvm::orc::LLLazyJITBuilderState::prepareForConstruction(), printBinaryIdsInternal(), llvm::logicalview::LVReader::printScopes(), llvm::object::TapiFile::printSymbolName(), llvm::object::COFFImportFile::printSymbolName(), llvm::object::IRObjectFile::printSymbolName(), llvm::object::ObjectFile::printSymbolName(), llvm::logicalview::LVReaderHandler::process(), processLoadCommands(), processRemarkVersion(), processStrTab(), llvm::coverage::RawCoverageMappingReader::read(), llvm::pdb::GSIHashTable::read(), llvm::SymbolRemappingReader::read(), llvm::BitstreamCursor::ReadAbbrevRecord(), llvm::BinaryStreamReader::readArray(), readBinaryIdsInternal(), llvm::BinaryStreamReader::readBytes(), llvm::msf::MappedBlockStream::readBytes(), llvm::BinaryByteStream::readBytes(), llvm::AppendingBinaryByteStream::readBytes(), llvm::BinaryItemStream< T, Traits >::readBytes(), readCoverageMappingData(), llvm::BinaryStreamReader::readCString(), llvm::BinaryStreamReader::readEnum(), llvm::BinaryStreamReader::readFixedString(), readGSIHashBuckets(), readGSIHashHeader(), readGSIHashRecords(), readInitExpr(), readInteger(), llvm::BinaryStreamReader::readInteger(), llvm::coverage::RawCoverageReader::readIntMax(), llvm::BinaryStreamReader::readLongestContiguousChunk(), llvm::BinaryStreamRef::readLongestContiguousChunk(), llvm::msf::MappedBlockStream::readLongestContiguousChunk(), llvm::BinaryByteStream::readLongestContiguousChunk(), llvm::AppendingBinaryByteStream::readLongestContiguousChunk(), llvm::BinaryItemStream< T, Traits >::readLongestContiguousChunk(), llvm::sys::fs::readNativeFileToEOF(), llvm::coverage::BinaryCoverageReader::readNextRecord(), llvm::memprof::RawMemProfReader::readNextRecord(), llvm::BinaryStreamReader::readObject(), llvm::readPGOFuncNameStrings(), readSection(), ReadSignature(), llvm::coverage::RawCoverageReader::readSize(), llvm::BinaryStreamReader::readSLEB128(), llvm::pdb::readSparseBitVector(), llvm::BinaryStreamReader::readStreamRef(), llvm::coverage::RawCoverageReader::readString(), llvm::object::readStringOrId(), readStruct(), llvm::BinaryStreamReader::readULEB128(), llvm::coverage::RawCoverageReader::readULEB128(), llvm::BinaryStreamReader::readWideString(), llvm::orc::ELFDebugObject::recordSection(), llvm::orc::registerFrameWrapper(), llvm::orc::ExecutionSession::registerJITDispatchHandlers(), llvm::orc::InProcessMemoryMapper::release(), llvm::orc::SharedMemoryMapper::release(), llvm::orc::rt_bootstrap::ExecutorSharedMemoryMapperService::release(), llvm::pdb::GlobalsStream::reload(), llvm::pdb::InfoStream::reload(), llvm::pdb::ModuleDebugStreamRef::reload(), llvm::pdb::PublicsStream::reload(), llvm::pdb::SymbolStream::reload(), llvm::pdb::TpiStream::reload(), llvm::pdb::PDBStringTable::reload(), llvm::pdb::InjectedSourceStream::reload(), llvm::pdb::DbiStream::reload(), llvm::objcopy::macho::Object::removeLoadCommands(), llvm::objcopy::elf::SectionBase::removeSectionReferences(), llvm::objcopy::elf::Section::removeSectionReferences(), llvm::objcopy::elf::RelocationSection::removeSectionReferences(), llvm::objcopy::elf::GroupSection::removeSectionReferences(), llvm::objcopy::elf::DynamicRelocationSection::removeSectionReferences(), llvm::objcopy::elf::Object::removeSections(), llvm::objcopy::macho::Object::removeSections(), llvm::objcopy::elf::SectionBase::removeSymbols(), llvm::objcopy::elf::Object::removeSymbols(), llvm::objcopy::elf::SymbolTableSection::removeSymbols(), llvm::objcopy::elf::RelocationSection::removeSymbols(), llvm::objcopy::elf::GroupSection::removeSymbols(), llvm::objcopy::coff::Object::removeSymbols(), removeUnneededSections(), replaceAndRemoveSections(), llvm::objcopy::elf::Object::replaceSections(), llvm::ErrorReported::reportedOrSuccess(), llvm::RuntimeDyldImpl::resolveExternalSymbols(), llvm::orc::CtorDtorRunner::run(), llvm::jitlink::PerGraphGOTAndPLTStubsBuilder< BuilderImplT >::run(), llvm::MachineFunctionPassManager::run(), llvm::orc::shared::runDeallocActions(), llvm::orc::shared::WrapperFunctionCall::runWithSPSRet(), llvm::orc::FDSimpleRemoteEPCTransport::sendMessage(), llvm::remarks::RemarkLinker::serialize(), llvm::msf::MSFBuilder::setBlockMapAddr(), llvm::msf::MSFBuilder::setDirectoryBlocksHint(), llvm::remarks::RemarkStreamer::setFilter(), llvm::msf::MSFBuilder::setStreamSize(), llvm::DWARFLinker::setTargetDWARFVersion(), llvm::orc::setUpInactivePlatform(), llvm::orc::COFFPlatform::setupJITDylib(), llvm::setupLLVMOptimizationRemarks(), llvm::orc::setUpOrcPlatform(), llvm::orc::rt_bootstrap::ExecutorSharedMemoryMapperService::shutdown(), llvm::orc::rt_bootstrap::SimpleExecutorDylibManager::shutdown(), llvm::orc::rt_bootstrap::SimpleExecutorMemoryManager::shutdown(), llvm::BinaryStreamReader::skip(), llvm::BitstreamCursor::SkipBlock(), llvm::codeview::CodeViewRecordIO::skipPadding(), split(), llvm::orc::FDSimpleRemoteEPCTransport::start(), llvm::ELFAttributeParser::stringAttribute(), llvm::JITSymbol::takeError(), llvm::SoftInstrProfErrors::takeError(), llvm::orc::COFFPlatform::teardownJITDylib(), llvm::orc::ELFNixPlatform::teardownJITDylib(), llvm::orc::MachOPlatform::teardownJITDylib(), llvm::timeTraceProfilerWrite(), llvm::DWARFUnit::tryExtractDIEsIfNeeded(), llvm::orc::ReexportsGenerator::tryToGenerate(), llvm::orc::EPCDynamicLibrarySearchGenerator::tryToGenerate(), llvm::orc::DynamicLibrarySearchGenerator::tryToGenerate(), llvm::orc::StaticLibraryDefinitionGenerator::tryToGenerate(), llvm::DebuginfodCollection::update(), updateAndRemoveSymbols(), llvm::orc::LocalIndirectStubsManager< TargetT >::updatePointer(), updateSection(), llvm::objcopy::elf::Object::updateSection(), llvm::StackMapParser< Endianness >::validateHeader(), llvm::ifs::validateIFSTarget(), llvm::orc::ELFDebugObjectSection< ELFT >::validateInBounds(), validateMagicNumber(), llvm::InstrProfWriter::validateRecord(), llvm::msf::validateSuperBlock(), llvm::GISelCSEInfo::verify(), llvm::xray::BlockVerifier::verify(), llvm::InlineAsm::verify(), llvm::gsym::DwarfTransformer::verify(), llvm::xray::BlockIndexer::visit(), llvm::xray::RecordInitializer::visit(), llvm::xray::TraceExpander::visit(), llvm::xray::RecordPrinter::visit(), llvm::objcopy::elf::ELFSectionWriter< ELFT >::visit(), llvm::objcopy::elf::IHexSectionWriterBase::visit(), llvm::objcopy::elf::SectionWriter::visit(), llvm::objcopy::elf::IHexSectionWriter::visit(), llvm::xray::FDRTraceWriter::visit(), llvm::objcopy::elf::ELFSectionSizer< ELFT >::visit(), llvm::codeview::detail::visitDebugSubsections(), visitKnownMember(), visitKnownRecord(), llvm::DWARFDebugLoc::visitLocationList(), llvm::DWARFDebugLoclists::visitLocationList(), llvm::codeview::TypeVisitorCallbacks::visitMemberBegin(), llvm::codeview::TypeDumpVisitor::visitMemberBegin(), llvm::codeview::TypeRecordMapping::visitMemberBegin(), llvm::codeview::TypeVisitorCallbackPipeline::visitMemberBegin(), llvm::codeview::TypeVisitorCallbacks::visitMemberEnd(), llvm::codeview::FieldListDeserializer::visitMemberEnd(), llvm::codeview::TypeDumpVisitor::visitMemberEnd(), llvm::codeview::TypeRecordMapping::visitMemberEnd(), llvm::codeview::TypeVisitorCallbackPipeline::visitMemberEnd(), visitMemberRecord(), llvm::codeview::SymbolRecordMapping::visitSymbolBegin(), llvm::codeview::SymbolSerializer::visitSymbolBegin(), llvm::codeview::SymbolVisitorCallbacks::visitSymbolBegin(), llvm::codeview::SymbolVisitorCallbackPipeline::visitSymbolBegin(), llvm::codeview::SymbolVisitorCallbacks::visitSymbolEnd(), llvm::codeview::SymbolRecordMapping::visitSymbolEnd(), llvm::codeview::SymbolSerializer::visitSymbolEnd(), llvm::codeview::SymbolVisitorCallbackPipeline::visitSymbolEnd(), llvm::codeview::CVSymbolVisitor::visitSymbolStream(), llvm::codeview::CVSymbolVisitor::visitSymbolStreamFiltered(), llvm::codeview::TypeVisitorCallbacks::visitTypeBegin(), llvm::codeview::TypeRecordMapping::visitTypeBegin(), llvm::codeview::TypeVisitorCallbackPipeline::visitTypeBegin(), llvm::codeview::TypeDumpVisitor::visitTypeBegin(), llvm::codeview::TypeVisitorCallbacks::visitTypeEnd(), llvm::codeview::TypeDumpVisitor::visitTypeEnd(), llvm::codeview::TypeRecordMapping::visitTypeEnd(), llvm::codeview::TypeVisitorCallbackPipeline::visitTypeEnd(), llvm::codeview::DebugSubsectionVisitor::visitUnknown(), llvm::codeview::TypeVisitorCallbacks::visitUnknownMember(), llvm::codeview::TypeDumpVisitor::visitUnknownMember(), llvm::codeview::TypeVisitorCallbackPipeline::visitUnknownMember(), llvm::codeview::SymbolVisitorCallbacks::visitUnknownSymbol(), llvm::codeview::SymbolVisitorCallbackPipeline::visitUnknownSymbol(), llvm::codeview::TypeVisitorCallbackPipeline::visitUnknownType(), llvm::codeview::TypeVisitorCallbacks::visitUnknownType(), llvm::codeview::TypeDumpVisitor::visitUnknownType(), llvm::orc::ResourceTracker::withResourceKeyDo(), llvm::objcopy::macho::MachOWriter::write(), llvm::objcopy::wasm::Writer::write(), llvm::objcopy::xcoff::XCOFFWriter::write(), llvm::objcopy::elf::ELFWriter< ELFT >::write(), llvm::objcopy::elf::BinaryWriter::write(), llvm::objcopy::elf::IHexWriter::write(), llvm::write(), llvm::writeArchiveToStream(), llvm::BinaryStreamWriter::writeArray(), llvm::BinaryStreamWriter::writeBytes(), llvm::msf::WritableMappedBlockStream::writeBytes(), llvm::MutableBinaryByteStream::writeBytes(), llvm::AppendingBinaryByteStream::writeBytes(), llvm::BinaryStreamWriter::writeCString(), writeDWARFLists(), llvm::ifs::writeELFBinaryToFile(), llvm::writeFileAtomically(), llvm::ifs::writeIFSToOutputStream(), writeListEntry(), writeListEntryAddress(), writePublics(), llvm::pdb::writeSparseBitVector(), llvm::BinaryStreamWriter::writeStreamRef(), llvm::InstrProfWriter::writeText(), llvm::MachO::TextAPIWriter::writeToStream(), llvm::object::writeUniversalBinaryToStream(), writeVariableSizedInteger(), llvm::object::writeWindowsResourceCOFF(), llvm::orc::EPCGenericRTDyldMemoryManager::~EPCGenericRTDyldMemoryManager(), and llvm::ErrorAsOutParameter::~ErrorAsOutParameter().

Friends And Related Function Documentation

◆ ErrorList

friend class ErrorList
friend

Definition at line 160 of file Error.h.

◆ Expected

template<typename T >
friend class Expected
friend

Definition at line 168 of file Error.h.

◆ handleErrors

template<typename... HandlerTs>
Error handleErrors ( Error  E,
HandlerTs &&...  Handlers 
)
friend

Pass the ErrorInfo(s) contained in E to their respective handlers.

Any unhandled errors (or Errors returned by handlers) are re-concatenated and returned. Because this function returns an error, its result must also be checked or returned. If you intend to handle all errors use handleAllErrors (which returns void, and will abort() on unhandled errors) instead.

Definition at line 943 of file Error.h.

◆ operator<<

raw_ostream & operator<< ( raw_ostream OS,
const Error E 
)
friend

Definition at line 314 of file Error.h.

◆ wrap

LLVMErrorRef wrap ( Error  Err)
friend

Conversion from Error to LLVMErrorRef for C error bindings.

Definition at line 1401 of file Error.h.


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