mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-16 14:31:59 +00:00
Expose API to graph library to allow iteration over all nodes, even unreachable ones
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4111 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ab363148fb
commit
f77b57097d
@ -10,7 +10,6 @@
|
||||
|
||||
#include "Support/GraphTraits.h"
|
||||
#include "llvm/Function.h"
|
||||
#include "llvm/BasicBlock.h"
|
||||
#include "llvm/InstrTypes.h"
|
||||
#include "Support/iterator"
|
||||
|
||||
@ -220,10 +219,20 @@ template <> struct GraphTraits<Inverse<const BasicBlock*> > {
|
||||
//
|
||||
template <> struct GraphTraits<Function*> : public GraphTraits<BasicBlock*> {
|
||||
static NodeType *getEntryNode(Function *F) { return &F->getEntryNode(); }
|
||||
|
||||
// nodes_iterator/begin/end - Allow iteration over all nodes in the graph
|
||||
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(); }
|
||||
};
|
||||
template <> struct GraphTraits<const Function*> :
|
||||
public GraphTraits<const BasicBlock*> {
|
||||
static NodeType *getEntryNode(const Function *F) { return &F->getEntryNode();}
|
||||
|
||||
// nodes_iterator/begin/end - Allow iteration over all nodes in the graph
|
||||
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(); }
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user