summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-03-08 21:30:18 +0000
committerChris Lattner <sabre@nondot.org>2004-03-08 21:30:18 +0000
commit755ffeb2924b2c773976ecea07a06a7cd519a9ef (patch)
treedd8dcff99bd630337b7e0277a66170e782a3d154 /llvm
parentb08e4653cbf5abb164df7ebf8b40f12582ed25c1 (diff)
downloadbcm5719-llvm-755ffeb2924b2c773976ecea07a06a7cd519a9ef.tar.gz
bcm5719-llvm-755ffeb2924b2c773976ecea07a06a7cd519a9ef.zip
We don't want to make this a pure interface, as it makes all implementors
bear the burden of implementing what will be all exactly the same methods. They just want to provide the information in differing ways. llvm-svn: 12239
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Analysis/ProfileInfo.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/include/llvm/Analysis/ProfileInfo.h b/llvm/include/llvm/Analysis/ProfileInfo.h
index 10b31d5dede..3bb056bf83d 100644
--- a/llvm/include/llvm/Analysis/ProfileInfo.h
+++ b/llvm/include/llvm/Analysis/ProfileInfo.h
@@ -22,6 +22,7 @@
#define LLVM_ANALYSIS_PROFILEINFO_H
#include <string>
+#include <map>
namespace llvm {
class BasicBlock;
@@ -32,13 +33,19 @@ namespace llvm {
/// it available to the optimizers.
Pass *createProfileLoaderPass(const std::string &Filename);
- struct ProfileInfo {
+ class ProfileInfo {
+ protected:
+ std::map<BasicBlock*, unsigned> ExecutionCounts;
+ public:
virtual ~ProfileInfo(); // We want to be subclassed
//===------------------------------------------------------------------===//
/// Profile Information Queries
///
- virtual unsigned getExecutionCount(BasicBlock *BB) = 0;
+ unsigned getExecutionCount(BasicBlock *BB) {
+ std::map<BasicBlock*, unsigned>::iterator I = ExecutionCounts.find(BB);
+ return I != ExecutionCounts.end() ? I->second : 0;
+ }
//===------------------------------------------------------------------===//
/// Analysis Update Methods
OpenPOWER on IntegriCloud