summaryrefslogtreecommitdiffstats
path: root/llvm
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
commitbd481d588a3c59074c4f652fb7e2d40d3b5cdba9 (patch)
treeafa318ffe6309b946008bf7eed4595b6826603c4 /llvm
parent755ffeb2924b2c773976ecea07a06a7cd519a9ef (diff)
downloadbcm5719-llvm-bd481d588a3c59074c4f652fb7e2d40d3b5cdba9.tar.gz
bcm5719-llvm-bd481d588a3c59074c4f652fb7e2d40d3b5cdba9.zip
Refactor implementations
llvm-svn: 12240
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Analysis/ProfileInfo.cpp4
-rw-r--r--llvm/lib/Analysis/ProfileInfoLoaderPass.cpp9
2 files changed, 3 insertions, 10 deletions
diff --git a/llvm/lib/Analysis/ProfileInfo.cpp b/llvm/lib/Analysis/ProfileInfo.cpp
index 09bb1dfca13..a96dc4f2fc6 100644
--- a/llvm/lib/Analysis/ProfileInfo.cpp
+++ b/llvm/lib/Analysis/ProfileInfo.cpp
@@ -29,9 +29,7 @@ ProfileInfo::~ProfileInfo() {}
//
namespace {
- struct NoProfileInfo : public ImmutablePass, public ProfileInfo {
- unsigned getExecutionCount(BasicBlock *BB) { return 0; }
- };
+ struct NoProfileInfo : public ImmutablePass, public ProfileInfo {};
// Register this pass...
RegisterOpt<NoProfileInfo>
diff --git a/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp b/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp
index dab4b0e53c5..c1ff8cf5631 100644
--- a/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud