[#llvm-setupLLVMOptimizationRemarks-0f] = xref:llvm.adoc[llvm]::setupLLVMOptimizationRemarks :relfileprefix: ../ :mrdocs: Set up optimization remarks that output to a file. == Synopsis Declared in `<llvm/IR/LLVMRemarkStreamer.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:llvm/Expected.adoc[Expected<LLVMRemarkFileHandle>] setupLLVMOptimizationRemarks( xref:llvm/LLVMContext.adoc[LLVMContext]& Context, xref:llvm/StringRef.adoc[StringRef] RemarksFilename, xref:llvm/StringRef.adoc[StringRef] RemarksPasses, xref:llvm/StringRef.adoc[StringRef] RemarksFormat, bool RemarksWithHotness, std::optional<uint64_t> RemarksHotnessThreshold = 0); ---- == Description The LLVMRemarkFileHandle manages the lifetime of the underlying ToolOutputFile to ensure xref:llvm/finalizeLLVMOptimizationRemarks.adoc[`finalizeLLVMOptimizationRemarks()`] is called before the file is destroyed or released from the handle. The handle must be kept alive until all remarks were emitted through the remark streamer. == Return Value Handle owning the remarks output file, or an error on failure. == Parameters [cols="1,4"] |=== | Name| Description | *Context* | LLVM context that receives the remark streamer. | *RemarksFilename* | Output path for optimization remarks. | *RemarksPasses* | Regex of pass names whose remarks should be emitted. | *RemarksFormat* | Serialization format for remarks. | *RemarksWithHotness* | Whether to include profile hotness information. | *RemarksHotnessThreshold* | Minimum hotness required to emit a remark. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#