LLVM 22.0.0git
llvm::remarks::RemarkLinker Struct Reference

#include "llvm/Remarks/RemarkLinker.h"

Public Types

using iterator = pointee_iterator<decltype(Remarks)::const_iterator>
 Return a collection of the linked unique remarks to iterate on.

Public Member Functions

LLVM_ABI void setExternalFilePrependPath (StringRef PrependPath)
 Set a path to prepend to the external file path.
void setKeepAllRemarks (bool B)
 Set KeepAllRemarks to B.
LLVM_ABI Error link (StringRef Buffer, Format RemarkFormat=Format::Auto)
 Link the remarks found in Buffer.
LLVM_ABI Error link (const object::ObjectFile &Obj, Format RemarkFormat=Format::Auto)
 Link the remarks found in Obj by looking for the right section and calling the method above.
LLVM_ABI Error serialize (raw_ostream &OS, Format RemarksFormat) const
 Serialize the linked remarks to the stream OS, using the format RemarkFormat.
bool empty () const
 Check whether there are any remarks linked.
iterator_range< iteratorremarks () const

Detailed Description

Definition at line 33 of file RemarkLinker.h.

Member Typedef Documentation

◆ iterator

Return a collection of the linked unique remarks to iterate on.

Ex: for (const Remark &R : RL.remarks() { [...] }

Definition at line 102 of file RemarkLinker.h.

Member Function Documentation

◆ empty()

bool llvm::remarks::RemarkLinker::empty ( ) const
inline

Check whether there are any remarks linked.

Definition at line 97 of file RemarkLinker.h.

◆ link() [1/2]

Error RemarkLinker::link ( const object::ObjectFile & Obj,
Format RemarkFormat = Format::Auto )

Link the remarks found in Obj by looking for the right section and calling the method above.

Definition at line 98 of file RemarkLinker.cpp.

References llvm::remarks::getRemarksSectionContents(), link(), llvm::Error::success(), and llvm::Expected< T >::takeError().

◆ link() [2/2]

Error RemarkLinker::link ( StringRef Buffer,
Format RemarkFormat = Format::Auto )

Link the remarks found in Buffer.

If RemarkFormat is not provided, try to deduce it from the metadata in Buffer. Buffer can be either a standalone remark container or just metadata. This takes care of uniquing and merging the remarks.

Definition at line 69 of file RemarkLinker.cpp.

References assert(), llvm::consumeError(), llvm::remarks::createRemarkParserFromMeta(), llvm::Next, llvm::remarks::RemarkParser::next(), llvm::Error::success(), and llvm::Expected< T >::takeError().

Referenced by link().

◆ remarks()

iterator_range< iterator > llvm::remarks::RemarkLinker::remarks ( ) const
inline

Definition at line 104 of file RemarkLinker.h.

Referenced by serialize().

◆ serialize()

Error RemarkLinker::serialize ( raw_ostream & OS,
Format RemarksFormat ) const

Serialize the linked remarks to the stream OS, using the format RemarkFormat.

This clears internal state such as the string table. Note: this implies that the serialization mode is standalone.

Definition at line 109 of file RemarkLinker.cpp.

References llvm::remarks::createRemarkSerializer(), remarks(), llvm::RemarksFormat, llvm::remarks::Standalone, llvm::Error::success(), and llvm::Expected< T >::takeError().

◆ setExternalFilePrependPath()

void RemarkLinker::setExternalFilePrependPath ( StringRef PrependPath)

Set a path to prepend to the external file path.

Definition at line 65 of file RemarkLinker.cpp.

◆ setKeepAllRemarks()

void llvm::remarks::RemarkLinker::setKeepAllRemarks ( bool B)
inline

Set KeepAllRemarks to B.

Definition at line 76 of file RemarkLinker.h.

References B().


The documentation for this struct was generated from the following files: