summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-06-25 16:13:24 +0000
committerChris Lattner <sabre@nondot.org>2002-06-25 16:13:24 +0000
commit7e70829632f82de15db187845666aaca6e04b792 (patch)
tree48dd2d804e7ebec9a3cbd8bf229cb2a2aa20dce5 /include/llvm/Analysis
parent0b12b5f50ec77a8bd01b92d287c52d748619bb4b (diff)
downloadllvm-7e70829632f82de15db187845666aaca6e04b792.tar.gz
llvm-7e70829632f82de15db187845666aaca6e04b792.tar.bz2
llvm-7e70829632f82de15db187845666aaca6e04b792.tar.xz
MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2779 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis')
-rw-r--r--include/llvm/Analysis/CallGraph.h2
-rw-r--r--include/llvm/Analysis/DataStructure.h2
-rw-r--r--include/llvm/Analysis/DataStructure/DataStructure.h2
-rw-r--r--include/llvm/Analysis/Dominators.h12
-rw-r--r--include/llvm/Analysis/FindUnsafePointerTypes.h2
-rw-r--r--include/llvm/Analysis/FindUsedTypes.h2
-rw-r--r--include/llvm/Analysis/InstForest.h14
-rw-r--r--include/llvm/Analysis/IntervalIterator.h2
-rw-r--r--include/llvm/Analysis/IntervalPartition.h2
-rw-r--r--include/llvm/Analysis/LoopInfo.h10
-rw-r--r--include/llvm/Analysis/Verifier.h4
11 files changed, 25 insertions, 29 deletions
diff --git a/include/llvm/Analysis/CallGraph.h b/include/llvm/Analysis/CallGraph.h
index d44fa5fc3a..d8fadc1c5f 100644
--- a/include/llvm/Analysis/CallGraph.h
+++ b/include/llvm/Analysis/CallGraph.h
@@ -118,7 +118,7 @@ public:
virtual const char *getPassName() const { return "Call Graph Construction"; }
// run - Compute the call graph for the specified module.
- virtual bool run(Module *TheModule);
+ virtual bool run(Module &M);
// getAnalysisUsage - This obviously provides a call graph
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
diff --git a/include/llvm/Analysis/DataStructure.h b/include/llvm/Analysis/DataStructure.h
index f6b60b8386..5f1617c0a0 100644
--- a/include/llvm/Analysis/DataStructure.h
+++ b/include/llvm/Analysis/DataStructure.h
@@ -442,7 +442,7 @@ public:
virtual const char *getPassName() const { return "Data Structure Analysis"; }
// run - Do nothing, because methods are analyzed lazily
- virtual bool run(Module *TheModule) { return false; }
+ virtual bool run(Module &TheModule) { return false; }
// getDSGraph - Return the data structure graph for the specified method.
// Since method graphs are lazily computed, we may have to create one on the
diff --git a/include/llvm/Analysis/DataStructure/DataStructure.h b/include/llvm/Analysis/DataStructure/DataStructure.h
index f6b60b8386..5f1617c0a0 100644
--- a/include/llvm/Analysis/DataStructure/DataStructure.h
+++ b/include/llvm/Analysis/DataStructure/DataStructure.h
@@ -442,7 +442,7 @@ public:
virtual const char *getPassName() const { return "Data Structure Analysis"; }
// run - Do nothing, because methods are analyzed lazily
- virtual bool run(Module *TheModule) { return false; }
+ virtual bool run(Module &TheModule) { return false; }
// getDSGraph - Return the data structure graph for the specified method.
// Since method graphs are lazily computed, we may have to create one on the
diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h
index 796a779087..f5a7b764e9 100644
--- a/include/llvm/Analysis/Dominators.h
+++ b/include/llvm/Analysis/Dominators.h
@@ -53,8 +53,8 @@ public:
private:
DomSetMapType Doms;
- void calcForwardDominatorSet(Function *F);
- void calcPostDominatorSet(Function *F);
+ void calcForwardDominatorSet(Function &F);
+ void calcPostDominatorSet(Function &F);
public:
// DominatorSet ctor - Build either the dominator set or the post-dominator
// set for a function...
@@ -69,7 +69,7 @@ public:
else return "Dominator Set Construction";
}
- virtual bool runOnFunction(Function *F);
+ virtual bool runOnFunction(Function &F);
// Accessor interface:
typedef DomSetMapType::const_iterator const_iterator;
@@ -132,7 +132,7 @@ public:
else return "Immediate Dominators Construction";
}
- virtual bool runOnFunction(Function *F) {
+ virtual bool runOnFunction(Function &F) {
IDoms.clear(); // Reset from the last time we were run...
DominatorSet *DS;
if (isPostDominator())
@@ -228,7 +228,7 @@ public:
else return "Dominator Tree Construction";
}
- virtual bool runOnFunction(Function *F) {
+ virtual bool runOnFunction(Function &F) {
reset();
DominatorSet *DS;
if (isPostDominator())
@@ -289,7 +289,7 @@ public:
else return "Dominance Frontier Construction";
}
- virtual bool runOnFunction(Function *) {
+ virtual bool runOnFunction(Function &) {
Frontiers.clear();
DominatorTree *DT;
if (isPostDominator())
diff --git a/include/llvm/Analysis/FindUnsafePointerTypes.h b/include/llvm/Analysis/FindUnsafePointerTypes.h
index 98f530caaa..d88b59ac2d 100644
--- a/include/llvm/Analysis/FindUnsafePointerTypes.h
+++ b/include/llvm/Analysis/FindUnsafePointerTypes.h
@@ -41,7 +41,7 @@ public:
// values of various types. If they are deemed to be 'unsafe' note that the
// type is not safe to transform.
//
- virtual bool run(Module *M);
+ virtual bool run(Module &M);
// printResults - Loop over the results of the analysis, printing out unsafe
// types.
diff --git a/include/llvm/Analysis/FindUsedTypes.h b/include/llvm/Analysis/FindUsedTypes.h
index ece390e489..55937d753c 100644
--- a/include/llvm/Analysis/FindUsedTypes.h
+++ b/include/llvm/Analysis/FindUsedTypes.h
@@ -51,7 +51,7 @@ private:
public:
// run - This incorporates all types used by the specified module
//
- bool run(Module *M);
+ bool run(Module &M);
// getAnalysisUsage - Of course, we provide ourself...
//
diff --git a/include/llvm/Analysis/InstForest.h b/include/llvm/Analysis/InstForest.h
index 6e19c3745a..f48466b5de 100644
--- a/include/llvm/Analysis/InstForest.h
+++ b/include/llvm/Analysis/InstForest.h
@@ -162,22 +162,18 @@ class InstForest : public std::vector<InstTreeNode<Payload> *> {
public:
// ctor - Create an instruction forest for the specified method...
InstForest(Function *F) {
- for (Function::iterator MI = F->begin(), ME = F->end(); MI != ME; ++MI) {
- BasicBlock *BB = *MI;
- for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) {
- Instruction *Inst = *I;
- if (!getInstNode(Inst)) { // Do we already have a tree for this inst?
+ for (Function::iterator BB = F->begin(), BBE = F->end(); BB != BBE; ++BB)
+ for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
+ if (!getInstNode(I)) { // Do we already have a tree for this inst?
// No, create one! InstTreeNode ctor automatically adds the
// created node into our InstMap
- push_back(new InstTreeNode<Payload>(*this, Inst, 0));
+ push_back(new InstTreeNode<Payload>(*this, I, 0));
}
- }
- }
}
// dtor - Free the trees...
~InstForest() {
- for (unsigned i = size(); i > 0; --i)
+ for (unsigned i = size(); i != 0; --i)
delete operator[](i-1);
}
diff --git a/include/llvm/Analysis/IntervalIterator.h b/include/llvm/Analysis/IntervalIterator.h
index 64c1b60b07..5417aa74dc 100644
--- a/include/llvm/Analysis/IntervalIterator.h
+++ b/include/llvm/Analysis/IntervalIterator.h
@@ -93,7 +93,7 @@ public:
IntervalIterator() {} // End iterator, empty stack
IntervalIterator(Function *M, bool OwnMemory) : IOwnMem(OwnMemory) {
OrigContainer = M;
- if (!ProcessInterval(M->front())) {
+ if (!ProcessInterval(&M->front())) {
assert(0 && "ProcessInterval should never fail for first interval!");
}
}
diff --git a/include/llvm/Analysis/IntervalPartition.h b/include/llvm/Analysis/IntervalPartition.h
index ab16250e83..bf7228606f 100644
--- a/include/llvm/Analysis/IntervalPartition.h
+++ b/include/llvm/Analysis/IntervalPartition.h
@@ -42,7 +42,7 @@ public:
const char *getPassName() const { return "Interval Partition Construction"; }
// run - Calculate the interval partition for this function
- virtual bool runOnFunction(Function *F);
+ virtual bool runOnFunction(Function &F);
// IntervalPartition ctor - Build a reduced interval partition from an
// existing interval graph. This takes an additional boolean parameter to
diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h
index 16605e5a52..d5721ae6a0 100644
--- a/include/llvm/Analysis/LoopInfo.h
+++ b/include/llvm/Analysis/LoopInfo.h
@@ -79,16 +79,16 @@ public:
// getLoopFor - Return the inner most loop that BB lives in. If a basic block
// is in no loop (for example the entry node), null is returned.
//
- const Loop *getLoopFor(BasicBlock *BB) const {
- std::map<BasicBlock *, Loop*>::const_iterator I = BBMap.find(BB);
+ const Loop *getLoopFor(const BasicBlock *BB) const {
+ std::map<BasicBlock *, Loop*>::const_iterator I=BBMap.find((BasicBlock*)BB);
return I != BBMap.end() ? I->second : 0;
}
- inline const Loop *operator[](BasicBlock *BB) const {
+ inline const Loop *operator[](const BasicBlock *BB) const {
return getLoopFor(BB);
}
// getLoopDepth - Return the loop nesting level of the specified block...
- unsigned getLoopDepth(BasicBlock *BB) const {
+ unsigned getLoopDepth(const BasicBlock *BB) const {
const Loop *L = getLoopFor(BB);
return L ? L->getLoopDepth() : 0;
}
@@ -105,7 +105,7 @@ public:
#endif
// runOnFunction - Pass framework implementation
- virtual bool runOnFunction(Function *F);
+ virtual bool runOnFunction(Function &F);
virtual void releaseMemory();
diff --git a/include/llvm/Analysis/Verifier.h b/include/llvm/Analysis/Verifier.h
index 03de4baa6e..76aea047ba 100644
--- a/include/llvm/Analysis/Verifier.h
+++ b/include/llvm/Analysis/Verifier.h
@@ -25,10 +25,10 @@ Pass *createVerifierPass();
// verifyModule - Check a module for errors, printing messages on stderr.
// Return true if the module is corrupt.
//
-bool verifyModule(const Module *M);
+bool verifyModule(const Module &M);
// verifyFunction - Check a function for errors, useful for use when debugging a
// pass.
-bool verifyFunction(const Function *F);
+bool verifyFunction(const Function &F);
#endif