summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/wabt/c-writer.h1
-rw-r--r--include/wabt/ir.h14
2 files changed, 15 insertions, 0 deletions
diff --git a/include/wabt/c-writer.h b/include/wabt/c-writer.h
index b9fb40de..8e400674 100644
--- a/include/wabt/c-writer.h
+++ b/include/wabt/c-writer.h
@@ -29,6 +29,7 @@ class Stream;
struct WriteCOptions {
std::string_view module_name;
+ Features features;
/*
* name_to_output_file_index takes const iterators to begin and end of a list
* of all functions in the module, number of imported functions, and number of
diff --git a/include/wabt/ir.h b/include/wabt/ir.h
index 2bc5d9bd..49b7e2b0 100644
--- a/include/wabt/ir.h
+++ b/include/wabt/ir.h
@@ -310,6 +310,13 @@ class FuncType : public TypeEntry {
Type GetResultType(Index index) const { return sig.GetResultType(index); }
FuncSignature sig;
+
+ // The BinaryReaderIR tracks whether a FuncType is the target of a tailcall
+ // (via a return_call_indirect). wasm2c (CWriter) uses this information to
+ // limit its output in some cases.
+ struct {
+ bool tailcall = false;
+ } features_used;
};
struct Field {
@@ -893,6 +900,13 @@ struct Func {
BindingHash bindings;
ExprList exprs;
Location loc;
+
+ // For a subset of features, the BinaryReaderIR tracks whether they are
+ // actually used by the function. wasm2c (CWriter) uses this information to
+ // limit its output in some cases.
+ struct {
+ bool tailcall = false;
+ } features_used;
};
struct Global {