summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/wasm.h b/src/wasm.h
index 99ea59728..9aafb7425 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -1160,12 +1160,17 @@ struct Importable {
class Function;
+// Represents an offset into a wasm binary file. This is used for debug info.
+// For now, assume this is 32 bits as that's the size limit of wasm files
+// anyhow.
+using BinaryLocation = uint32_t;
+
// Represents a mapping of wasm module elements to their location in the
// binary representation. This is used for general debugging info support.
// Offsets are relative to the beginning of the code section, as in DWARF.
struct BinaryLocations {
struct Span {
- uint32_t start, end;
+ BinaryLocation start, end;
};
std::unordered_map<Expression*, Span> expressions;
std::unordered_map<Function*, Span> functions;
@@ -1204,7 +1209,7 @@ public:
// Source maps debugging info: map expression nodes to their file, line, col.
struct DebugLocation {
- uint32_t fileIndex, lineNumber, columnNumber;
+ BinaryLocation fileIndex, lineNumber, columnNumber;
bool operator==(const DebugLocation& other) const {
return fileIndex == other.fileIndex && lineNumber == other.lineNumber &&
columnNumber == other.columnNumber;