mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
Move some common data structures between dom and pdom into the base class
llvm-svn: 26905
This commit is contained in:
parent
978628896b
commit
31da564faa
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user