14#ifndef LLVM_IR_LLVMREMARKSTREAMER_H
15#define LLVM_IR_LLVMREMARKSTREAMER_H
49template <
typename ThisError>
97 Finalizer &operator=(
const Finalizer &) =
delete;
100 Other.Context =
nullptr;
103 Finalizer &operator=(Finalizer &&
Other) {
113 std::unique_ptr<ToolOutputFile> OutputFile;
121 : OutputFile(
std::
move(OutputFile)), Finalize(&Ctx) {}
124 explicit operator bool() {
return bool(OutputFile); }
129 return std::move(OutputFile);
152 LLVMContext &Context, raw_ostream &OS, StringRef
RemarksPasses,
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
R600 Control Flow Finalizer
Common features for diagnostics dealing with optimization remarks that are used by both IR and MIR pa...
Base class for error info classes.
virtual std::string message() const
Return the error message as a string.
virtual std::error_code convertToErrorCode() const =0
Convert this error to a std::error_code.
Base class for user error types.
Lightweight error class with error context and mandatory checking.
This is an important class for using LLVM in a threaded context.
LLVMRemarkFileHandle(std::unique_ptr< ToolOutputFile > OutputFile, LLVMContext &Ctx)
std::unique_ptr< ToolOutputFile > releaseFile()
Finalize remark emission and release the underlying ToolOutputFile.
ToolOutputFile & operator*()
ToolOutputFile * operator->()
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
cl::opt< std::string > RemarksFormat("lto-pass-remarks-format", cl::desc("The format used for serializing remarks (default: YAML)"), cl::value_desc("format"), cl::init("yaml"))
LLVM_ABI Expected< LLVMRemarkFileHandle > setupLLVMOptimizationRemarks(LLVMContext &Context, StringRef RemarksFilename, StringRef RemarksPasses, StringRef RemarksFormat, bool RemarksWithHotness, std::optional< uint64_t > RemarksHotnessThreshold=0)
Set up optimization remarks that output to a file.
cl::opt< std::string > RemarksPasses("lto-pass-remarks-filter", cl::desc("Only record optimization remarks from passes whose " "names match the given regular expression"), cl::value_desc("regex"))
void handleAllErrors(Error E, HandlerTs &&... Handlers)
Behaves the same as handleErrors, except that by contract all errors must be handled by the given han...
cl::opt< bool > RemarksWithHotness("lto-pass-remarks-with-hotness", cl::desc("With PGO, include profile count in optimization remarks"), cl::Hidden)
cl::opt< std::string > RemarksFilename("lto-pass-remarks-output", cl::desc("Output filename for pass remarks"), cl::value_desc("filename"))
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
cl::opt< std::optional< uint64_t >, false, remarks::HotnessThresholdParser > RemarksHotnessThreshold("lto-pass-remarks-hotness-threshold", cl::desc("Minimum profile count required for an " "optimization remark to be output." " Use 'auto' to apply the threshold from profile summary."), cl::value_desc("uint or 'auto'"), cl::init(0), cl::Hidden)
LLVM_ABI void finalizeLLVMOptimizationRemarks(LLVMContext &Context)
Finalize optimization remarks and deregister the RemarkStreamer from the Context.
Implement std::hash so that hash_code can be used in STL containers.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.