LLVM  3.7.0
Public Types | Public Member Functions | List of all members
llvm::InstrProfWriter Class Reference

Writer for instrumentation based profile data. More...

#include <InstrProfWriter.h>

Public Types

typedef SmallDenseMap
< uint64_t, std::vector
< uint64_t >, 1 > 
CounterData
 

Public Member Functions

 InstrProfWriter ()
 
std::error_code addFunctionCounts (StringRef FunctionName, uint64_t FunctionHash, ArrayRef< uint64_t > Counters)
 Add function counts for the given function. More...
 
void write (raw_fd_ostream &OS)
 Write the profile to OS. More...
 
std::unique_ptr< MemoryBufferwriteBuffer ()
 Write the profile, returning the raw data. For testing. More...
 

Detailed Description

Writer for instrumentation based profile data.

Definition at line 30 of file InstrProfWriter.h.

Member Typedef Documentation

typedef SmallDenseMap<uint64_t, std::vector<uint64_t>, 1> llvm::InstrProfWriter::CounterData

Definition at line 32 of file InstrProfWriter.h.

Constructor & Destructor Documentation

llvm::InstrProfWriter::InstrProfWriter ( )
inline

Definition at line 37 of file InstrProfWriter.h.

Member Function Documentation

std::error_code InstrProfWriter::addFunctionCounts ( StringRef  FunctionName,
uint64_t  FunctionHash,
ArrayRef< uint64_t >  Counters 
)

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.

Definition at line 75 of file InstrProfWriter.cpp.

References llvm::count_mismatch, llvm::counter_overflow, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), I, llvm::ArrayRef< T >::size(), and llvm::success.

void InstrProfWriter::write ( raw_fd_ostream OS)

Write the profile to OS.

Definition at line 134 of file InstrProfWriter.cpp.

References llvm::raw_fd_ostream::seek().

std::unique_ptr< MemoryBuffer > InstrProfWriter::writeBuffer ( )

Write the profile, returning the raw data. For testing.

Definition at line 144 of file InstrProfWriter.cpp.

References llvm::Data, llvm::raw_ostream::flush(), and llvm::MemoryBuffer::getMemBufferCopy().


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