summaryrefslogtreecommitdiff
path: root/src/wasm-binary.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-binary.h')
-rw-r--r--src/wasm-binary.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index 12aecfeaa..813404895 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -666,10 +666,21 @@ class WasmBinaryWriter : public Visitor<WasmBinaryWriter, void> {
void prepare();
public:
- WasmBinaryWriter(Module* input, BufferWithRandomAccess& o, bool debug) : wasm(input), o(o), debug(debug) {
+ WasmBinaryWriter(Module* input, BufferWithRandomAccess& o, bool debug = false) : wasm(input), o(o), debug(debug) {
prepare();
}
+ // locations in the output binary for the various parts of the module
+ struct TableOfContents {
+ struct Entry {
+ Name name;
+ size_t offset; // where the entry starts
+ size_t size; // the size of the entry
+ Entry(Name name, size_t offset, size_t size) : name(name), offset(offset), size(size) {}
+ };
+ std::vector<Entry> functionBodies;
+ } tableOfContents;
+
void setNamesSection(bool set) { debugInfo = set; }
void setSourceMap(std::ostream* set, std::string url) {
sourceMap = set;