Skip to content

Commit

Permalink
Apply fix for PR5135, Credit to Andreas Neustifter.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85779 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
eocallaghan committed Nov 2, 2009
1 parent 8db5012 commit 2afd072
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/Analysis/ProfileInfoLoaderPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace {
// recurseBasicBlock() - Calculates the edge weights for as much basic
// blocks as possbile.
virtual void recurseBasicBlock(const BasicBlock *BB);
virtual void readEdgeOrRemember(Edge, Edge&, unsigned &, unsigned &);
virtual void readEdgeOrRemember(Edge, Edge&, unsigned &, double &);
virtual void readEdge(ProfileInfo::Edge, std::vector<unsigned>&);

/// run - Load the profile information from the specified file.
Expand All @@ -84,7 +84,7 @@ Pass *llvm::createProfileLoaderPass(const std::string &Filename) {
}

void LoaderPass::readEdgeOrRemember(Edge edge, Edge &tocalc,
unsigned &uncalc, unsigned &count) {
unsigned &uncalc, double &count) {
double w;
if ((w = getEdgeWeight(edge)) == MissingValue) {
tocalc = edge;
Expand Down Expand Up @@ -117,7 +117,7 @@ void LoaderPass::recurseBasicBlock(const BasicBlock *BB) {

// collect weights of all incoming and outgoing edges, rememer edges that
// have no value
unsigned incount = 0;
double incount = 0;
SmallSet<const BasicBlock*,8> pred_visited;
pred_const_iterator bbi = pred_begin(BB), bbe = pred_end(BB);
if (bbi==bbe) {
Expand All @@ -129,7 +129,7 @@ void LoaderPass::recurseBasicBlock(const BasicBlock *BB) {
}
}

unsigned outcount = 0;
double outcount = 0;
SmallSet<const BasicBlock*,8> succ_visited;
succ_const_iterator sbbi = succ_begin(BB), sbbe = succ_end(BB);
if (sbbi==sbbe) {
Expand Down
3 changes: 2 additions & 1 deletion lib/Analysis/ProfileVerifierPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ void ProfileVerifierPass::recurseBasicBlock(const BasicBlock *BB) {
// to debug printers.
DetailedBlockInfo DI;
DI.BB = BB;
DI.outCount = DI.inCount = DI.inWeight = DI.outWeight = 0;
DI.outCount = DI.inCount = 0;
DI.inWeight = DI.outWeight = 0.0;

// Read predecessors.
std::set<const BasicBlock*> ProcessedPreds;
Expand Down

0 comments on commit 2afd072

Please sign in to comment.