Here is one of the first nice looking outputs of my work on the gcc introspector in a long time. I am using the semantic web stack to processs gcc compiler graphs. My new take on this is to parse the tree dump outputs of the compiler as it’s own language using a python lex/yacc. Then I convert the tree graphs into RDF graphs and load them into a sparql database server and visualize them using d3/sparql.

The d3forcegraph graph looks like this :

graph1

Source of graph https://gist.github.com/h4ck3rm1k3/f8ca2cb3b9643e83200b

This query collects the edges of OP0,..OP3 args and it shows how there is a great graph of interconnections in the code.

SELECT ?on ?bn WHERE {
bind(replace(str(?o),’http://introspector.xyz/projects/bash/build/eval.c.001t.tu#’,”) as ?on)
bind(replace(str(?b),’http://introspector.xyz/projects/bash/build/eval.c.001t.tu#’,”) as ?bn){
?o <http://introspector.xyz/gcc/field_types.owl#OP0&gt; ?b.
}union {
?o <http://introspector.xyz/gcc/field_types.owl#OP1&gt; ?b.
}union {
?o <http://introspector.xyz/gcc/field_types.owl#OP2&gt; ?b.
}union {
?o <http://introspector.xyz/gcc/field_types.owl#OP3&gt; ?b.
}}

I have a patched version of the d3 sparql system :
https://github.com/h4ck3rm1k3/d3sparql

It is talking to the blazegraph server:
https://www.blazegraph.com/

That has this graph loaded (rdf) :
https://gist.github.com/h4ck3rm1k3/b99f78e7d415e80d1590

That was produced by my python code parsing the tu files:
https://github.com/h4ck3rm1k3/gcc_py_introspector

Reading the compiler graph data from bash, collected here
https://archive.org/details/bash.compilation

Advertisements