Provide an accessor for getting function count information. Print a simple
[oota-llvm.git] / tools / llvm-prof / ProfileInfo.h
1 //===- ProfileInfo.h - Represents profile information -----------*- C++ -*-===//
2 // 
3 //                      The LLVM Compiler Infrastructure
4 //
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.
7 // 
8 //===----------------------------------------------------------------------===//
9 //
10 // The ProfileInfo class is used to represent profiling information read in from
11 // the dump file.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef PROFILEINFO_H
16 #define PROFILEINFO_H
17
18 #include <vector>
19 #include <string>
20 #include <utility>
21 class Module;
22 class Function;
23
24 class ProfileInfo {
25   Module &M;
26   std::vector<std::string> CommandLines;
27   std::vector<unsigned>    FunctionCounts;
28   std::vector<unsigned>    BlockCounts;
29 public:
30   // ProfileInfo ctor - Read the specified profiling data file, exiting the
31   // program if the file is invalid or broken.
32   ProfileInfo(const char *ToolName, const std::string &Filename, Module &M);
33
34   // getFunctionCounts - This method is used by consumers of function counting
35   // information.  If we do not directly have function count information, we
36   // compute it from other, more refined, types of profile information.
37   //
38   void getFunctionCounts(std::vector<std::pair<Function*, unsigned> > &Counts);
39
40 };
41
42 #endif