mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
Change the Dominators recalculate() function to only rely on GraphTraits
This is a patch by Guoping Long! As part of utilizing LLVM Dominator computation in Clang, made two changes to LLVM dominators tree implementation: - (1) Change the recalculate() template function to only rely on GraphTraits. - (2) Add a size() method to GraphTraits template class to query the number of nodes in the graph. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145837 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -314,6 +314,7 @@ template <> struct GraphTraits<Function*> : public GraphTraits<BasicBlock*> {
|
||||
typedef Function::iterator nodes_iterator;
|
||||
static nodes_iterator nodes_begin(Function *F) { return F->begin(); }
|
||||
static nodes_iterator nodes_end (Function *F) { return F->end(); }
|
||||
static unsigned size (Function *F) { return F->size(); }
|
||||
};
|
||||
template <> struct GraphTraits<const Function*> :
|
||||
public GraphTraits<const BasicBlock*> {
|
||||
@@ -323,6 +324,7 @@ template <> struct GraphTraits<const Function*> :
|
||||
typedef Function::const_iterator nodes_iterator;
|
||||
static nodes_iterator nodes_begin(const Function *F) { return F->begin(); }
|
||||
static nodes_iterator nodes_end (const Function *F) { return F->end(); }
|
||||
static unsigned size (const Function *F) { return F->size(); }
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user