aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/IntervalIterator.h20
-rw-r--r--include/llvm/Support/CFG.h38
-rw-r--r--include/llvm/Support/InstIterator.h25
-rw-r--r--include/llvm/Transforms/Scalar/DCE.h4
4 files changed, 45 insertions, 42 deletions
diff --git a/include/llvm/Analysis/IntervalIterator.h b/include/llvm/Analysis/IntervalIterator.h
index 3c27f1ae8b..55413d4ada 100644
--- a/include/llvm/Analysis/IntervalIterator.h
+++ b/include/llvm/Analysis/IntervalIterator.h
@@ -4,7 +4,7 @@
// graph of some sort. This iterator is parametric, allowing iterator over the
// following types of graphs:
//
-// 1. A Method* object, composed of BasicBlock nodes.
+// 1. A Function* object, composed of BasicBlock nodes.
// 2. An IntervalPartition& object, composed of Interval nodes.
//
// This iterator is defined to walk the control flow graph, returning intervals
@@ -27,7 +27,7 @@
#define LLVM_INTERVAL_ITERATOR_H
#include "llvm/Analysis/IntervalPartition.h"
-#include "llvm/Method.h"
+#include "llvm/Function.h"
#include "llvm/BasicBlock.h"
#include "llvm/Support/CFG.h"
#include <stack>
@@ -47,7 +47,7 @@ inline BasicBlock *getNodeHeader(Interval *I) { return I->getHeaderNode(); }
// source graph node that corresponds to the BasicBlock. This is the opposite
// of getNodeHeader.
//
-inline BasicBlock *getSourceGraphNode(Method *, BasicBlock *BB) {
+inline BasicBlock *getSourceGraphNode(Function *, BasicBlock *BB) {
return BB;
}
inline Interval *getSourceGraphNode(IntervalPartition *IP, BasicBlock *BB) {
@@ -93,7 +93,7 @@ public:
typedef std::forward_iterator_tag iterator_category;
IntervalIterator() {} // End iterator, empty stack
- IntervalIterator(Method *M, bool OwnMemory) : IOwnMem(OwnMemory) {
+ IntervalIterator(Function *M, bool OwnMemory) : IOwnMem(OwnMemory) {
OrigContainer = M;
if (!ProcessInterval(M->front())) {
assert(0 && "ProcessInterval should never fail for first interval!");
@@ -227,16 +227,16 @@ private:
}
};
-typedef IntervalIterator<BasicBlock, Method> method_interval_iterator;
+typedef IntervalIterator<BasicBlock, Function> function_interval_iterator;
typedef IntervalIterator<Interval, IntervalPartition> interval_part_interval_iterator;
-inline method_interval_iterator intervals_begin(Method *M,
- bool DeleteInts = true) {
- return method_interval_iterator(M, DeleteInts);
+inline function_interval_iterator intervals_begin(Function *F,
+ bool DeleteInts = true) {
+ return function_interval_iterator(F, DeleteInts);
}
-inline method_interval_iterator intervals_end(Method *M) {
- return method_interval_iterator();
+inline function_interval_iterator intervals_end(Function *) {
+ return function_interval_iterator();
}
inline interval_part_interval_iterator
diff --git a/include/llvm/Support/CFG.h b/include/llvm/Support/CFG.h
index b6aa56e385..db4c0c322e 100644
--- a/include/llvm/Support/CFG.h
+++ b/include/llvm/Support/CFG.h
@@ -1,6 +1,6 @@
//===-- llvm/Support/CFG.h - Process LLVM structures as graphs ---*- C++ -*--=//
//
-// This file defines specializations of GraphTraits that allow Methods and
+// This file defines specializations of GraphTraits that allow Function and
// BasicBlock graphs to be treated as proper graphs for generic algorithms.
//
//===----------------------------------------------------------------------===//
@@ -9,7 +9,7 @@
#define LLVM_CFG_H
#include "Support/GraphTraits.h"
-#include "llvm/Method.h"
+#include "llvm/Function.h"
#include "llvm/BasicBlock.h"
#include "llvm/InstrTypes.h"
#include <iterator>
@@ -137,7 +137,7 @@ inline succ_const_iterator succ_end(const BasicBlock *BB) {
// GraphTraits specializations for basic block graphs (CFGs)
//===--------------------------------------------------------------------===//
-// Provide specializations of GraphTraits to be able to treat a method as a
+// Provide specializations of GraphTraits to be able to treat a function as a
// graph of basic blocks...
template <> struct GraphTraits<BasicBlock*> {
@@ -167,9 +167,9 @@ template <> struct GraphTraits<const BasicBlock*> {
}
};
-// Provide specializations of GraphTraits to be able to treat a method as a
+// Provide specializations of GraphTraits to be able to treat a function 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
+// a function is considered to be when traversing the predecessor edges of a BB
// instead of the successor edges.
//
template <> struct GraphTraits<Inverse<BasicBlock*> > {
@@ -201,34 +201,36 @@ template <> struct GraphTraits<Inverse<const BasicBlock*> > {
//===--------------------------------------------------------------------===//
-// GraphTraits specializations for method basic block graphs (CFGs)
+// GraphTraits specializations for function basic block graphs (CFGs)
//===--------------------------------------------------------------------===//
-// Provide specializations of GraphTraits to be able to treat a method as a
+// Provide specializations of GraphTraits to be able to treat a function as a
// graph of basic blocks... these are the same as the basic block iterators,
-// except that the root node is implicitly the first node of the method.
+// except that the root node is implicitly the first node of the function.
//
-template <> struct GraphTraits<Method*> : public GraphTraits<BasicBlock*> {
- static NodeType *getEntryNode(Method *M) { return M->front(); }
+template <> struct GraphTraits<Function*> : public GraphTraits<BasicBlock*> {
+ static NodeType *getEntryNode(Function *F) { return F->getEntryNode(); }
};
-template <> struct GraphTraits<const Method*> :
+template <> struct GraphTraits<const Function*> :
public GraphTraits<const BasicBlock*> {
- static NodeType *getEntryNode(const Method *M) { return M->front(); }
+ static NodeType *getEntryNode(const Function *F) { return F->getEntryNode(); }
};
-// Provide specializations of GraphTraits to be able to treat a method as a
+// Provide specializations of GraphTraits to be able to treat a function 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
+// a function is considered to be when traversing the predecessor edges of a BB
// instead of the successor edges.
//
-template <> struct GraphTraits<Inverse<Method*> > :
+template <> struct GraphTraits<Inverse<Function*> > :
public GraphTraits<Inverse<BasicBlock*> > {
- static NodeType *getEntryNode(Inverse<Method *> G) { return G.Graph->front();}
+ static NodeType *getEntryNode(Inverse<Function*> G) {
+ return G.Graph->front();
+ }
};
-template <> struct GraphTraits<Inverse<const Method*> > :
+template <> struct GraphTraits<Inverse<const Function*> > :
public GraphTraits<Inverse<const BasicBlock*> > {
- static NodeType *getEntryNode(Inverse<const Method *> G) {
+ static NodeType *getEntryNode(Inverse<const Function *> G) {
return G.Graph->front();
}
};
diff --git a/include/llvm/Support/InstIterator.h b/include/llvm/Support/InstIterator.h
index 517e6d26a4..b2b1058056 100644
--- a/include/llvm/Support/InstIterator.h
+++ b/include/llvm/Support/InstIterator.h
@@ -1,7 +1,7 @@
//===-- llvm/Support/InstIterator.h - Classes for inst iteration -*- C++ -*--=//
//
// This file contains definitions of two iterators for iterating over the
-// instructions in a method. This is effectively a wrapper around a two level
+// instructions in a function. This is effectively a wrapper around a two level
// iterator that can probably be genericized later.
//
// Note that this iterator gets invalidated any time that basic blocks or
@@ -13,7 +13,7 @@
#define LLVM_INST_ITERATOR_H
#include "llvm/BasicBlock.h"
-#include "llvm/Method.h"
+#include "llvm/Function.h"
// This class is implements inst_begin() & inst_end() for
// inst_iterator and const_inst_iterator's.
@@ -96,20 +96,21 @@ private:
};
-typedef InstIterator<ValueHolder<BasicBlock, Method, Method>, Method::iterator,
- BasicBlock::iterator, Instruction*> inst_iterator;
-typedef InstIterator<const ValueHolder<BasicBlock, Method, Method>,
- Method::const_iterator,
+typedef InstIterator<ValueHolder<BasicBlock, Function, Function>,
+ Function::iterator, BasicBlock::iterator,
+ Instruction*> inst_iterator;
+typedef InstIterator<const ValueHolder<BasicBlock, Function, Function>,
+ Function::const_iterator,
BasicBlock::const_iterator,
const Instruction*> const_inst_iterator;
-inline inst_iterator inst_begin(Method *M) { return inst_iterator(*M); }
-inline inst_iterator inst_end(Method *M) { return inst_iterator(*M, true); }
-inline const_inst_iterator inst_begin(const Method *M) {
- return const_inst_iterator(*M);
+inline inst_iterator inst_begin(Function *F) { return inst_iterator(*F); }
+inline inst_iterator inst_end(Function *F) { return inst_iterator(*F, true); }
+inline const_inst_iterator inst_begin(const Function *F) {
+ return const_inst_iterator(*F);
}
-inline const_inst_iterator inst_end(const Method *M) {
- return const_inst_iterator(*M, true);
+inline const_inst_iterator inst_end(const Function *F) {
+ return const_inst_iterator(*F, true);
}
#endif
diff --git a/include/llvm/Transforms/Scalar/DCE.h b/include/llvm/Transforms/Scalar/DCE.h
index a8dcb59146..35b929d7e7 100644
--- a/include/llvm/Transforms/Scalar/DCE.h
+++ b/include/llvm/Transforms/Scalar/DCE.h
@@ -8,7 +8,7 @@
#ifndef LLVM_TRANSFORMS_SCALAR_DCE_H
#define LLVM_TRANSFORMS_SCALAR_DCE_H
-#include "llvm/Method.h"
+#include "llvm/Function.h"
#include "llvm/BasicBlock.h"
class Pass;
@@ -60,6 +60,6 @@ Pass *createAgressiveDCEPass();
//
// WARNING: The entry node of a method may not be simplified.
//
-bool SimplifyCFG(Method::iterator &BBIt);
+bool SimplifyCFG(Function::iterator &BBIt);
#endif