|
LLVM
4.0.0
|
Sample-based profile writer. Base class. More...
#include <SampleProfWriter.h>
Public Member Functions | |
| virtual | ~SampleProfileWriter () |
| virtual std::error_code | write (const FunctionSamples &S)=0 |
Write sample profiles in S. More... | |
| std::error_code | write (const StringMap< FunctionSamples > &ProfileMap) |
| Write all the sample profiles in the given map of samples. More... | |
| raw_ostream & | getOutputStream () |
Static Public Member Functions | |
| static ErrorOr < std::unique_ptr < SampleProfileWriter > > | create (StringRef Filename, SampleProfileFormat Format) |
| Profile writer factory. More... | |
| static ErrorOr < std::unique_ptr < SampleProfileWriter > > | create (std::unique_ptr< raw_ostream > &OS, SampleProfileFormat Format) |
Create a new stream writer based on the value of Format. More... | |
Protected Member Functions | |
| SampleProfileWriter (std::unique_ptr< raw_ostream > &OS) | |
| virtual std::error_code | writeHeader (const StringMap< FunctionSamples > &ProfileMap)=0 |
| Write a file header for the profile file. More... | |
| void | computeSummary (const StringMap< FunctionSamples > &ProfileMap) |
| Compute summary for this profile. More... | |
Protected Attributes | |
| std::unique_ptr< raw_ostream > | OutputStream |
| Output stream where to emit the profile to. More... | |
| std::unique_ptr< ProfileSummary > | Summary |
| Profile summary. More... | |
Sample-based profile writer. Base class.
Definition at line 31 of file SampleProfWriter.h.
|
inlinevirtual |
Definition at line 33 of file SampleProfWriter.h.
|
inlineprotected |
Definition at line 68 of file SampleProfWriter.h.
|
protected |
Compute summary for this profile.
Definition at line 256 of file SampleProfWriter.cpp.
References llvm::SampleProfileSummaryBuilder::addRecord(), llvm::ProfileSummaryBuilder::DefaultCutoffs, llvm::SampleProfileSummaryBuilder::getSummary(), and I.
|
static |
Profile writer factory.
Create a sample profile file writer based on the specified format.
Create a new file writer based on the value of Format.
| Filename | The file to create. |
| Writer | The writer to instantiate according to the specified format. |
| Format | Encoding format for the profile file. |
Definition at line 213 of file SampleProfWriter.cpp.
References llvm::sys::fs::F_None, llvm::sys::fs::F_Text, and llvm::sampleprof::SPF_Binary.
|
static |
Create a new stream writer based on the value of Format.
Create a sample profile stream writer based on the specified format.
For testing.
| OS | The output stream to store the profile data to. |
| Writer | The writer to instantiate according to the specified format. |
| Format | Encoding format for the profile file. |
Definition at line 236 of file SampleProfWriter.cpp.
References llvm::sampleprof::SPF_Binary, llvm::sampleprof::SPF_GCC, llvm::sampleprof::SPF_Text, llvm::unrecognized_format, and llvm::unsupported_writing_format.
|
inline |
Definition at line 54 of file SampleProfWriter.h.
References OutputStream.
|
pure virtual |
Write sample profiles in S.
Implemented in llvm::sampleprof::SampleProfileWriterBinary, and llvm::sampleprof::SampleProfileWriterText.
Referenced by write().
|
inline |
Write all the sample profiles in the given map of samples.
Definition at line 43 of file SampleProfWriter.h.
References I, llvm::success, write(), and writeHeader().
|
protectedpure virtual |
Write a file header for the profile file.
Implemented in llvm::sampleprof::SampleProfileWriterBinary, and llvm::sampleprof::SampleProfileWriterText.
Referenced by write().
|
protected |
Output stream where to emit the profile to.
Definition at line 76 of file SampleProfWriter.h.
Referenced by getOutputStream().
|
protected |
Profile summary.
Definition at line 79 of file SampleProfWriter.h.
1.8.6