aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2005-04-21 23:48:37 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2005-04-21 23:48:37 +0000
commitfd93908ae8b9684fe71c239e3c6cfe13ff6a2663 (patch)
tree4d0726d997a629d08765d11a705a42c4f48690af /lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp
parent0e0a7a45d3d0a8c865a078459d2e1c6d8967a100 (diff)
Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21427 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp')
-rw-r--r--lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp b/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp
index 500208756a..fc828977f6 100644
--- a/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp
+++ b/lib/Transforms/Instrumentation/ProfilePaths/InstLoops.cpp
@@ -1,10 +1,10 @@
//===-- InstLoops.cpp -----------------------------------------------------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This is the first-level instrumentation pass for the Reoptimizer. It
@@ -46,7 +46,7 @@ namespace {
DominatorSet *DS;
void getBackEdgesVisit(BasicBlock *u,
std::map<BasicBlock *, Color > &color,
- std::map<BasicBlock *, int > &d,
+ std::map<BasicBlock *, int > &d,
int &time, BBMap &be);
void removeRedundant(BBMap &be);
void findAndInstrumentBackEdges(Function &F);
@@ -54,15 +54,15 @@ namespace {
bool doInitialization(Module &M);
bool runOnFunction(Function &F);
};
-
+
RegisterOpt<InstLoops> X("instloops", "Instrument backedges for profiling");
}
-//helper function to get back edges: it is called by
+//helper function to get back edges: it is called by
//the "getBackEdges" function below
void InstLoops::getBackEdgesVisit(BasicBlock *u,
std::map<BasicBlock *, Color > &color,
- std::map<BasicBlock *, int > &d,
+ std::map<BasicBlock *, int > &d,
int &time, BBMap &be) {
color[u]=GREY;
time++;
@@ -74,7 +74,7 @@ void InstLoops::getBackEdgesVisit(BasicBlock *u,
if(color[BB]!=GREY && color[BB]!=BLACK){
getBackEdgesVisit(BB, color, d, time, be);
}
-
+
//now checking for d and f vals
else if(color[BB]==GREY){
//so v is ancestor of u if time of u > time of v
@@ -91,13 +91,13 @@ void InstLoops::getBackEdgesVisit(BasicBlock *u,
//set
void InstLoops::removeRedundant(BBMap &be) {
std::vector<BasicBlock *> toDelete;
- for(std::map<BasicBlock *, BasicBlock *>::iterator MI = be.begin(),
+ for(std::map<BasicBlock *, BasicBlock *>::iterator MI = be.begin(),
ME = be.end(); MI != ME; ++MI)
for(BBMap::iterator MMI = be.begin(), MME = be.end(); MMI != MME; ++MMI)
if(DS->properlyDominates(MI->first, MMI->first))
toDelete.push_back(MMI->first);
// Remove all the back-edges we found from be.
- for(std::vector<BasicBlock *>::iterator VI = toDelete.begin(),
+ for(std::vector<BasicBlock *>::iterator VI = toDelete.begin(),
VE = toDelete.end(); VI != VE; ++VI)
be.erase(*VI);
}
@@ -137,14 +137,14 @@ void InstLoops::findAndInstrumentBackEdges(Function &F){
assert(ti->getNumSuccessors() > index && "Not enough successors!");
ti->setSuccessor(index, newBB);
-
+
BasicBlock::InstListType &lt = newBB->getInstList();
lt.push_back(new CallInst(inCountMth));
new BranchInst(BB, newBB);
-
+
// Now, set the sources of Phi nodes corresponding to the back-edge
// in BB to come from the instrumentation block instead.
- for(BasicBlock::iterator BB2Inst = BB->begin(), BBend = BB->end();
+ for(BasicBlock::iterator BB2Inst = BB->begin(), BBend = BB->end();
BB2Inst != BBend; ++BB2Inst) {
if (PHINode *phiInst = dyn_cast<PHINode>(BB2Inst)) {
int bbIndex = phiInst->getBasicBlockIndex(u);