struct RemarkLinker
Declaration
struct RemarkLinker { /* full declaration omitted */ };
Declared at: llvm/include/llvm/Remarks/RemarkLinker.h:31
Member Variables
- private llvm::remarks::StringTable StrTab
- The main string table for the remarks. Note: all remarks should use the strings from this string table to avoid dangling references.
- private std::set<std::unique_ptr<Remark>, RemarkPtrCompare> Remarks
- A set holding unique remarks. FIXME: std::set is probably not the most appropriate data structure here. Due to the limitation of having a move-only key, there isn't another obvious choice for now.
- private Optional<std::string> PrependPath
- A path to append before the external file path found in remark metadata.
Method Overview
- public bool empty() const
- private llvm::remarks::Remark & keep(std::unique_ptr<Remark> Remark)
- public llvm::Error link(llvm::StringRef Buffer, Optional<llvm::remarks::Format> RemarkFormat = None)
- public llvm::Error link(const object::ObjectFile & Obj, Optional<llvm::remarks::Format> RemarkFormat = None)
- public iterator_range<llvm::remarks::RemarkLinker::iterator> remarks() const
- public llvm::Error serialize(llvm::raw_ostream & OS, llvm::remarks::Format RemarksFormat) const
- public void setExternalFilePrependPath(llvm::StringRef PrependPath)
Methods
¶bool empty() const
bool empty() const
Description
Check whether there are any remarks linked.
Declared at: llvm/include/llvm/Remarks/RemarkLinker.h:82
¶llvm::remarks::Remark& keep(
std::unique_ptr<Remark> Remark)
llvm::remarks::Remark& keep(
std::unique_ptr<Remark> Remark)
Description
Keep this remark. If it's already in the set, discard it.
Declared at: llvm/include/llvm/Remarks/RemarkLinker.h:57
Parameters
- std::unique_ptr<Remark> Remark
¶llvm::Error link(llvm::StringRef Buffer,
Optional<llvm::remarks::Format>
RemarkFormat = None)
llvm::Error link(llvm::StringRef Buffer,
Optional<llvm::remarks::Format>
RemarkFormat = None)
Description
Link the remarks found in \p Buffer. If \p RemarkFormat is not provided, try to deduce it from the metadata in\p Buffer. \p Buffer can be either a standalone remark container or just metadata. This takes care of uniquing and merging the remarks.
Declared at: llvm/include/llvm/Remarks/RemarkLinker.h:68
Parameters
- llvm::StringRef Buffer
- Optional<llvm::remarks::Format> RemarkFormat = None
¶llvm::Error link(const object::ObjectFile& Obj,
Optional<llvm::remarks::Format>
RemarkFormat = None)
llvm::Error link(const object::ObjectFile& Obj,
Optional<llvm::remarks::Format>
RemarkFormat = None)
Description
Link the remarks found in \p Obj by looking for the right section and calling the method above.
Declared at: llvm/include/llvm/Remarks/RemarkLinker.h:72
Parameters
- const object::ObjectFile& Obj
- Optional<llvm::remarks::Format> RemarkFormat = None
¶iterator_range<
llvm::remarks::RemarkLinker::iterator>
remarks() const
iterator_range<
llvm::remarks::RemarkLinker::iterator>
remarks() const
Declared at: llvm/include/llvm/Remarks/RemarkLinker.h:89
¶llvm::Error serialize(
llvm::raw_ostream& OS,
llvm::remarks::Format RemarksFormat) const
llvm::Error serialize(
llvm::raw_ostream& OS,
llvm::remarks::Format RemarksFormat) const
Description
Serialize the linked remarks to the stream \p OS, using the format \p RemarkFormat. This clears internal state such as the string table. Note: this implies that the serialization mode is standalone.
Declared at: llvm/include/llvm/Remarks/RemarkLinker.h:79
Parameters
- llvm::raw_ostream& OS
- llvm::remarks::Format RemarksFormat
¶void setExternalFilePrependPath(
llvm::StringRef PrependPath)
void setExternalFilePrependPath(
llvm::StringRef PrependPath)
Description
Set a path to prepend to the external file path.
Declared at: llvm/include/llvm/Remarks/RemarkLinker.h:61
Parameters
- llvm::StringRef PrependPath