diff options
Diffstat (limited to 'src/wasm.h')
-rw-r--r-- | src/wasm.h | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/wasm.h b/src/wasm.h index 04e2faeb3..295088780 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -1413,10 +1413,10 @@ struct BinaryLocations { // control flow, have, like 'end' for loop and block. We keep these in a // separate map because they are rare and we optimize for the storage space // for the common type of instruction which just needs a Span. We implement - // this as a simple struct with two elements (as two extra elements is the - // maximum currently needed; due to 'catch' and 'end' for try-catch). The - // second value may be 0, indicating it is not used. - struct DelimiterLocations : public std::array<BinaryLocation, 2> { + // this as a simple array with one element at the moment (more elements may + // be necessary in the future). + // TODO: If we are sure we won't need more, make this a single value? + struct DelimiterLocations : public std::array<BinaryLocation, 1> { DelimiterLocations() { // Ensure zero-initialization. for (auto& item : *this) { @@ -1425,14 +1425,7 @@ struct BinaryLocations { } }; - enum DelimiterId { - // All control flow structures have an end, so use index 0 for that. - End = 0, - // Use index 1 for all other current things. - Else = 1, - Catch = 1, - Invalid = -1 - }; + enum DelimiterId { Else = 0, Catch = 0, Invalid = -1 }; std::unordered_map<Expression*, DelimiterLocations> delimiters; // DWARF debug info can refer to multiple interesting positions in a function. |