1 //===- ProfileInfo.h - Represents profile information -----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // The ProfileInfo class is used to represent profiling information read in from
13 //===----------------------------------------------------------------------===//
27 std::vector<std::string> CommandLines;
28 std::vector<unsigned> FunctionCounts;
29 std::vector<unsigned> BlockCounts;
31 // ProfileInfo ctor - Read the specified profiling data file, exiting the
32 // program if the file is invalid or broken.
33 ProfileInfo(const char *ToolName, const std::string &Filename, Module &M);
35 unsigned getNumExecutions() const { return CommandLines.size(); }
36 const std::string &getExecution(unsigned i) const { return CommandLines[i]; }
38 // getFunctionCounts - This method is used by consumers of function counting
39 // information. If we do not directly have function count information, we
40 // compute it from other, more refined, types of profile information.
42 void getFunctionCounts(std::vector<std::pair<Function*, unsigned> > &Counts);
44 // hasAccurateBlockCounts - Return true if we can synthesize accurate block
45 // frequency information from whatever we have.
47 bool hasAccurateBlockCounts() const {
48 return !BlockCounts.empty();
51 // getBlockCounts - This method is used by consumers of block counting
52 // information. If we do not directly have block count information, we
53 // compute it from other, more refined, types of profile information.
55 void getBlockCounts(std::vector<std::pair<BasicBlock*, unsigned> > &Counts);