From cefbbfadae87135ff37fb4fc1058c6baf8de0140 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Mon, 17 Sep 2018 10:05:43 -0500 Subject: 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 --- src/wasm.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/wasm.h') diff --git a/src/wasm.h b/src/wasm.h index 6d1f67972..09c81e500 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -618,10 +618,16 @@ public: uint32_t fileIndex, lineNumber, columnNumber; bool operator==(const DebugLocation& other) const { return fileIndex == other.fileIndex && lineNumber == other.lineNumber && columnNumber == other.columnNumber; } bool operator!=(const DebugLocation& other) const { return !(*this == other); } + bool operator<(const DebugLocation& other) const { + return fileIndex != other.fileIndex ? fileIndex < other.fileIndex : + lineNumber != other.lineNumber ? lineNumber < other.lineNumber : columnNumber < other.columnNumber; + } }; std::unordered_map debugLocations; + std::set prologLocation; + std::set epilogLocation; - Function() : result(none) {} + Function() : result(none), prologLocation(), epilogLocation() {} size_t getNumParams(); size_t getNumVars(); -- cgit v1.2.3