[#llvm-Error] = xref:llvm.adoc[llvm]::Error :relfileprefix: ../ :mrdocs: Lightweight error class with error context and mandatory checking. == Synopsis Declared in `<llvm/Support/Error.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class [[nodiscard]] Error; ---- == Description 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.: [,cpp] ---- 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. ---- 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.: [,cpp] ---- class MyErrorInfo : public ErrorInfo { // Custom error info. }; Error foo(<...>) { return make_error(...); } auto E = foo(<...>); // <- foo returns failure with MyErrorInfo. auto NewE = handleErrors(std::move(E), [](const MyErrorInfo &M) { // Deal with the error. }, [](std::unique_ptr 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 - The error passed to handleErrors will be marked as checked. If // there is no matched handler, a new error with the same payload is // created and returned. // The handlers take the error checked by handleErrors as an argument, // which can be used to retrieve more information. If a new error is // created by a handler, it will be passed back to the caller of // handleErrors and needs to be checked or return up to the stack. // Otherwise, the passed-in error is considered consumed. ---- 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. == Member Functions [cols="1,4"] |=== | Name| Description | xref:llvm/Error/2constructor-06.adoc[`Error`] [.small]#[constructor]# | Constructors | xref:llvm/Error/2destructor.adoc[`~Error`] [.small]#[destructor]# | Destroy a Error. Fails with a call to abort() if the error is unchecked. | xref:llvm/Error/operator_assign-08.adoc[`operator=`] | Assignment operators | xref:llvm/Error/dynamicClassID.adoc[`dynamicClassID`] | Returns the dynamic class id of this error, or null if this is a success value. | xref:llvm/Error/isA.adoc[`isA`] | Check whether one error is a subclass of another. | xref:llvm/Error/2conversion.adoc[`operator bool`] | Return true if this Error holds a failure value. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:llvm/Error/success.adoc[`success`] | Create a success value. |=== == Protected Member Functions [cols="1,4"] |=== | Name| Description | xref:llvm/Error/2constructor-0d.adoc[`Error`] [.small]#[constructor]# | Create a success value. Prefer using 'Error::success()' for readability |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:llvm/operator_lshift-0c4a.adoc[llvm::operator<<]` | Write a textual representation of error `E` to stream `OS.` | `xref:llvm/wrap-00d.adoc[llvm::wrap]` | Conversion from Error to LLVMErrorRef for C error bindings. | `xref:llvm/Expected.adoc[llvm::Expected]` | Tagged union holding either a T or a Error. | `xref:llvm/visitErrors.adoc[llvm::visitErrors]` | Visit all the ErrorInfo(s) contained in E by passing them to the respective handler, without consuming the error. | `xref:llvm/handleErrors.adoc[llvm::handleErrors]` | Pass ErrorInfo payloads in `E` to matching handlers among `Handlers.` | `xref:llvm/ErrorList.adoc[llvm::ErrorList]` | Special ErrorInfo subclass representing a list of ErrorInfos. Instances of this class are constructed by joinError. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:llvm/EmitImportsFiles.adoc[`EmitImportsFiles`] | Emit into `OutputFilename` the files module `ModulePath` will import from. | xref:llvm/cantFail-07.adoc[`cantFail`] | Report a fatal error if Err is a failure value. | xref:llvm/collectGlobalObjectNameStrings.adoc[`collectGlobalObjectNameStrings`] | Serialize global‐object name strings into a profile‐ready blob. | xref:llvm/collectPGOFuncNameStrings.adoc[`collectPGOFuncNameStrings`] | Serialize referenced PGO function‐name variables into `Result.` | xref:llvm/collectVTableStrings.adoc[`collectVTableStrings`] | Serialize vtable name strings into a profile‐ready blob. | xref:llvm/consumeError.adoc[`consumeError`] | Consume a Error without doing anything. This method should be used only where an error can be considered a reasonable and expected return value. | xref:llvm/createCtxProfFromYAML.adoc[`createCtxProfFromYAML`] | Convert a YAML contextual profile in `Profile` into bitstream form on `Out.` | xref:llvm/createFileError-002.adoc[`createFileError`] | Create a StringError with the specified error code and prepend the file path to it. | xref:llvm/createFileError-00a.adoc[`createFileError`] | Concatenate a source file path and/or name with line number and std::error_code to form an Error object. | xref:llvm/createFileError-010.adoc[`createFileError`] | Deleted overload: a successful Error cannot be wrapped as a FileError. | xref:llvm/createFileError-01a.adoc[`createFileError`] | Concatenate a source file path and/or name with a std::error_code to form an Error object. | xref:llvm/createFileError-08.adoc[`createFileError`] | Create a StringError with the specified error code and prepend the file path to it. | xref:llvm/createFileError-0b.adoc[`createFileError`] | Concatenate a source file path and/or name with an Error. The resulting Error is unchecked. | xref:llvm/createFileError-0c.adoc[`createFileError`] | Concatenate a source file path and/or name with line number and an Error. The resulting Error is unchecked. | xref:llvm/createStringError-02.adoc[`createStringError`] | Create a StringError from error code `EC` and message `Msg.` | xref:llvm/createStringError-03.adoc[`createStringError`] | Create a StringError with an inconvertible error code and printf‐style `Fmt.` | xref:llvm/createStringError-04.adoc[`createStringError`] | Create a StringError from `std::errc` `EC` and printf‐style `Fmt.` | xref:llvm/createStringError-06.adoc[`createStringError`] | Create a StringError from error code `EC` and Twine message `S.` | xref:llvm/createStringError-0c.adoc[`createStringError`] | Create a StringError with an inconvertible error code. | xref:llvm/createStringError-0e.adoc[`createStringError`] | Create a StringError from error code `EC` and message `S.` | xref:llvm/createStringError-0f.adoc[`createStringError`] | Create formatted StringError object. | xref:llvm/createStringErrorV-06.adoc[`createStringErrorV`] | Create a StringError from error code `EC` and formatv‐style `Fmt.` | xref:llvm/createStringErrorV-0c.adoc[`createStringErrorV`] | Create a StringError with an inconvertible error code and formatv‐style `Fmt.` | xref:llvm/decodeBase64.adoc[`decodeBase64`] | Decode a Base64 string into raw bytes. | xref:llvm/errorCodeToError.adoc[`errorCodeToError`] | Helper for converting an std::error_code to a Error. | xref:llvm/errorToBool.adoc[`errorToBool`] | Helper for converting an Error to a bool. | xref:llvm/errorToErrorCode.adoc[`errorToErrorCode`] | Helper for converting an ECError to a std::error_code. | xref:llvm/fmt_consume.adoc[`fmt_consume`] | Wrap an Error so formatv takes ownership and consumes it. | xref:llvm/handleAllErrors-0e4.adoc[`handleAllErrors`] | Like handleErrors, but requires every error to be handled. | xref:llvm/handleAllErrors-0ee.adoc[`handleAllErrors`] | Check that E is a non‐error, then drop it. If E is an error, llvm_unreachable will be called. | xref:llvm/handleErrorImpl-02.adoc[`handleErrorImpl`] | Return an Error wrapping unhandled `Payload.` | xref:llvm/handleErrorImpl-03.adoc[`handleErrorImpl`] | Dispatch `Payload` to the first matching handler among `Handler` and `Handlers.` | xref:llvm/joinErrors.adoc[`joinErrors`] | Concatenate errors from `E1` followed by those from `E2.` | xref:llvm/logAllUnhandledErrors.adoc[`logAllUnhandledErrors`] | Log all errors in `E` to `OS,` optionally prefixed by `ErrorBanner.` | xref:llvm/make_error.adoc[`make_error`] | Make a Error instance representing failure using the given error info type. | xref:llvm/parallelForEachError.adoc[`parallelForEachError`] | Apply `Fn` to each element of `R` in parallel and join any returned Errors. | xref:llvm/readAndDecodeStrings.adoc[`readAndDecodeStrings`] | Decode concatenated PGO name strings and invoke a callback for each name. | xref:llvm/readModuleSummaryIndex.adoc[`readModuleSummaryIndex`] | Parse the specified bitcode buffer and merge the index into CombinedIndex. | xref:llvm/reportFatalInternalError-0e.adoc[`reportFatalInternalError`] | Report a fatal error that indicates a bug in LLVM. See ErrorHandling.h for details. | xref:llvm/reportFatalUsageError-08.adoc[`reportFatalUsageError`] | Report a fatal error that does not indicate a bug in LLVM. See ErrorHandling.h for details. | xref:llvm/report_fatal_error-0b7.adoc[`report_fatal_error`] | Report a fatal error from an Error value. | xref:llvm/setupLLVMOptimizationRemarks-0d.adoc[`setupLLVMOptimizationRemarks`] | Set up optimization remarks that output directly to a raw_ostream. | xref:llvm/splitModuleTransitiveFromEntryPoints.adoc[`splitModuleTransitiveFromEntryPoints`] | Splits a module into parts by transitive reachability from entry points. | xref:llvm/timeTraceProfilerWrite-08.adoc[`timeTraceProfilerWrite`] | Write profiling data to a file. | xref:llvm/toString-0f.adoc[`toString`] | Write all error messages (if any) in E to a string. The newline character is used to separate error messages. | xref:llvm/toStringWithoutConsuming.adoc[`toStringWithoutConsuming`] | Like toString(), but does not consume the error. This can be used to print a warning while retaining the original error object. | xref:llvm/unwrap-0ff.adoc[`unwrap`] | Conversion from LLVMErrorRef to Error for C error bindings. | xref:llvm/warnToStderr.adoc[`warnToStderr`] | Log `Err` to stderr as a warning. | xref:llvm/write.adoc[`write`] | Merge split DWARF inputs into `Out,` optionally writing the package. | xref:llvm/writeArchive.adoc[`writeArchive`] | Write an archive to the file named `ArcName.` | xref:llvm/writeArchiveToStream.adoc[`writeArchiveToStream`] | Write an archive directly to an output stream. | xref:llvm/writeMemProf.adoc[`writeMemProf`] | Write MemProf profile data to `OS` in the requested indexed format version. | xref:llvm/writeToOutput.adoc[`writeToOutput`] | Create an output stream for `OutputFileName` and pass it to `Write.` | xref:llvm/DWARFYAML/emitDebugAbbrev.adoc[`DWARFYAML::emitDebugAbbrev`] | Emit the .debug_abbrev section described by `DI` to `OS.` | xref:llvm/DWARFYAML/emitDebugAddr.adoc[`DWARFYAML::emitDebugAddr`] | Emit the .debug_addr section described by `DI` to `OS.` | xref:llvm/DWARFYAML/emitDebugAranges.adoc[`DWARFYAML::emitDebugAranges`] | Emit the .debug_aranges section described by `DI` to `OS.` | xref:llvm/DWARFYAML/emitDebugGNUPubnames.adoc[`DWARFYAML::emitDebugGNUPubnames`] | Emit the .debug_gnu_pubnames section described by `DI` to `OS.` | xref:llvm/DWARFYAML/emitDebugGNUPubtypes.adoc[`DWARFYAML::emitDebugGNUPubtypes`] | Emit the .debug_gnu_pubtypes section described by `DI` to `OS.` | xref:llvm/DWARFYAML/emitDebugInfo.adoc[`DWARFYAML::emitDebugInfo`] | Emit the .debug_info section described by `DI` to `OS.` | xref:llvm/DWARFYAML/emitDebugLine.adoc[`DWARFYAML::emitDebugLine`] | Emit the .debug_line section described by `DI` to `OS.` | xref:llvm/DWARFYAML/emitDebugLoclists.adoc[`DWARFYAML::emitDebugLoclists`] | Emit the .debug_loclists section described by `DI` to `OS.` | xref:llvm/DWARFYAML/emitDebugNames.adoc[`DWARFYAML::emitDebugNames`] | Emit the .debug_names section described by `DI` to `OS.` | xref:llvm/DWARFYAML/emitDebugPubnames.adoc[`DWARFYAML::emitDebugPubnames`] | Emit the .debug_pubnames section described by `DI` to `OS.` | xref:llvm/DWARFYAML/emitDebugPubtypes.adoc[`DWARFYAML::emitDebugPubtypes`] | Emit the .debug_pubtypes section described by `DI` to `OS.` | xref:llvm/DWARFYAML/emitDebugRanges.adoc[`DWARFYAML::emitDebugRanges`] | Emit the .debug_ranges section described by `DI` to `OS.` | xref:llvm/DWARFYAML/emitDebugRnglists.adoc[`DWARFYAML::emitDebugRnglists`] | Emit the .debug_rnglists section described by `DI` to `OS.` | xref:llvm/DWARFYAML/emitDebugStr.adoc[`DWARFYAML::emitDebugStr`] | Emit the .debug_str section described by `DI` to `OS.` | xref:llvm/DWARFYAML/emitDebugStrOffsets.adoc[`DWARFYAML::emitDebugStrOffsets`] | Emit the .debug_str_offsets section described by `DI` to `OS.` | xref:llvm/DWARFYAML/getDWARFEmitterByName.adoc[`DWARFYAML::getDWARFEmitterByName`] | Return the emitter for the DWARF section named `SecName.` | xref:llvm/RISCV/parseTuneFeatureString.adoc[`RISCV::parseTuneFeatureString`] | Parse the tune feature string with the respective processor. If `ProcName` is empty, directives are not filtered by processor. | xref:llvm/cgdata/warn-0f.adoc[`cgdata::warn`] | Report a codegen‐data warning derived from error `E.` | xref:llvm/codeview/consume-02.adoc[`codeview::consume`] | Decode a numeric leaf value from a string buffer into `Num.` | xref:llvm/codeview/consume-036.adoc[`codeview::consume`] | Consume a vector‐tail serialization helper from `Reader.` | xref:llvm/codeview/consume-03c.adoc[`codeview::consume`] | Decode a numeric leaf value from the type stream into `Num.` | xref:llvm/codeview/consume-04.adoc[`codeview::consume`] | Decode a null‐terminated string. | xref:llvm/codeview/consume-073.adoc[`codeview::consume`] | Decode an unsigned fixed‐length 32‐bit integer. | xref:llvm/codeview/consume-07c.adoc[`codeview::consume`] | Decode a signed fixed‐length 32‐bit integer. | xref:llvm/codeview/consume-082.adoc[`codeview::consume`] | Decode an unsigned 32‐bit integer from a string buffer. | xref:llvm/codeview/consume-084.adoc[`codeview::consume`] | No‐op consume that always succeeds; base case for variadic consume. | xref:llvm/codeview/consume-091.adoc[`codeview::consume`] | Consume an arrayref‐tail serialization helper from `Reader.` | xref:llvm/codeview/consume-09d.adoc[`codeview::consume`] | Consume an array serialization helper from `Reader.` | xref:llvm/codeview/consume-0a3.adoc[`codeview::consume`] | Consume a numeric serialization helper from `Reader.` | xref:llvm/codeview/consume-0af.adoc[`codeview::consume`] | Consume a conditional serialization helper from `Reader.` | xref:llvm/codeview/consume-0b.adoc[`codeview::consume`] | Decode an object whose layout matches the underlying byte sequence. | xref:llvm/codeview/consume-0c.adoc[`codeview::consume`] | Consume a null‐terminated string‐array helper from `Reader.` | xref:llvm/codeview/consume-0e.adoc[`codeview::consume`] | Consume multiple fields from `Reader` in order. | xref:llvm/codeview/consume_numeric.adoc[`codeview::consume_numeric`] | Decode a numeric leaf value that is known to be a particular type. | xref:llvm/codeview/forEachCodeViewRecord.adoc[`codeview::forEachCodeViewRecord`] | Invoke `F` for each contiguous CodeView record in `StreamBuffer.` | xref:llvm/codeview/mergeIdRecords-06.adoc[`codeview::mergeIdRecords`] | Merge one set of id records into another. | xref:llvm/codeview/mergeIdRecords-0f.adoc[`codeview::mergeIdRecords`] | Merge one set of id records into a global id table. | xref:llvm/codeview/mergeTypeAndIdRecords-08.adoc[`codeview::mergeTypeAndIdRecords`] | Merge a unified set of type and id records into global tables, splitting them into separate output streams. | xref:llvm/codeview/mergeTypeAndIdRecords-0df.adoc[`codeview::mergeTypeAndIdRecords`] | Merge a unified set of type and id records, splitting them into separate output streams. | xref:llvm/codeview/mergeTypeRecords-01.adoc[`codeview::mergeTypeRecords`] | Merge one set of type records into another. This method assumes that all records are type records, and there are no Id records present. | xref:llvm/codeview/mergeTypeRecords-0c.adoc[`codeview::mergeTypeRecords`] | Merge one set of type records into a global type table. | xref:llvm/codeview/visitDebugSubsection.adoc[`codeview::visitDebugSubsection`] | Dispatch a single debug subsection record to the appropriate visitor method. | xref:llvm/codeview/visitDebugSubsections-032.adoc[`codeview::visitDebugSubsections`] | Visit each debug subsection in `FragmentRange` using the given string table. | xref:llvm/codeview/visitDebugSubsections-03c.adoc[`codeview::visitDebugSubsections`] | Visit each debug subsection in `FragmentRange.` | xref:llvm/codeview/visitDebugSubsections-07.adoc[`codeview::visitDebugSubsections`] | Visit each debug subsection in `FragmentRange` using the given string table and checksums. | xref:llvm/codeview/visitMemberRecord-04.adoc[`codeview::visitMemberRecord`] | Visit a single member record. | xref:llvm/codeview/visitMemberRecord-0ff.adoc[`codeview::visitMemberRecord`] | Visit a single member record from its leaf kind and raw bytes. | xref:llvm/codeview/visitMemberRecordStream.adoc[`codeview::visitMemberRecordStream`] | Visit every member record in a field‐list byte stream. | xref:llvm/codeview/visitTypeRecord-05.adoc[`codeview::visitTypeRecord`] | Visit a single type record at a known type index. | xref:llvm/codeview/visitTypeRecord-07.adoc[`codeview::visitTypeRecord`] | Visit a single type record without a type index. | xref:llvm/codeview/visitTypeStream-04.adoc[`codeview::visitTypeStream`] | Visit every type record in `Types` in order. | xref:llvm/codeview/visitTypeStream-05.adoc[`codeview::visitTypeStream`] | Visit every type record in the range `Types.` | xref:llvm/codeview/visitTypeStream-0b.adoc[`codeview::visitTypeStream`] | Visit every type record in the collection `Types.` | xref:llvm/compression/decompress-03.adoc[`compression::decompress`] | Decompress `Input` using debug compression type `T` into `Output.` | xref:llvm/compression/decompress-08.adoc[`compression::decompress`] | Decompress `Input` using the debug‐info compression format `T` into `Output,` which is resized to `UncompressedSize` bytes. | xref:llvm/compression/decompress-0f.adoc[`compression::decompress`] | Decompress `Input` using compression format `F` into `Output,` which is resized to `UncompressedSize` bytes. | xref:llvm/dwarf_linker/finiteLoop.adoc[`dwarf_linker::finiteLoop`] | Call `Iteration` until it returns false, or fail if the limit is hit. | xref:llvm/ifs/filterIFSSyms.adoc[`ifs::filterIFSSyms`] | Filters symbols from an IFS stub by undefined status and exclude globs. | xref:llvm/ifs/overrideIFSTarget.adoc[`ifs::overrideIFSTarget`] | Override the target platform inforation in the text stub. | xref:llvm/ifs/validateIFSTarget.adoc[`ifs::validateIFSTarget`] | Validate the target platform inforation in the text stub. | xref:llvm/ifs/writeBinaryStub.adoc[`ifs::writeBinaryStub`] | Attempt to write a binary ELF stub. | xref:llvm/ifs/writeIFSToOutputStream.adoc[`ifs::writeIFSToOutputStream`] | Attempts to write an IFS interface file to a raw_ostream. | xref:llvm/irsymtab/build.adoc[`irsymtab::build`] | Fills in Symtab and StrtabBuilder with a valid symbol and string table for Mods. | xref:llvm/jitlink/makeAlignmentError.adoc[`jitlink::makeAlignmentError`] | Create an alignment error for a fixup at the given location. | xref:llvm/jitlink/makeTargetOutOfRangeError.adoc[`jitlink::makeTargetOutOfRangeError`] | Create an out of range error for the given edge in the given block. | xref:llvm/jitlink/markAllSymbolsLive.adoc[`jitlink::markAllSymbolsLive`] | Marks all symbols in a graph live. This can be used as a default, conservative mark‐live implementation. | xref:llvm/lto/backend.adoc[`lto::backend`] | Runs a regular LTO backend. The regular LTO backend can also act as the regular LTO phase of ThinLTO, which may need to access the combined index. | xref:llvm/lto/finalizeOptimizationRemarks.adoc[`lto::finalizeOptimizationRemarks`] | Finalizes and flushes an optimization remarks output file. | xref:llvm/lto/thinBackend-09.adoc[`lto::thinBackend`] | Runs a ThinLTO backend. | xref:llvm/msf/validateSuperBlock.adoc[`msf::validateSuperBlock`] | Validates that a superblock describes a well‐formed MSF file. | xref:llvm/objcopy/executeObjcopyOnArchive.adoc[`objcopy::executeObjcopyOnArchive`] | Applies the transformations described by `Config` to each member in archive `Ar.` Writes a result in a file specified by `Config.OutputFilename.` | xref:llvm/objcopy/executeObjcopyOnBinary.adoc[`objcopy::executeObjcopyOnBinary`] | Applies the transformations described by `Config` to `In` and writes the result into `Out.` | xref:llvm/object/createError.adoc[`object::createError`] | Create a parse_failed StringError with message `Err.` | xref:llvm/object/decodeCrel.adoc[`object::decodeCrel`] | Decode a CREL relocation blob, invoking handlers for the header and entries. | xref:llvm/object/extractCodeObject-01.adoc[`object::extractCodeObject`] | Extract code object memory from the given `Buffer` at `Offset` and of `Size,` and copy into `OutputFileName.` | xref:llvm/object/extractCodeObject-02.adoc[`object::extractCodeObject`] | Extract code object memory from the given `Source` object file at `Offset` and of `Size,` and copy into `OutputFileName.` | xref:llvm/object/extractOffloadBinaries.adoc[`object::extractOffloadBinaries`] | Extracts embedded device offloading code from a memory `Buffer` to a list of `Binaries.` | xref:llvm/object/extractOffloadBundleByURI.adoc[`object::extractOffloadBundleByURI`] | Extracts an Offload Bundle Entry given by URI. | xref:llvm/object/extractOffloadBundleFatBinary.adoc[`object::extractOffloadBundleFatBinary`] | Extracts fat binary in binary clang‐offload‐bundler format from object `Obj` and return it in `Bundles.` | xref:llvm/object/isNotObjectErrorInvalidFileType.adoc[`object::isNotObjectErrorInvalidFileType`] | Consume `Err` when it is invalid_file_type; otherwise return it. | xref:llvm/object/writeImportLibrary.adoc[`object::writeImportLibrary`] | Writes a COFF import library containing entries described by the Exports array. | xref:llvm/object/writeUniversalBinary.adoc[`object::writeUniversalBinary`] | Write a Mach‐O universal binary containing `Slices` to `OutputFileName.` | xref:llvm/object/writeUniversalBinaryToStream.adoc[`object::writeUniversalBinaryToStream`] | Write a Mach‐O universal binary containing `Slices` to `Out.` | xref:llvm/offloading/containerizeImage.adoc[`offloading::containerizeImage`] | Containerizes an image within an OffloadBinary image. | xref:llvm/offloading/wrapCudaBinary.adoc[`offloading::wrapCudaBinary`] | Wraps the input fatbinary image into the module `M` as global symbols and registers the images with the CUDA runtime. | xref:llvm/offloading/wrapHIPBinary.adoc[`offloading::wrapHIPBinary`] | Wraps the input bundled image into the module `M` as global symbols and registers the images with the HIP runtime. | xref:llvm/offloading/wrapOpenMPBinaries.adoc[`offloading::wrapOpenMPBinaries`] | Wraps the input device images into the module `M` as global symbols and registers the images with the OpenMP Offloading runtime libomptarget. | xref:llvm/offloading/wrapSYCLBinaries.adoc[`offloading::wrapSYCLBinaries`] | Wraps OffloadBinaries in the given `Buffers` into the module `M` as global symbols and registers the images with the SYCL Runtime. | xref:llvm/orc/addFunctionPointerRelocationsToCurrentSymbol.adoc[`orc::addFunctionPointerRelocationsToCurrentSymbol`] | Introduce relocations to `Sym` in its own definition if there are any pointers formed via PC‐relative address that do not already have a relocation. | xref:llvm/orc/checkMachORelocatableObject-05f.adoc[`orc::checkMachORelocatableObject`] | Check that a buffer contains a MachO object compatible with a triple. | xref:llvm/orc/decodeHangupPayload.adoc[`orc::decodeHangupPayload`] | Decode a Hangup payload produced by encodeHangupPayload. | xref:llvm/orc/deregisterEHFrameSection.adoc[`orc::deregisterEHFrameSection`] | Unregister frames in the given eh‐frame section with libunwind. | xref:llvm/orc/enableDebuggerSupport.adoc[`orc::enableDebuggerSupport`] | Enable debugger support for the given LLJIT instance. | xref:llvm/orc/encodeHangupPayload.adoc[`orc::encodeHangupPayload`] | Encode an Error as the payload of a Hangup message. | xref:llvm/orc/lookupAndApply-06d.adoc[`orc::lookupAndApply`] | Blocking version of lookupAndApply above. | xref:llvm/orc/lookupAndApply-07.adoc[`orc::lookupAndApply`] | lookupAndApply with a static lookup in the given JITDylib. Blocking version. | xref:llvm/orc/preserveDebugSections.adoc[`orc::preserveDebugSections`] | Preserve DWARF debug sections in `G` so they are not pruned by JITLink. | xref:llvm/orc/registerEHFrameSection.adoc[`orc::registerEHFrameSection`] | Register frames in the given eh‐frame section with libunwind. | xref:llvm/orc/setUpInProcessLCTMReentryViaEPCIU.adoc[`orc::setUpInProcessLCTMReentryViaEPCIU`] | Set up in‐process lazy call‐through re‐entry via the given EPCIU. | xref:llvm/orc/setUpOrcPlatformManually.adoc[`orc::setUpOrcPlatformManually`] | Configure the LLJIT instance to use orc runtime support. This overload assumes that the client has manually configured a Platform object. | xref:llvm/pdb/iterateModuleSubsections.adoc[`pdb::iterateModuleSubsections`] | Visit each debug subsection of type `SubsectionT` across filtered modules. | xref:llvm/pdb/iterateOneModule.adoc[`pdb::iterateOneModule`] | Print a module header for `SG` and invoke `Callback` for that module. | xref:llvm/pdb/iterateSymbolGroups.adoc[`pdb::iterateSymbolGroups`] | Visit each filtered symbol group in `Input,` invoking `Callback.` | xref:llvm/pdb/loadDataForEXE.adoc[`pdb::loadDataForEXE`] | Create a PDB session by loading debug data for an executable. | xref:llvm/pdb/loadDataForPDB.adoc[`pdb::loadDataForPDB`] | Create a PDB session by loading debug data from a PDB file. | xref:llvm/pdb/readSparseBitVector.adoc[`pdb::readSparseBitVector`] | Read a SparseBitVector from a PDB binary stream. | xref:llvm/pdb/writeSparseBitVector.adoc[`pdb::writeSparseBitVector`] | Write a SparseBitVector to a PDB binary stream. | xref:llvm/vfs/convertToOutputError.adoc[`vfs::convertToOutputError`] | Return _Error::success()_ or use `OutputPath` to create an _OutputError,_ depending on `EC.` | xref:llvm/vfs/convertToTempFileOutputError.adoc[`vfs::convertToTempFileOutputError`] | Return _Error::success()_ or use `TempPath` and `OutputPath` to create a _TempFileOutputError,_ depending on `EC.` | xref:llvm/compression/zlib/decompress-00.adoc[`compression::zlib::decompress`] | Decompress zlib‐compressed `Input` into a caller‐provided buffer. | xref:llvm/compression/zlib/decompress-05.adoc[`compression::zlib::decompress`] | Decompress zlib‐compressed `Input` into `Output.` | xref:llvm/compression/zstd/decompress-04.adoc[`compression::zstd::decompress`] | Decompress zstd‐compressed `Input` into a caller‐provided buffer. | xref:llvm/compression/zstd/decompress-06.adoc[`compression::zstd::decompress`] | Decompress zstd‐compressed `Input` into `Output.` | xref:llvm/coverage/accessors/getFuncNameViaRef.adoc[`coverage::accessors::getFuncNameViaRef`] | Return the PGO name of the function. Used for formats in which the name is a hash. | xref:llvm/jitlink/aarch32/applyFixup.adoc[`jitlink::aarch32::applyFixup`] | Apply fixup expression for edge to block content. | xref:llvm/jitlink/aarch32/applyFixupArm.adoc[`jitlink::aarch32::applyFixupArm`] | Helper function to apply the fixup for Arm‐class relocations. | xref:llvm/jitlink/aarch32/applyFixupData.adoc[`jitlink::aarch32::applyFixupData`] | Helper function to apply the fixup for Data‐class relocations. | xref:llvm/jitlink/aarch32/applyFixupThumb.adoc[`jitlink::aarch32::applyFixupThumb`] | Helper function to apply the fixup for Thumb‐class relocations. | xref:llvm/jitlink/aarch64/applyFixup.adoc[`jitlink::aarch64::applyFixup`] | Apply fixup expression for edge to block content. | xref:llvm/jitlink/aarch64/createEmptyPointerSigningFunction.adoc[`jitlink::aarch64::createEmptyPointerSigningFunction`] | Create an empty pointer signing function for the link graph. | xref:llvm/jitlink/aarch64/lowerPointer64AuthEdgesToSigningFunction.adoc[`jitlink::aarch64::lowerPointer64AuthEdgesToSigningFunction`] | Lower Pointer64Authenticated edges into a pointer signing function. | xref:llvm/jitlink/hexagon/applyFixup.adoc[`jitlink::hexagon::applyFixup`] | Apply fixup expression for edge to block content. | xref:llvm/jitlink/ppc64/applyFixup.adoc[`jitlink::ppc64::applyFixup`] | Apply fixup expression for edge to block content. | xref:llvm/jitlink/ppc64/relocateHalf16.adoc[`jitlink::ppc64::relocateHalf16`] | Write a 16‐bit half16 relocation field for edge kind `K.` | xref:llvm/jitlink/systemz/applyFixup.adoc[`jitlink::systemz::applyFixup`] | Apply fixup expression for edge to block content. | xref:llvm/jitlink/systemz/optimizeGOTAndStubAccesses.adoc[`jitlink::systemz::optimizeGOTAndStubAccesses`] | Optimize in‐range GOT and stub relocations in the link graph. | xref:llvm/jitlink/x86/applyFixup.adoc[`jitlink::x86::applyFixup`] | Apply fixup expression for edge to block content. | xref:llvm/jitlink/x86/optimizeGOTAndStubAccesses.adoc[`jitlink::x86::optimizeGOTAndStubAccesses`] | Optimize GOT and stub relocations when the edge target is in range. | xref:llvm/jitlink/x86_64/applyFixup.adoc[`jitlink::x86_64::applyFixup`] | Apply fixup expression for edge to block content. | xref:llvm/jitlink/x86_64/optimizeGOTAndStubAccesses.adoc[`jitlink::x86_64::optimizeGOTAndStubAccesses`] | Optimize GOT and stub accesses when the ultimate target is in range. | xref:llvm/objcopy/coff/executeObjcopyOnBinary.adoc[`objcopy::coff::executeObjcopyOnBinary`] | Apply the transformations described by `Config` and `COFFConfig` to `In` and writes the result into `Out.` | xref:llvm/objcopy/dxbc/executeObjcopyOnBinary.adoc[`objcopy::dxbc::executeObjcopyOnBinary`] | Apply the transformations described by `Config` and `DXContainerConfig` to `In` and writes the result into `Out.` | xref:llvm/objcopy/elf/executeObjcopyOnBinary.adoc[`objcopy::elf::executeObjcopyOnBinary`] | Apply the transformations described by `Config` and `ELFConfig` to `In` and writes the result into `Out.` | xref:llvm/objcopy/elf/executeObjcopyOnIHex.adoc[`objcopy::elf::executeObjcopyOnIHex`] | Apply the transformations described by `Config` and `ELFConfig` to `In,` which must represent an IHex file, and writes the result into `Out.` | xref:llvm/objcopy/elf/executeObjcopyOnRawBinary.adoc[`objcopy::elf::executeObjcopyOnRawBinary`] | Apply the transformations described by `Config` and `ELFConfig` to `In,` which is treated as a raw binary input, and writes the result into `Out.` | xref:llvm/objcopy/macho/executeObjcopyOnBinary.adoc[`objcopy::macho::executeObjcopyOnBinary`] | Apply the transformations described by `Config` and `MachOConfig` to `In` and writes the result into `Out.` | xref:llvm/objcopy/macho/executeObjcopyOnMachOUniversalBinary.adoc[`objcopy::macho::executeObjcopyOnMachOUniversalBinary`] | Apply the transformations described by `Config` to `In` and writes the result into `Out.` | xref:llvm/objcopy/wasm/executeObjcopyOnBinary.adoc[`objcopy::wasm::executeObjcopyOnBinary`] | Apply the transformations described by `Config` and `WasmConfig` to `In` and writes the result into `Out.` | xref:llvm/objcopy/xcoff/executeObjcopyOnBinary.adoc[`objcopy::xcoff::executeObjcopyOnBinary`] | Apply the transformations described by `Config` and `XCOFFConfig` to `In` and writes the result into `Out.` | xref:llvm/offloading/amdgpu/getAMDGPUMetaDataFromImage.adoc[`offloading::amdgpu::getAMDGPUMetaDataFromImage`] | Reads AMDGPU specific metadata from the ELF file and propagates the KernelInfoMap. | xref:llvm/offloading/intel/containerizeOpenMPSPIRVImage.adoc[`offloading::intel::containerizeOpenMPSPIRVImage`] | Containerizes an OpenMP SPIR‐V image into an OffloadBinary image. | xref:llvm/orc/shared/runDeallocActions.adoc[`orc::shared::runDeallocActions`] | Run deallocation actions. Dealloc actions will be run in reverse order (from last element of DAs to first). | xref:llvm/sys/fs/readNativeFileToEOF.adoc[`sys::fs::readNativeFileToEOF`] | Reads from `FileHandle` until EOF, appending to `Buffer` in chunks of size `ChunkSize.` |=== == Derived Classes [cols="1,4"] |=== | Name| Description | xref:llvm/ErrorSuccess.adoc[`ErrorSuccess`] | Subclass of Error that represents success in the type system. | xref:llvm/MSVCPError.adoc[`MSVCPError`] | A default‐constructible Error suitable for use with MSVC's std::future. |=== == Return Value [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== [.small]#Created with https://www.mrdocs.com[MrDocs]#