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
This commit is contained in:
Nate Begeman 2006-03-20 19:32:48 +00:00
parent bd83afd3cd
commit 26d5d16a2c
2 changed files with 16 additions and 32 deletions

View File

@ -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);

View File

@ -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);