aboutsummaryrefslogtreecommitdiff
path: root/src/dump_analysis.hpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-10-03 17:58:22 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-10-03 17:58:22 -0400
commit59ac7b91daed86af1ff03aceb7d9e9b8118e06ba (patch)
treeb6078f04125ca49bbb7a34e18c78be68e530d10f /src/dump_analysis.hpp
parent7640bec8e0e735eaba49087840b7f6e6b2dd74ab (diff)
downloadzig-59ac7b91daed86af1ff03aceb7d9e9b8118e06ba.tar.gz
zig-59ac7b91daed86af1ff03aceb7d9e9b8118e06ba.zip
add -fdump-analysis to dump type information to json
This commit adds -fdump-analysis which creates a `$NAME-analysis.json` file with all of the finished semantic analysis that the stage1 compiler produced. It contains types, packages, declarations, and files. This is an initial implementation; some data will be missing. However it's easy to improve the implementation, which is in `src/dump_analysis.cpp`. The next step for #21 will be to create Zig code which parses this json file and creates user-facing HTML documentation. This feature has other uses, however; for example, it could be used for IDE integration features until the self-hosted compiler is available.
Diffstat (limited to 'src/dump_analysis.hpp')
-rw-r--r--src/dump_analysis.hpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/dump_analysis.hpp b/src/dump_analysis.hpp
new file mode 100644
index 0000000000..44a87290e5
--- /dev/null
+++ b/src/dump_analysis.hpp
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2019 Andrew Kelley
+ *
+ * This file is part of zig, which is MIT licensed.
+ * See http://opensource.org/licenses/MIT
+ */
+
+#ifndef ZIG_DUMP_ANALYSIS_HPP
+#define ZIG_DUMP_ANALYSIS_HPP
+
+#include "all_types.hpp"
+#include <stdio.h>
+
+void zig_print_stack_report(CodeGen *g, FILE *f);
+void zig_print_analysis_dump(CodeGen *g, FILE *f);
+
+#endif