summaryrefslogtreecommitdiff
path: root/src/binaryen-c.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-07-12 15:00:26 -0700
committerGitHub <noreply@github.com>2016-07-12 15:00:26 -0700
commitcd707e8ef504cca1e1a6a73580672af14bc40d38 (patch)
treecb45aaaaeb8754d5d14dd7ddf74c719264606901 /src/binaryen-c.h
parent8e936ce0635b66a3b2754292bab7c6c262b0bb1f (diff)
parent43ae9d622a33ca6ede829524a99bdec9f6b2bfc6 (diff)
downloadbinaryen-cd707e8ef504cca1e1a6a73580672af14bc40d38.tar.gz
binaryen-cd707e8ef504cca1e1a6a73580672af14bc40d38.tar.bz2
binaryen-cd707e8ef504cca1e1a6a73580672af14bc40d38.zip
Merge pull request #627 from WebAssembly/trace-c-api-nice
Add a tracing option to the c api
Diffstat (limited to 'src/binaryen-c.h')
-rw-r--r--src/binaryen-c.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/binaryen-c.h b/src/binaryen-c.h
index 3f940c0cc..3ed5f167f 100644
--- a/src/binaryen-c.h
+++ b/src/binaryen-c.h
@@ -24,6 +24,9 @@
// The third part of the API lets you provide a general control-flow
// graph (CFG) as input.
//
+// The final part of the API contains miscellaneous utilities like
+// debugging/tracing for the API itself.
+//
// ---------------
//
// Thread safety: You can create Expressions in parallel, as they do not
@@ -337,7 +340,7 @@ BinaryenExportRef BinaryenAddExport(BinaryenModuleRef module, const char* intern
// Function table. One per module
-void BinaryenSetFunctionTable(BinaryenModuleRef module, BinaryenFunctionRef* functions, BinaryenIndex numFunctions);
+void BinaryenSetFunctionTable(BinaryenModuleRef module, BinaryenFunctionRef* funcs, BinaryenIndex numFuncs);
// Memory. One per module
@@ -410,6 +413,19 @@ void RelooperAddBranchForSwitch(RelooperBlockRef from, RelooperBlockRef to, Bina
// an i32 local variable that is free for us to use.
BinaryenExpressionRef RelooperRenderAndDispose(RelooperRef relooper, RelooperBlockRef entry, BinaryenIndex labelHelper, BinaryenModuleRef module);
+//
+// ========= Other APIs =========
+//
+
+// Sets whether API tracing is on or off. It is off by default. When on, each call
+// to an API method will print out C code equivalent to it, which is useful for
+// auto-generating standalone testcases from projects using the API.
+// When calling this to turn on tracing, the prelude of the full program is printed,
+// and when calling it to turn it off, the ending of the program is printed, giving
+// you the full compilable testcase.
+// TODO: compile-time option to enable/disable this feature entirely at build time.
+void BinaryenSetAPITracing(int on);
+
#ifdef __cplusplus
} // extern "C"
#endif