summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/wasm.h b/src/wasm.h
index d02d9a1a7..268611f34 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -1609,7 +1609,7 @@ using StackIR = std::vector<StackInst*>;
class Function : public Importable {
public:
- Signature sig; // parameters and return value
+ HeapType type = HeapType(Signature()); // parameters and return value
IRProfile profile = IRProfile::Normal;
std::vector<Type> vars; // non-param locals
@@ -1658,6 +1658,12 @@ public:
delimiterLocations;
BinaryLocations::FunctionLocations funcLocation;
+ Signature getSig() { return type.getSignature(); }
+ Type getParams() { return getSig().params; }
+ Type getResults() { return getSig().results; }
+ void setParams(Type params) { type = Signature(params, getResults()); }
+ void setResults(Type results) { type = Signature(getParams(), results); }
+
size_t getNumParams();
size_t getNumVars();
size_t getNumLocals();