Fix the struct viz

Change-Id: If8dee21e5fd337e50460a85a753f69ecd4818571
This commit is contained in:
Romain Goyet
2017-04-20 09:51:29 +02:00
parent 4d6eddb411
commit 097ecc8b89
2 changed files with 16 additions and 1 deletions

View File

@@ -1,5 +1,10 @@
products += apps/main.ast build/struct_layout/data.json
.PHONY: apps_container_struct_layout
OPEN = open
ifeq ($(CXX),clang++)
%.ast: %.cpp %.o
@echo "AST $@"
@$(CXX) -fno-color-diagnostics -Xclang -fdump-record-layouts $(SFLAGS) $(CXXFLAGS) -MF /dev/null -c $< -o /dev/null > $@
@@ -7,3 +12,13 @@ products += apps/main.ast build/struct_layout/data.json
%.ast.json: %.ast
@echo "JSON $@"
@cat $< | ruby build/struct_layout/ast_to_json.rb AppsContainer > $@
apps_container_struct_layout: apps/main.ast.json
$(OPEN) build/struct_layout/visualization.html
else
apps_container_struct_layout:
@echo "Struct layout requires the use of Clang"
endif

View File

@@ -104,7 +104,7 @@ grandparent.append("text")
.attr("y", 6 - margin.top)
.attr("dy", ".75em");
d3.json("../apps/main.ast.json", function(root) {
d3.json("../../apps/main.ast.json", function(root) {
initialize(root);
accumulate(root);
layout(root);