summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2017-04-13 15:12:48 -0700
committerGitHub <noreply@github.com>2017-04-13 15:12:48 -0700
commitec66e273e350c3d48df0ccaaf73c53b14485848f (patch)
treefeb2c5369686faf7a4a170df550e0ce18229b39c /src/wasm.h
parent57a2bb96c7b8a98433446828aca845a9e9be8c3d (diff)
downloadbinaryen-ec66e273e350c3d48df0ccaaf73c53b14485848f.tar.gz
binaryen-ec66e273e350c3d48df0ccaaf73c53b14485848f.tar.bz2
binaryen-ec66e273e350c3d48df0ccaaf73c53b14485848f.zip
Replace text annotations with explicit file/line for debug info (#967)
Rather than storing debug info as text annotations, store explicit file and line information. This will make it easier to experiment with outputting other serializations or representations (e.g. source maps), and will allow outputting debug info for binaries as well.
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/wasm.h b/src/wasm.h
index 9cfcb4ca8..b27fe6acb 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -510,8 +510,10 @@ public:
std::vector<Name> localNames;
std::map<Name, Index> localIndices;
- // node annotations, printed alongside the node in the text format
- std::unordered_map<Expression*, std::string> annotations;
+ struct DebugLocation {
+ uint32_t fileIndex, lineNumber;
+ };
+ std::unordered_map<Expression*, DebugLocation> debugLocations;
Function() : result(none) {}
@@ -647,6 +649,7 @@ public:
Name start;
std::vector<UserSection> userSections;
+ std::vector<std::string> debugInfoFileNames;
MixedArena allocator;