|
LLVM
4.0.0
|
#include <InstrProfWriter.h>
Public Types | |
| enum | ProfKind { PF_Unknown = 0, PF_FE, PF_IRLevel } |
| typedef SmallDenseMap < uint64_t, InstrProfRecord, 1 > | ProfilingData |
Public Member Functions | |
| InstrProfWriter (bool Sparse=false) | |
| ~InstrProfWriter () | |
| Error | addRecord (InstrProfRecord &&I, uint64_t Weight=1) |
| Add function counts for the given function. More... | |
| Error | mergeRecordsFromWriter (InstrProfWriter &&IPW) |
| Merge existing function counts from the given writer. More... | |
| void | write (raw_fd_ostream &OS) |
Write the profile to OS. More... | |
| void | writeText (raw_fd_ostream &OS) |
Write the profile in text format to OS. More... | |
| std::unique_ptr< MemoryBuffer > | writeBuffer () |
| Write the profile, returning the raw data. For testing. More... | |
| Error | setIsIRLevelProfile (bool IsIRLevel) |
| Set the ProfileKind. Report error if mixing FE and IR level profiles. More... | |
| void | setValueProfDataEndianness (support::endianness Endianness) |
| void | setOutputSparse (bool Sparse) |
Static Public Member Functions | |
| static void | writeRecordInText (const InstrProfRecord &Record, InstrProfSymtab &Symtab, raw_fd_ostream &OS) |
Write Record in text format to OS. More... | |
Definition at line 30 of file InstrProfWriter.h.
| typedef SmallDenseMap<uint64_t, InstrProfRecord, 1> llvm::InstrProfWriter::ProfilingData |
Definition at line 32 of file InstrProfWriter.h.
| Enumerator | |
|---|---|
| PF_Unknown | |
| PF_FE | |
| PF_IRLevel | |
Definition at line 33 of file InstrProfWriter.h.
Definition at line 156 of file InstrProfWriter.cpp.
| InstrProfWriter::~InstrProfWriter | ( | ) |
Definition at line 160 of file InstrProfWriter.cpp.
| Error InstrProfWriter::addRecord | ( | InstrProfRecord && | I, |
| uint64_t | Weight = 1 |
||
| ) |
Add function counts for the given function.
If there are already counts for this function and the hash and number of counts match, each counter is summed. Optionally scale counts by Weight.
Definition at line 172 of file InstrProfWriter.cpp.
References I, llvm::InstrProfRecord::merge(), llvm::InstrProfRecord::Name, llvm::InstrProfRecord::scale(), llvm::InstrProfRecord::sortValueData(), and llvm::InstrProfRecord::takeError().
Referenced by mergeRecordsFromWriter().
| Error InstrProfWriter::mergeRecordsFromWriter | ( | InstrProfWriter && | IPW | ) |
Merge existing function counts from the given writer.
Definition at line 198 of file InstrProfWriter.cpp.
References addRecord(), E, I, and llvm::Error::success().
Set the ProfileKind. Report error if mixing FE and IR level profiles.
Definition at line 63 of file InstrProfWriter.h.
References PF_FE, PF_IRLevel, PF_Unknown, llvm::Error::success(), and llvm::unsupported_version.
| void InstrProfWriter::setOutputSparse | ( | bool | Sparse | ) |
Definition at line 168 of file InstrProfWriter.cpp.
| void InstrProfWriter::setValueProfDataEndianness | ( | support::endianness | Endianness | ) |
Definition at line 163 of file InstrProfWriter.cpp.
References llvm::InstrProfRecordWriterTrait::ValueProfDataEndianness.
| void InstrProfWriter::write | ( | raw_fd_ostream & | OS | ) |
Write the profile to OS.
Definition at line 296 of file InstrProfWriter.cpp.
| std::unique_ptr< MemoryBuffer > InstrProfWriter::writeBuffer | ( | ) |
Write the profile, returning the raw data. For testing.
Definition at line 302 of file InstrProfWriter.cpp.
References llvm::MemoryBuffer::getMemBufferCopy().
|
static |
Write Record in text format to OS.
Definition at line 317 of file InstrProfWriter.cpp.
References llvm::InstrProfRecord::Counts, llvm::InstrProfSymtab::getFuncName(), llvm::InstrProfRecord::getNumValueDataForSite(), llvm::InstrProfRecord::getNumValueKinds(), llvm::InstrProfRecord::getNumValueSites(), llvm::InstrProfRecord::getValueForSite(), llvm::InstrProfRecord::Hash, I, and llvm::InstrProfRecord::Name.
Referenced by writeText().
| void InstrProfWriter::writeText | ( | raw_fd_ostream & | OS | ) |
Write the profile in text format to OS.
Definition at line 356 of file InstrProfWriter.cpp.
References llvm::InstrProfSymtab::addFuncName(), llvm::InstrProfSymtab::finalizeSymtab(), PF_IRLevel, and writeRecordInText().
1.8.6