[llvm-commits] CVS: llvm/include/llvm/Analysis/ProfileInfo.h
Chris Lattner
lattner at cs.uiuc.edu
Mon Mar 8 15:31:00 PST 2004
Changes in directory llvm/include/llvm/Analysis:
ProfileInfo.h updated: 1.2 -> 1.3
---
Log message:
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.
---
Diffs of the changes: (+9 -2)
Index: llvm/include/llvm/Analysis/ProfileInfo.h
diff -u llvm/include/llvm/Analysis/ProfileInfo.h:1.2 llvm/include/llvm/Analysis/ProfileInfo.h:1.3
--- llvm/include/llvm/Analysis/ProfileInfo.h:1.2 Wed Feb 11 00:11:06 2004
+++ llvm/include/llvm/Analysis/ProfileInfo.h Mon Mar 8 15:30:18 2004
@@ -22,6 +22,7 @@
#define LLVM_ANALYSIS_PROFILEINFO_H
#include <string>
+#include <map>
namespace llvm {
class BasicBlock;
@@ -32,13 +33,19 @@
/// 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
More information about the llvm-commits
mailing list