Pedo Anton Lefering be1d0da99e update 3 anni fa
..
.d4d__memzero.dot eee1e2fefb small update 3 anni fa
.d4d_deinit.dot eee1e2fefb small update 3 anni fa
.d4d_init.dot eee1e2fefb small update 3 anni fa
.d4d_version.dot eee1e2fefb small update 3 anni fa
.d4dag___splay_tree_delete.dot eee1e2fefb small update 3 anni fa
.d4dag___splay_tree_insert.dot eee1e2fefb small update 3 anni fa
.rotate_left.dot eee1e2fefb small update 3 anni fa
.rotate_right.dot eee1e2fefb small update 3 anni fa
.splay_tree_compare_ints.dot eee1e2fefb small update 3 anni fa
.splay_tree_delete.dot 7c13b85a6e ported newest gcc compiler splay-tree.c to graph layout program 3 anni fa
.splay_tree_delete_helper.dot eee1e2fefb small update 3 anni fa
.splay_tree_insert.dot 34cbc1d2a8 small update 3 anni fa
.splay_tree_new.dot eee1e2fefb small update 3 anni fa
.splay_tree_new_typed_alloc.dot eee1e2fefb small update 3 anni fa
.splay_tree_new_with_allocator.dot eee1e2fefb small update 3 anni fa
.splay_tree_splay.dot eee1e2fefb small update 3 anni fa
.splay_tree_xmalloc_allocate.dot eee1e2fefb small update 3 anni fa
.splay_tree_xmalloc_deallocate.dot eee1e2fefb small update 3 anni fa
LICENSE 23c394f2f8 updated docs 3 anni fa
Makefile 7c13b85a6e ported newest gcc compiler splay-tree.c to graph layout program 3 anni fa
OverCG.py 2360df9d47 added callgraph from llvm ir script 3 anni fa
README.md be1d0da99e update 3 anni fa
callgraph.dot 04c24b068b icc update 3 anni fa
d4dag-clang.s 1ffcbe8bab some more gcc data 3 anni fa
d4dag-gcc-wa.s 1ffcbe8bab some more gcc data 3 anni fa
d4dag-gcc.s 1ffcbe8bab some more gcc data 3 anni fa
d4dag-unloop.c ee11cd2d37 bug fixed cutils-1.6 cunloop as simplec.l 3 anni fa
d4dag.bc.callgraph.dot eee1e2fefb small update 3 anni fa
d4dag.c be1d0da99e update 3 anni fa
d4dag.c.006t.gimple eee1e2fefb small update 3 anni fa
d4dag.c.021t.ssa.dot 184749c49c added gcc compiler data 3 anni fa
d4dag.c.071i.whole-program.dot 184749c49c added gcc compiler data 3 anni fa
d4dag.c.237r.expand.dot 184749c49c added gcc compiler data 3 anni fa
d4dag.callgraph-info.gv eee1e2fefb small update 3 anni fa
d4dag.callgraph-info.svg eee1e2fefb small update 3 anni fa
d4dag.ci eee1e2fefb small update 3 anni fa
d4dag.css 6f49227733 d4dag update 3 anni fa
d4dag.h be1d0da99e update 3 anni fa
d4dag.html 6f49227733 d4dag update 3 anni fa
d4dag.js 99c34fb212 updated js 3 anni fa
d4dag.ll eee1e2fefb small update 3 anni fa
d4dag.ll.callgraph.gv eee1e2fefb small update 3 anni fa
d4dag.optrpt 1ffcbe8bab some more gcc data 3 anni fa
d4dag.s 1ffcbe8bab some more gcc data 3 anni fa
d4dag.wat 184749c49c added gcc compiler data 3 anni fa
d4dagdemo.js 6f49227733 d4dag update 3 anni fa
gml4gtk-gcc-splay-tree-summary-callgraph.png eee1e2fefb small update 3 anni fa
gplv3.png 99c34fb212 updated js 3 anni fa
icc.sh 04c24b068b icc update 3 anni fa
lindent.sh 7c13b85a6e ported newest gcc compiler splay-tree.c to graph layout program 3 anni fa
main.c eee1e2fefb small update 3 anni fa
mkcallgraph.sh d280d73d3e added gcc gimple intermediate compiler data 3 anni fa
simplec.l c3334c391e some wasm added 3 anni fa
todo.txt 403df6abc5 added sparse and smatch support 3 anni fa

README.md

ㄟ(≧◇≦)ㄏ

About

This is a single file directed graph layout library in C and javascript with extra graph features

  • Multiple graphs at once
  • Subgraph support in a graph
  • Folding of subgraphs in a graph
  • Layout and re-layout
  • Superbubbles algorithm to automatic find subparts of the graph

Install

make

Usage

The user program must supply nodes with the needed (x,y) size of the node with the label text.
The user program must supply edges between the nodes with optional size (x,y) for edge label text.
After layout the data of the drawing is available using routines and the user program can draw a image or gui window.

Api

The api is in d4dag.h

Usage-examples

Embedded in qvge this creates layout and qvge does the drawing and qt5 gui controls.

Goals

The only way for secure programming is simplified C and using parts of misra, nasa and other guides
The use of the unloop tool will result in a very much simplified ast with only if and goto statements
Maybe then the amount of actually used code in the compiler is much smaller resulting in less trouble
At least with gcc there is difference in number of compiler building blocks to be studied more
This is not mission-critial software but attempts are made to follow some guides
https://github.com/abougouffa/awesome-coding-standards
https://en.wikipedia.org/wiki/The_Power_of_10:_Rules_for_Developing_Safety-Critical_Code

  • Avoid complex flow constructs, such as goto and recursion.
  • All loops must have fixed bounds. This prevents runaway code.
  • Avoid heap memory allocation.
  • Restrict functions to a single printed page.
  • Use a minimum of two runtime assertions per function.
  • Restrict the scope of data to the smallest possible.
  • Check the return value of all non-void functions, or cast to void to indicate the return value is useless.
  • Use the preprocessor sparingly.
  • Limit pointer use to a single dereference, and do not use function pointers.
  • Compile with all possible warnings active; all warnings should then be addressed before release of the software.
    And much more is possible.

This is a guide for gcc clang compilers from airbus aerospace https://github.com/airbus-seclab/c-compiler-security
Also the Free rosechecker project on sourceforge has a tool for cert standards
There are more Free tools as Linux kernel sparse source checker and others available to use
This source is not sabotaged because of wrongdoing politics as some other GPL Free projects do
This source has no linkage to other libs to make it easy for embedded devices or wasm web assembly
The d4dag.c graph layout routines can be compiled to webassebly using emscripten
The d4dag.c graph layout routines can be compiled to llvm bytecode to lisp to java bytecode to javascript
The d4dag.c graph layout routines can be compiled to llvm bytecode to javascript assembly to java bytecode to javascript
The d4dag.c source is created to be usable for internet of things iot and embedded applications
The fedora Linux has a internet of things edition maintained and tested with the extra tools needed
The simplec.l is a bug fixed version of cunloop in cutils-1.6 which has bugs

Javascript

Because there is no good usable GNU GPL Free javascript directed graph layout
creating something in d4dag.js and d4dag.html doing a sugiyama graph layout

Notes

The d4dag.wat file has some generated wasm web assembly
The wandbox.org site has a browser page to paste C source and test the output with many gcc and clang compiler versions
The OverCG.py script generates callgraph from llvm ir ll textual data files
The sparse-llvm compiler is used to generate llvm bitcode
The smatch source checker from sourceforge is used to check
The sourceforge smatch repo is not maintained but the updated version as at https://repo.or.cz/w/smatch.git
There is support for Intel icc compiler which has extra features

License

This is GNU GPL Version 3+ Free Software

This is the compact callgraph of d4dag.c
callgraph

SPDX-License-Identifier: GPL-3.0+
License-Filename: LICENSE

gplv3

Made in 🇳🇱