aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2006-03-20 19:32:48 +0000
committerNate Begeman <natebegeman@mac.com>2006-03-20 19:32:48 +0000
commit26d5d16a2c8ef6c0763afbfe06c940c40c461d6e (patch)
treeac9399630f2a212a866de7a260660e54cf5a987a /include
parentbd83afd3cdaa89b8a378e92518a5aec7dc7f46c5 (diff)
downloadexternal_llvm-26d5d16a2c8ef6c0763afbfe06c940c40c461d6e.zip
external_llvm-26d5d16a2c8ef6c0763afbfe06c940c40c461d6e.tar.gz
external_llvm-26d5d16a2c8ef6c0763afbfe06c940c40c461d6e.tar.bz2
Move some common data structures between dom and pdom into the base class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26905 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/Dominators.h32
-rw-r--r--include/llvm/Analysis/PostDominators.h16
2 files changed, 16 insertions, 32 deletions
diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h
index 4b2f611..9dcabcf 100644
--- a/include/llvm/Analysis/Dominators.h
+++ b/include/llvm/Analysis/Dominators.h
@@ -66,7 +66,23 @@ public:
///
class ImmediateDominatorsBase : public DominatorBase {
protected:
+ struct InfoRec {
+ unsigned Semi;
+ unsigned Size;
+ BasicBlock *Label, *Parent, *Child, *Ancestor;
+
+ std::vector<BasicBlock*> Bucket;
+
+ InfoRec() : Semi(0), Size(0), Label(0), Parent(0), Child(0), Ancestor(0){}
+ };
+
std::map<BasicBlock*, BasicBlock*> IDoms;
+
+ // Vertex - Map the DFS number to the BasicBlock*
+ std::vector<BasicBlock*> Vertex;
+
+ // Info - Collection of information used during the computation of idoms.
+ std::map<BasicBlock*, InfoRec> Info;
public:
ImmediateDominatorsBase(bool isPostDom) : DominatorBase(isPostDom) {}
@@ -139,22 +155,6 @@ struct ImmediateDominators : public ImmediateDominatorsBase {
}
private:
- struct InfoRec {
- unsigned Semi;
- unsigned Size;
- BasicBlock *Label, *Parent, *Child, *Ancestor;
-
- std::vector<BasicBlock*> Bucket;
-
- InfoRec() : Semi(0), Size(0), Label(0), Parent(0), Child(0), Ancestor(0){}
- };
-
- // Vertex - Map the DFS number to the BasicBlock*
- std::vector<BasicBlock*> Vertex;
-
- // Info - Collection of information used during the computation of idoms.
- std::map<BasicBlock*, InfoRec> Info;
-
unsigned DFSPass(BasicBlock *V, InfoRec &VInfo, unsigned N);
void Compress(BasicBlock *V, InfoRec &VInfo);
BasicBlock *Eval(BasicBlock *v);
diff --git a/include/llvm/Analysis/PostDominators.h b/include/llvm/Analysis/PostDominators.h
index 39b26d7..b9a1feb 100644
--- a/include/llvm/Analysis/PostDominators.h
+++ b/include/llvm/Analysis/PostDominators.h
@@ -32,22 +32,6 @@ struct ImmediatePostDominators : public ImmediateDominatorsBase {
}
private:
- struct InfoRec {
- unsigned Semi;
- unsigned Size;
- BasicBlock *Label, *Parent, *Child, *Ancestor;
-
- std::vector<BasicBlock*> Bucket;
-
- InfoRec() : Semi(0), Size(0), Label(0), Parent(0), Child(0), Ancestor(0){}
- };
-
- // Vertex - Map the DFS number to the BasicBlock*
- std::vector<BasicBlock*> Vertex;
-
- // Info - Collection of information used during the computation of idoms.
- std::map<BasicBlock*, InfoRec> Info;
-
unsigned DFSPass(BasicBlock *V, InfoRec &VInfo, unsigned N);
void Compress(BasicBlock *V, InfoRec &VInfo);
BasicBlock *Eval(BasicBlock *v);