Skip to content
Snippets Groups Projects
Commit ff7c8d10 authored by Prakalp Srivastava's avatar Prakalp Srivastava
Browse files

Changed DFNodeListType and DFEdgeListType to vectors.

Added IntrinsicInst* field to DFNode.
parent 2612f39e
No related branches found
No related tags found
No related merge requests found
......@@ -38,45 +38,42 @@
#define LLVM_IR_DFGRAPH_H
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/Support/Compiler.h"
namespace llvm {
class DFEdge;
class DFNode : public ilist_node<DFNode> {
class DFNode {
private:
typedef iplist<DFNode> DFNodeListType;
typedef iplist<DFEdge> DFEdgeListType;
typedef std::vector<DFNode*> DFNodeListType;
typedef std::vector<DFEdge*> DFEdgeListType;
public:
// DFNode and DFEdge iterators
typedef DFNodeListType::iterator node_iterator;
typedef DFNodeListType::const_iterator const_node_iterator;
typedef DFEdgeListType::iterator edge_iterator;
typedef DFEdgeListType::const_iterator const_edge_iterator;
private:
// Important things that make up a Dataflow Node
IntrinsicInst* II; ///< Associated IntrinsicInst/Value
Function* FuncPointer; ///< Associated Function
DFNode* Parent; ///< Pointer to parent dataflow Node
int NumOfDim; ///< Number of dimensions
std::vector<int> DimLimits; ///< Number of instances in each dimension
DFNode* Parent; ///< Pointer to parent dataflow Node
DFNodeListType ChildrenList; ///< List of children Dataflow Nodes
DFEdgeListType DFEdgeList; ///< List of Dataflow edges among children
public:
// Functions
DFNode(IntrinsicInst* _II, Function* _FuncPointer, DFNode* _Parent, int _NumOfDim,
std::vector<int> _DimLimits) : II(_II), FuncPointer(_FuncPointer),
Parent(_Parent), NumOfDim(_NumOfDim), DimLimits(_DimLimits) {}
//FIXME: Write a matching constructor, then uncomment this function.
/*static DFNode *Create(Function* FuncPointer, int NumOfDim = 0, DFNode* Parent = NULL) {
return new DFNode(FuncPointer, NumOfDim, Parent);
public:
}*/
static DFNode *Create(IntrinsicInst* II, Function* FuncPointer, DFNode* Parent = NULL,
int NumOfDim = 0, std::vector<int> DimLimits = std::vector<int>()) {
return new DFNode(II, FuncPointer, Parent, NumOfDim, DimLimits);
}
};
class DFEdge : public ilist_node<DFEdge> {
class DFEdge {
private:
// Important things that make up a Dataflow Edge
DFNode* SrcDF; ///< Pointer to source dataflow Node
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment