Go to the documentation of this file.
14 #ifndef LLVM_PROFILEDATA_GCOV_H
15 #define LLVM_PROFILEDATA_GCOV_H
45 Options(
bool A,
bool B,
bool C,
bool F,
bool P,
bool U,
bool I,
bool L,
81 if (magic ==
"gcno") {
83 }
else if (magic ==
"oncg") {
86 errs() <<
"unexpected magic: " << magic <<
"\n";
96 if (magic ==
"gcda") {
98 }
else if (magic ==
"adcg") {
113 int ver = str[0] >=
'A'
114 ? (str[0] -
'A') * 100 + (str[1] -
'0') * 10 + str[2] -
'0'
115 : (str[0] -
'0') * 10 + str[2] -
'0';
119 }
else if (ver >= 90) {
123 }
else if (ver >= 80) {
127 }
else if (ver >= 48) {
131 }
else if (ver >= 47) {
135 }
else if (ver >= 34) {
139 errs() <<
"unexpected version: " << str <<
"\n";
154 errs() <<
"unexpected end of memory buffer: " <<
cursor.
tell() <<
"\n";
300 std::vector<std::pair<GCOVBlock *, size_t>> &
stack);
319 #endif // LLVM_PROFILEDATA_GCOV_H
SmallVector< std::unique_ptr< GCOVFunction >, 16 > functions
pointee_iterator< SmallVectorImpl< std::unique_ptr< GCOVFunction > >::const_iterator > iterator
static uint64_t getLineCount(const BlockVector &Blocks)
DataExtractor::Cursor cursor
iterator_range< EdgeIterator > srcs() const
bool readGCOVVersion(GCOV::GCOVVersion &version)
readGCOVVersion - Read GCOV version.
This is an optimization pass for GlobalISel generic memory operations.
uint64_t getEntryCount() const
getEntryCount - Get the number of times the function was called by retrieving the entry block's count...
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
SmallVector< GCOVArc *, 2 > pred
SmallString< 0 > demangled
GCOVBlock - Collects block information.
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
GCOVBuffer(MemoryBuffer *B)
DenseSet< const GCOVBlock * > visited
std::map< uint32_t, GCOVFunction * > identToFunction
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
Options(bool A, bool B, bool C, bool F, bool P, bool U, bool I, bool L, bool M, bool N, bool R, bool T, bool X, std::string SourcePrefix)
StringRef getName(bool demangle) const
void consumeError(Error Err)
Consume a Error without doing anything.
SmallVector< const GCOVBlock *, 1 > BlockVector
This interface provides simple read-only access to a block of memory, and provides simple methods for...
StringMap< unsigned > filenameToIdx
void dump() const
dump - Dump GCOVFile content to dbgs() for debugging purposes.
void addDstEdge(GCOVArc *Edge)
iterator_range< BlockIterator > blocksRange() const
(vector float) vec_cmpeq(*A, *B) C
bool readGCDAFormat()
readGCDAFormat - Check GCDA signature is valid at the beginning of buffer.
SmallVector< uint32_t, 4 > lines
SmallVector< GCOVArc *, 2 > succ
constexpr StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static uint64_t getCyclesCount(const BlockVector &blocks)
StringRef getFilename() const
This class implements an extremely fast bulk output stream that can only output to a stream.
StringRef getBuffer() const
uint64_t getCount() const
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
std::string demangle(const std::string &MangledName)
Attempt to demangle a string using different demangling schemes.
uint32_t getLastLine() const
static uint64_t augmentOneCycle(GCOVBlock *src, std::vector< std::pair< GCOVBlock *, size_t >> &stack)
GCOV::GCOVVersion getVersion() const
Implements a dense probed hash-table based set.
GCOVBlock & getExitBlock() const
dot regions Print regions of function to dot file(with no function bodies)"
SmallVectorImpl< GCOVArc * >::const_iterator EdgeIterator
SmallVector< std::unique_ptr< GCOVArc >, 0 > arcs
typename SuperClass::const_iterator const_iterator
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
bool readInt(uint32_t &Val)
void gcovOneInput(const GCOV::Options &options, StringRef filename, StringRef gcno, StringRef gcda, GCOVFile &file)
bool readInt64(uint64_t &Val)
StringRef - Represent a constant reference to a string, i.e.
void dump() const
dump - Dump GCOVFunction content to dbgs() for debugging purposes.
void print(raw_ostream &OS) const
A struct for passing gcov options between functions.
GCOV::GCOVVersion version
The object format emitted by the WebAssembly backed is documented see the home and packaging for producing WebAssembly applications that can run in browsers and other environments wasi sdk provides a more minimal C C SDK based on llvm and a libc based on for producing WebAssemmbly applictions that use the WASI ABI Rust provides WebAssembly support integrated into Cargo There are two main options
void print(raw_ostream &OS) const
collectLineCounts - Collect line counts.
GCOVArc(GCOVBlock &src, GCOVBlock &dst, uint32_t flags)
void print(raw_ostream &OS) const
bool readGCNOFormat()
readGCNOFormat - Check GCNO signature is valid at the beginning of buffer.
iterator_range< EdgeIterator > dsts() const
std::vector< std::string > filenames
bool readGCDA(GCOVBuffer &Buffer)
readGCDA - Read GCDA buffer.
StringRef filename(StringRef path, Style style=Style::native)
Get filename.
GCOVFile - Collects coverage information for one pair of coverage file (.gcno and ....
void addSrcEdge(GCOVArc *Edge)
A range adaptor for a pair of iterators.
void dump() const
dump - Dump GCOVBlock content to dbgs() for debugging purposes.
SmallVector< std::unique_ptr< GCOVArc >, 0 > treeArcs
S is passed via registers r2 But gcc stores them to the stack
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
auto reverse(ContainerTy &&C)
bool readString(StringRef &str)
SmallVector< std::unique_ptr< GCOVBlock >, 0 > blocks
GCOVFunction - Collects function information.
An iterator type that allows iterating over the pointees via some other iterator.
GCOVBuffer - A wrapper around MemoryBuffer to provide GCOV specific read operations.
GCOVFunction(GCOVFile &file)
std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
uint64_t propagateCounts(const GCOVBlock &v, GCOVArc *pred)
StringRef drop_back(size_t N=1) const
Return a StringRef equal to 'this' but with the last N elements dropped.
bool readGCNO(GCOVBuffer &Buffer)
readGCNO - Read GCNO buffer.