mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 05:29:24 +00:00
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:
parent
bd83afd3cd
commit
26d5d16a2c
@ -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…
Reference in New Issue
Block a user