summaryrefslogtreecommitdiffstats
path: root/include/llvm/BasicBlock.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-02-12 21:02:38 +0000
committerChris Lattner <sabre@nondot.org>2002-02-12 21:02:38 +0000
commit9aa4142dad5316aed1ee1014b6bc1977092ce9fb (patch)
tree84f7c01511624cef3a7015d195b9e293d61652bb /include/llvm/BasicBlock.h
parent0af83c6ed278ada0c7fc49e5445d639ecf558801 (diff)
downloadexternal_llvm-9aa4142dad5316aed1ee1014b6bc1977092ce9fb.zip
external_llvm-9aa4142dad5316aed1ee1014b6bc1977092ce9fb.tar.gz
external_llvm-9aa4142dad5316aed1ee1014b6bc1977092ce9fb.tar.bz2
* Move BasicBlock and Method graph stuff to new "llvm/Support/CFG.h" file
* Move Method::inst_* to new "llvm/Support/InstIterator.h" file * Method.h no longer #includes BasicBlock.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1743 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/BasicBlock.h')
-rw-r--r--include/llvm/BasicBlock.h72
1 files changed, 1 insertions, 71 deletions
diff --git a/include/llvm/BasicBlock.h b/include/llvm/BasicBlock.h
index b846a84..bcaf1cf 100644
--- a/include/llvm/BasicBlock.h
+++ b/include/llvm/BasicBlock.h
@@ -3,11 +3,9 @@
// This file contains the declaration of the BasicBlock class, which represents
// a single basic block in the VM.
//
-// Note that basic blocks themselves are Def's, because they are referenced
+// Note that basic blocks themselves are Value's, because they are referenced
// by instructions like branches and can go in switch tables and stuff...
//
-// This may see wierd at first, but it's really pretty cool. :)
-//
//===----------------------------------------------------------------------===//
//
// Note that well formed basic blocks are formed of a list of instructions
@@ -24,7 +22,6 @@
#include "llvm/ValueHolder.h"
#include "llvm/InstrTypes.h"
-#include "Support/GraphTraits.h"
#include <iterator>
class Instruction;
@@ -253,71 +250,4 @@ public:
}
};
-
-//===--------------------------------------------------------------------===//
-// GraphTraits specializations for basic block graphs (CFGs)
-//===--------------------------------------------------------------------===//
-
-// Provide specializations of GraphTraits to be able to treat a method as a
-// graph of basic blocks...
-
-template <> struct GraphTraits<BasicBlock*> {
- typedef BasicBlock NodeType;
- typedef BasicBlock::succ_iterator ChildIteratorType;
-
- static NodeType *getEntryNode(BasicBlock *BB) { return BB; }
- static inline ChildIteratorType child_begin(NodeType *N) {
- return N->succ_begin();
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return N->succ_end();
- }
-};
-
-template <> struct GraphTraits<const BasicBlock*> {
- typedef const BasicBlock NodeType;
- typedef BasicBlock::succ_const_iterator ChildIteratorType;
-
- static NodeType *getEntryNode(const BasicBlock *BB) { return BB; }
-
- static inline ChildIteratorType child_begin(NodeType *N) {
- return N->succ_begin();
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return N->succ_end();
- }
-};
-
-// Provide specializations of GraphTraits to be able to treat a method as a
-// graph of basic blocks... and to walk it in inverse order. Inverse order for
-// a method is considered to be when traversing the predecessor edges of a BB
-// instead of the successor edges.
-//
-template <> struct GraphTraits<Inverse<BasicBlock*> > {
- typedef BasicBlock NodeType;
- typedef BasicBlock::pred_iterator ChildIteratorType;
- static NodeType *getEntryNode(Inverse<BasicBlock *> G) { return G.Graph; }
- static inline ChildIteratorType child_begin(NodeType *N) {
- return N->pred_begin();
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return N->pred_end();
- }
-};
-
-template <> struct GraphTraits<Inverse<const BasicBlock*> > {
- typedef const BasicBlock NodeType;
- typedef BasicBlock::pred_const_iterator ChildIteratorType;
- static NodeType *getEntryNode(Inverse<const BasicBlock*> G) {
- return G.Graph;
- }
- static inline ChildIteratorType child_begin(NodeType *N) {
- return N->pred_begin();
- }
- static inline ChildIteratorType child_end(NodeType *N) {
- return N->pred_end();
- }
-};
-
-
#endif