diff options
author | Derek Schuff <dschuff@chromium.org> | 2017-04-13 15:12:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-13 15:12:48 -0700 |
commit | ec66e273e350c3d48df0ccaaf73c53b14485848f (patch) | |
tree | feb2c5369686faf7a4a170df550e0ce18229b39c /src/passes/Print.cpp | |
parent | 57a2bb96c7b8a98433446828aca845a9e9be8c3d (diff) | |
download | binaryen-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/passes/Print.cpp')
-rw-r--r-- | src/passes/Print.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 04bf74529..9a2edcb6b 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -49,10 +49,11 @@ struct PrintSExpression : public Visitor<PrintSExpression> { void visit(Expression* curr) { if (currFunction) { // show an annotation, if there is one - auto& annotations = currFunction->annotations; - auto iter = annotations.find(curr); - if (iter != annotations.end()) { - o << ";; " << iter->second << '\n'; + auto& debugLocations = currFunction->debugLocations; + auto iter = debugLocations.find(curr); + if (iter != debugLocations.end()) { + auto fileName = currModule->debugInfoFileNames[iter->second.fileIndex]; + o << ";; " << fileName << ":" << iter->second.lineNumber << '\n'; doIndent(o, indent); } } |