Add an important prototype
[oota-llvm.git] / include / llvm / Analysis / ProfileInfo.h
1 //===- llvm/Analysis/ProfileInfo.h - Profile Info Interface -----*- 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 // This file defines the generic ProfileInfo interface, which is used as the
11 // common interface used by all clients of profiling information, and
12 // implemented either by making static guestimations, or by actually reading in
13 // profiling information gathered by running the program.
14 //
15 // Note that to be useful, all profile-based optimizations should preserve
16 // ProfileInfo, which requires that they notify it when changes to the CFG are
17 // made.
18 //
19 //===----------------------------------------------------------------------===//
20
21 #ifndef LLVM_ANALYSIS_PROFILEINFO_H
22 #define LLVM_ANALYSIS_PROFILEINFO_H
23
24 #include <string>
25
26 namespace llvm {
27   class BasicBlock;
28   class Pass;
29
30   /// createProfileLoaderPass - This function returns a Pass that loads the
31   /// profiling information for the module from the specified filename, making
32   /// it available to the optimizers.
33   Pass *createProfileLoaderPass(const std::string &Filename);
34
35   struct ProfileInfo {
36     virtual ~ProfileInfo();  // We want to be subclassed
37     
38     //===------------------------------------------------------------------===//
39     /// Profile Information Queries
40     ///
41     virtual unsigned getExecutionCount(BasicBlock *BB) = 0;
42     
43     //===------------------------------------------------------------------===//
44     /// Analysis Update Methods
45     ///
46
47   };
48
49 } // End llvm namespace
50
51 #endif