52 #ifndef ETISS_INTERFACES_DOT_H
53 #define ETISS_INTERFACES_DOT_H
64 #include <unordered_map>
65 #include <unordered_set>
71 struct hash<std::pair<void const *, void const *>>
73 std::hash<intptr_t>
mh;
74 inline size_t operator()(
const std::pair<void const *, void const *> &
x)
const
107 void print(std::ostream &out,
const std::string &appendedattr);
120 parent->
nodes_.insert(
this);
122 dot->idmap_.insert(std::make_pair(
id_,
this));
145 inline const std::unordered_set<Link *> &
links() {
return links_; }
151 virtual void print(std::ostream &out, std::unordered_set<Link *> &icl);
180 void print(std::ostream &out);
211 inline const std::unordered_set<Node *> &
nodes() {
return nodes_; }
214 void print(std::ostream &out, std::unordered_set<Link *> &icl)
override;
219 std::unordered_map<std::string, Node *>
idmap_;
225 Graph *
createG(std::string name =
"");
226 Graph *
createG(Graph *parent, std::string name =
"");
227 Node *
createN(Graph *,
const std::string &
id, std::string name =
"");
241 Node *
lopenN(
const std::list<std::string> &labelpath);
244 virtual void print(std::ostream &out);
271 void defineNode(
const void *
id,
const std::string &name);
274 Link *
link(
const void *src,
const void *dst);
276 void flush(std::ofstream &out,
const std::string &graph);
280 std::unordered_set<Node *> &nnl,
281 std::unordered_set<std::pair<const void *, const void *>> &dependencies,
282 std::unordered_set<Node *> &declared);
287 std::unordered_map<const void *, std::string>
nodes_;
315 const void *
const id;
324 void setAttr(
const std::string &name,
const std::string &value);
337 if ((
src == 0) || (
dst == 0))
355 void defineNode(
const void *
id,
const std::string &name);
358 void link(
const void *dst, std::initializer_list<const void *> sources,
const char *label = 0);
364 const std::unordered_set<std::pair<const void *, const void *>> &
staticDependencies()
const;
392 std::function<void(
Link *,
Node * ,
Node *
const * ,
size_t ,
393 std::initializer_list<const void *> & ,
const char * )>
412 std::unordered_map<const void *, std::unordered_set<const void *>, std::hash<const void *>,
413 std::equal_to<const void *>,
417 std::unordered_map<const void *, std::string, std::hash<const void *>, std::equal_to<const void *>,
421 std::unordered_set<std::pair<const void *, const void *>, std::hash<std::pair<const void *, const void *>>,
422 std::equal_to<std::pair<const void *, const void *>>,
428 inline void declare(
const void *
const id,
const std::string &name)
430 names_.insert(std::make_pair(
id, name));
438 void link(
const void *dst,
const std::initializer_list<const void *> &sources);
440 void write(std::ostream &out,
const std::string &graphname,
441 std::function<
bool(
const void * ,
const void * , std::string & )> filterOutCon =
442 [](
const void *,
const void *, std::string &) {
return false; },
443 std::function<void(
const void * , std::string & )> nodeattr = [](
const void *,
447 #ifdef TRACEABLEFIED_H_
449 void tf_write(
const std::string &filename);
general configuration and logging
static __inline__ uint64_t
implements a stack that may only grow (if needed) and can only contain native types since no destruct...
prealloc_inc defines the number of objects that is availabe within ObjectPools memory; default: 100
void print(std::ostream &out, const std::string &appendedattr)
Graph * asGraph() override
const std::unordered_set< Node * > & nodes()
std::unordered_set< Node * > nodes_
void print(std::ostream &out, std::unordered_set< Link * > &icl) override
Graph(Dot *dot, Graph *parent)
Link(Node *src, Node *dst)
void print(std::ostream &out)
std::unordered_set< Link * > links_
virtual void print(std::ostream &out, std::unordered_set< Link * > &icl)
virtual Graph * asGraph()
Node(Dot *dot, Graph *parent, const std::string &id)
const std::unordered_set< Link * > & links()
Node * pcreateN(Graph *g, const void *id, std::string name="")
const std::list< Graph * > graphs()
Node * createN(Graph *, const std::string &id, std::string name="")
std::unordered_map< std::string, Node * > idmap_
virtual void print(std::ostream &out)
Graph * createG(std::string name="")
Node * lopenN(const std::list< std::string > &labelpath)
travel/creates sub graphs with the given labels until i find/creates a node for the lase label.
std::list< Graph * > graphs_
Link * createE(Node *src, Node *dst, std::string name="")
Node * find(const std::string &id)
static const size_t label_size
void attrToString(std::ostream &out)
Link(Node *src, Node *dst)
void setLabel(const char *)
const std::unordered_set< Link * > & links_out_
void attrToString(std::ostream &out)
const std::unordered_set< Link * > & links_in_
void setAttr(const std::string &name, const std::string &value)
std::map< std::string, std::string > * attrMap
std::unordered_set< Link * > links_in
std::unordered_set< Link * > links_out
const std::unordered_set< std::pair< const void *, const void * > > & staticDependencies() const
Node * openSourceNode(const void *const src)
bool enable_default_graph_streaming_
set to false to disable the streaming of variable dependencies over time.
void undefineNode(const void *id)
std::function< void(Link *, const etiss::ExpandingNativeStack< Link *, 1000 > &)> setMetaLinkAttr
etiss::ObjectPool< Link > link_alloc_
etiss::FixedSizeHashMap< const void *, Node *, etiss::pointerHash< const void > > currentnodes_
etiss::ObjectPool< Node > node_alloc_
char depout_buf[256 *256]
std::function< void(Node *)> setCurrentNodeAttr
std::function< void(const etiss::ExpandingNativeStack< Link *, 1000 > &)> custWritePath
std::unordered_set< std::pair< const void *, const void * > > dependencies_
ValueOperationTraceGraphStreamer(const std::string &file, const std::string &depfile)
void link(const void *dst, std::initializer_list< const void * > sources, const char *label=0)
etiss::ExpandingNativeStack< Link *, 1000 > path
std::function< bool(const etiss::ExpandingNativeStack< Link *, 1000 > &)> hidePath
std::function< void(Link *, Node *, Node *const *, size_t, std::initializer_list< const void * > &, const char *)> setCurrentLinkAttr
Node * openDestNode(const void *const dst, Node *&cleanup)
etiss::FixedSizeHashMap< Node *, uint64_t, etiss::pointerHash< const void > > nodeToTmpId_
void defineNode(const void *id, const std::string &name)
etiss::FixedSizeHashMap< const void *, std::string, etiss::pointerHash< const void > > nodes_
~ValueOperationTraceGraphStreamer()
std::list< Link * > links
Link * link(const void *src, const void *dst)
void filterTmp(Node *start, Node *tmp, bool hideedge, const std::string &alabels, std::ofstream &out, std::unordered_set< Node * > &nnl, std::unordered_set< std::pair< const void *, const void * >> &dependencies, std::unordered_set< Node * > &declared)
std::unordered_map< const void *, Node * > currentdstnodes_
void defineNode(const void *id, const std::string &name)
void undefineNode(const void *id)
std::unordered_map< const void *, Node * > currentnodes_
std::unordered_map< const void *, std::string > nodes_
void flush(std::ofstream &out, const std::string &graph)
std::unordered_map< const void *, std::unordered_set< const void * >, std::hash< const void * >, std::equal_to< const void * >, etiss::ObjectPool< std::pair< const void *const, std::unordered_set< const void * > > > > tmp_
VariableDependencyGraph()
void link(const void *dst, const std::initializer_list< const void * > &sources)
void declare(const void *const id, const std::string &name)
std::unordered_set< std::pair< const void *, const void * >, std::hash< std::pair< const void *, const void * > >, std::equal_to< std::pair< const void *, const void * > >, etiss::ObjectPool< std::pair< const void *, const void * > > > deps_
void deleted(const void *const id)
std::unordered_map< const void *, std::string, std::hash< const void * >, std::equal_to< const void * >, etiss::ObjectPool< std::pair< const void *const, std::string > > > names_
void write(std::ostream &out, const std::string &graphname, std::function< bool(const void *, const void *, std::string &)> filterOutCon=[](const void *, const void *, std::string &) { return false;}, std::function< void(const void *, std::string &)> nodeattr=[](const void *, std::string &) {})
std::set< Instruction * > Node
Holding unique instruction sets code chunks after permutation.
Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.
std::string toString(const T &val)
conversion of type T to std::string.
__INTPTR_TYPE__ intptr_t
A signed integer type with the property that any valid pointer to void can be converted to this type,...
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
float __ovld __cnfn dot(float p0, float p1)
Compute dot product.
size_t operator()(const std::pair< void const *, void const * > &x) const