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

Removed old BuildDFG.h from Transforms

parent 860b067f
No related branches found
No related tags found
No related merge requests found
Release+Asserts Release+Asserts
libclc libclc
.ycm_extra_conf.py
*.inc *.inc
Output Output
*.o *.o
......
//==- llvm/Transforms/BuildDFG.h - Hierarchical Dataflow Graph Builder Pass -=//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This header file defines prototypes for accessor functions that expose passes
// in the viscc compiler.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TRANSFORMS_BUILDDFG_H
#define LLVM_TRANSFORMS_BUILDDFG_H
#include "llvm/ADT/Statistic.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/Transforms/DFGraph.h"
namespace llvm {
STATISTIC(IntrinsicCounter, "Counts number of visc intrinsics greeted");
class BuildDFG : public ModulePass {
public:
static char ID; // Pass identification, replacement for typeid
BuildDFG() : ModulePass(ID) {}
private:
// Member variables
DFInternalNode *Root;
typedef ValueMap<Value*, DFNode*> HandleToDFNode;
HandleToDFNode HandleToDFNodeMap; // This map associates the i8* pointer
// with the DFNode structure that it
// represents
// Functions
bool isViscIntrinsic(Instruction * I);
void handleCreateNode (DFInternalNode* N, IntrinsicInst* II);
void handleCreateEdge (DFInternalNode* N, IntrinsicInst* II);
void BuildGraph (DFInternalNode* N, Function* F);
void viewDFGraph(DFGraph *G);
public:
virtual bool runOnModule(Module &M);
DFInternalNode* getRoot() {
return Root;
}
};
template <> struct llvm::GraphTraits<DFNode*> {
typedef DFNode NodeType;
typedef typename DFNode::successor_iterator ChildIteratorType;
static inline ChildIteratorType child_begin(NodeType *N) {
return N->successors_begin();
}
static inline ChildIteratorType child_end(NodeType *N) {
return N->successors_end();
}
};
template <> struct llvm::GraphTraits<DFGraph*> : public GraphTraits<DFNode*> {
typedef typename DFGraph::children_iterator nodes_iterator;
static NodeType *getEntryNode(DFGraph* G) {
return G->front();
}
static nodes_iterator nodes_begin(DFGraph *G) {
return G->begin();
}
static inline nodes_iterator nodes_end(DFGraph *G) {
return G->end();
}
};
template<>
struct llvm::DOTGraphTraits<DFGraph*> : public DefaultDOTGraphTraits {
DOTGraphTraits (bool isSimple=false)
: DefaultDOTGraphTraits(isSimple) {}
static std::string getGraphName(DFGraph* G) {
DFInternalNode* Parent = G->getParent();
if(Parent != NULL)
return Parent->getFuncPointer()->getName();
else
return "Dataflow Graph";
}
std::string getNodeLabel (DFNode* N, DFGraph* G) {
return N->getFuncPointer()->getName();
}
static void addCustomGraphFeatures(DFGraph* G, GraphWriter<DFGraph*> &GW) {
}
};
} // end of namespace llvm
#endif
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