diff options
author | Yury Delendik <ydelendik@mozilla.com> | 2018-09-17 10:05:43 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-17 10:05:43 -0500 |
commit | cefbbfadae87135ff37fb4fc1058c6baf8de0140 (patch) | |
tree | 4be93c23ad7cb95623f699a2fff9ef829abc426c /src/wasm-s-parser.h | |
parent | 403be53fb84645b9338454681792538af876cf87 (diff) | |
download | binaryen-cefbbfadae87135ff37fb4fc1058c6baf8de0140.tar.gz binaryen-cefbbfadae87135ff37fb4fc1058c6baf8de0140.tar.bz2 binaryen-cefbbfadae87135ff37fb4fc1058c6baf8de0140.zip |
Add debug information locations to the function prolog/epilog (#1674)
The current patch:
* Preserves the debug locations from function prolog and epilog
* Preserves the debug locations of the nested blocks
Diffstat (limited to 'src/wasm-s-parser.h')
-rw-r--r-- | src/wasm-s-parser.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index 02a20b651..d492d0c3c 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -51,7 +51,7 @@ class Element { bool quoted_; public: - Element(MixedArena& allocator) : isList_(true), list_(allocator), line(-1), col(-1), loc(nullptr) {} + Element(MixedArena& allocator) : isList_(true), list_(allocator), line(-1), col(-1), startLoc(nullptr), endLoc(nullptr) {} bool isList() const { return isList_; } bool isStr() const { return !isList_; } @@ -59,7 +59,9 @@ public: bool quoted() const { return isStr() && quoted_; } size_t line, col; - SourceLocation* loc; + // original locations at the start/end of the S-Expression list + SourceLocation* startLoc; + SourceLocation* endLoc; // list methods List& list(); @@ -72,7 +74,7 @@ public: cashew::IString str() const; const char* c_str() const; Element* setString(cashew::IString str__, bool dollared__, bool quoted__); - Element* setMetadata(size_t line_, size_t col_, SourceLocation* loc_); + Element* setMetadata(size_t line_, size_t col_, SourceLocation* startLoc_); // printing friend std::ostream& operator<<(std::ostream& o, Element& e); @@ -218,6 +220,8 @@ private: void parseElem(Element& s); void parseInnerElem(Element& s, Index i = 1, Expression* offset = nullptr); void parseType(Element& s); + + Function::DebugLocation getDebugLocation(const SourceLocation& loc); }; } // namespace wasm |