1 //===- ProfileInfoLoader.h - Load & convert profile information -*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // The ProfileInfoLoader class is used to load and represent profiling
11 // information read in from the dump file. If conversions between formats are
12 // needed, it can also do this.
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_ANALYSIS_PROFILEINFOLOADER_H
17 #define LLVM_ANALYSIS_PROFILEINFOLOADER_H
29 class ProfileInfoLoader {
30 const std::string &Filename;
32 std::vector<std::string> CommandLines;
33 std::vector<unsigned> FunctionCounts;
34 std::vector<unsigned> BlockCounts;
35 std::vector<unsigned> EdgeCounts;
36 std::vector<unsigned> OptimalEdgeCounts;
37 std::vector<unsigned> BBTrace;
40 // ProfileInfoLoader ctor - Read the specified profiling data file, exiting
41 // the program if the file is invalid or broken.
42 ProfileInfoLoader(const char *ToolName, const std::string &Filename,
45 unsigned getNumExecutions() const { return CommandLines.size(); }
46 const std::string &getExecution(unsigned i) const { return CommandLines[i]; }
48 const std::string &getFileName() const { return Filename; }
50 // getRawFunctionCounts - This method is used by consumers of function
51 // counting information.
53 const std::vector<unsigned> &getRawFunctionCounts() const {
54 return FunctionCounts;
57 // getRawBlockCounts - This method is used by consumers of block counting
60 const std::vector<unsigned> &getRawBlockCounts() const {
64 // getEdgeCounts - This method is used by consumers of edge counting
67 const std::vector<unsigned> &getRawEdgeCounts() const {
71 // getEdgeOptimalCounts - This method is used by consumers of optimal edge
72 // counting information.
74 const std::vector<unsigned> &getRawOptimalEdgeCounts() const {
75 return OptimalEdgeCounts;
80 } // End llvm namespace