Deleted Added
full compact
CFG.h (224145) CFG.h (234353)
1//===-- llvm/Support/CFG.h - Process LLVM structures as graphs --*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 57 unchanged lines hidden (view full) ---

66 Self tmp = *this; ++*this; return tmp;
67 }
68
69 /// getOperandNo - Return the operand number in the predecessor's
70 /// terminator of the successor.
71 unsigned getOperandNo() const {
72 return It.getOperandNo();
73 }
1//===-- llvm/Support/CFG.h - Process LLVM structures as graphs --*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 57 unchanged lines hidden (view full) ---

66 Self tmp = *this; ++*this; return tmp;
67 }
68
69 /// getOperandNo - Return the operand number in the predecessor's
70 /// terminator of the successor.
71 unsigned getOperandNo() const {
72 return It.getOperandNo();
73 }
74
75 /// getUse - Return the operand Use in the predecessor's terminator
76 /// of the successor.
77 Use &getUse() const {
78 return It.getUse();
79 }
74};
75
76typedef PredIterator<BasicBlock, Value::use_iterator> pred_iterator;
77typedef PredIterator<const BasicBlock,
78 Value::const_use_iterator> const_pred_iterator;
79
80inline pred_iterator pred_begin(BasicBlock *BB) { return pred_iterator(BB); }
81inline const_pred_iterator pred_begin(const BasicBlock *BB) {

--- 227 unchanged lines hidden (view full) ---

309//
310template <> struct GraphTraits<Function*> : public GraphTraits<BasicBlock*> {
311 static NodeType *getEntryNode(Function *F) { return &F->getEntryBlock(); }
312
313 // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
314 typedef Function::iterator nodes_iterator;
315 static nodes_iterator nodes_begin(Function *F) { return F->begin(); }
316 static nodes_iterator nodes_end (Function *F) { return F->end(); }
80};
81
82typedef PredIterator<BasicBlock, Value::use_iterator> pred_iterator;
83typedef PredIterator<const BasicBlock,
84 Value::const_use_iterator> const_pred_iterator;
85
86inline pred_iterator pred_begin(BasicBlock *BB) { return pred_iterator(BB); }
87inline const_pred_iterator pred_begin(const BasicBlock *BB) {

--- 227 unchanged lines hidden (view full) ---

315//
316template <> struct GraphTraits<Function*> : public GraphTraits<BasicBlock*> {
317 static NodeType *getEntryNode(Function *F) { return &F->getEntryBlock(); }
318
319 // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
320 typedef Function::iterator nodes_iterator;
321 static nodes_iterator nodes_begin(Function *F) { return F->begin(); }
322 static nodes_iterator nodes_end (Function *F) { return F->end(); }
323 static unsigned size (Function *F) { return F->size(); }
317};
318template <> struct GraphTraits<const Function*> :
319 public GraphTraits<const BasicBlock*> {
320 static NodeType *getEntryNode(const Function *F) {return &F->getEntryBlock();}
321
322 // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
323 typedef Function::const_iterator nodes_iterator;
324 static nodes_iterator nodes_begin(const Function *F) { return F->begin(); }
325 static nodes_iterator nodes_end (const Function *F) { return F->end(); }
324};
325template <> struct GraphTraits<const Function*> :
326 public GraphTraits<const BasicBlock*> {
327 static NodeType *getEntryNode(const Function *F) {return &F->getEntryBlock();}
328
329 // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
330 typedef Function::const_iterator nodes_iterator;
331 static nodes_iterator nodes_begin(const Function *F) { return F->begin(); }
332 static nodes_iterator nodes_end (const Function *F) { return F->end(); }
333 static unsigned size (const Function *F) { return F->size(); }
326};
327
328
329// Provide specializations of GraphTraits to be able to treat a function as a
330// graph of basic blocks... and to walk it in inverse order. Inverse order for
331// a function is considered to be when traversing the predecessor edges of a BB
332// instead of the successor edges.
333//

--- 16 unchanged lines hidden ---
334};
335
336
337// Provide specializations of GraphTraits to be able to treat a function as a
338// graph of basic blocks... and to walk it in inverse order. Inverse order for
339// a function is considered to be when traversing the predecessor edges of a BB
340// instead of the successor edges.
341//

--- 16 unchanged lines hidden ---