aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/ProfileInfoLoaderPass.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-03-08 21:30:35 +0000
committerChris Lattner <sabre@nondot.org>2004-03-08 21:30:35 +0000
commit62e84f376b621eb848807e0652ad4bfc465ad1f5 (patch)
tree82053801192250b63cd4e49927679192a02bbc95 /lib/Analysis/ProfileInfoLoaderPass.cpp
parent0f54bc7630065eee51739596d77d91b751c6b71d (diff)
Refactor implementations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12240 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ProfileInfoLoaderPass.cpp')
-rw-r--r--lib/Analysis/ProfileInfoLoaderPass.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/Analysis/ProfileInfoLoaderPass.cpp b/lib/Analysis/ProfileInfoLoaderPass.cpp
index dab4b0e53c..c1ff8cf563 100644
--- a/lib/Analysis/ProfileInfoLoaderPass.cpp
+++ b/lib/Analysis/ProfileInfoLoaderPass.cpp
@@ -26,7 +26,6 @@ namespace {
class LoaderPass : public Pass, public ProfileInfo {
std::string Filename;
- std::map<BasicBlock*, unsigned> ExecutionCounts;
public:
LoaderPass(const std::string &filename = "")
: Filename(filename) {
@@ -43,11 +42,6 @@ namespace {
/// run - Load the profile information from the specified file.
virtual bool run(Module &M);
-
- virtual unsigned getExecutionCount(BasicBlock *BB) {
- std::map<BasicBlock*, unsigned>::iterator I = ExecutionCounts.find(BB);
- return I != ExecutionCounts.end() ? I->second : 0;
- }
};
RegisterOpt<LoaderPass>
@@ -65,7 +59,8 @@ Pass *llvm::createProfileLoaderPass(const std::string &Filename) {
}
bool LoaderPass::run(Module &M) {
- ProfileInfoLoader PIL("opt", Filename, M);
+ ProfileInfoLoader PIL("profile-loader", Filename, M);
+ ExecutionCounts.clear();
if (PIL.hasAccurateBlockCounts()) {
std::vector<std::pair<BasicBlock*, unsigned> > Counts;
PIL.getBlockCounts(Counts);